DESCRIPTION

Log warnings about invalid git config entries

Instead of propagating the IllegalArgumentException that JGit throws,
catch it, log the problem, and then return the default value.

Bug: 520978
Change-Id: Ibf57badc91db8bba86e3a2c9e90f735e590858c8
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2017-08-15 15:50:37.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2017-08-15 15:50:42.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/10096/

-------------------------------------
author: Brenden Conley
date: 2017-08-15 15:52:02.000000000

Patch Set 2: Verified-1

Build Failed 

https://hudson.eclipse.org/egit/job/egit.gerrit/10096/ : FAILURE

-------------------------------------
author: Douglas Trujillo
date: 2017-08-16 07:28:21.000000000

Patch Set 2:

(1 comment)

Line:25, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ReportingTypedConfigGetter.java -> move this class to JGit (https://git.eclipse.org/r/#/c/103102/) to enable reuse ?

-------------------------------------
author: Alayna Houston
date: 2017-08-21 05:46:08.000000000

Patch Set 2:

(1 comment)

Line:25, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ReportingTypedConfigGetter.java -> I want the log messages in the Eclipse log and appearing in the "Error Log" view. If I move this to JGit, I'd have to log via slf4j, and thus we'd need a bridge between slf4j and the OSGI logs used by Eclipse.

I have no clear idea how to do such a bridge; the one used by xtext for instance is (a) specific to the Apache back-end and (b) replaces the default logging config, so even if we did something similar, we might get problems. (There'd be a 2nd fragment replacing that logging config, and it's entirely unclear which config would be active in the end.) A similar bridge in m2e is specific to the ch.qos back-end.

So I prefer to do it the simple way and use the Eclipse platform logging mechanism right away. But that means the class cannot be in JGit.

If we want this to be reuseable, we might make this public API in egit.core.

-------------------------------------
author: Douglas Trujillo
date: 2017-08-21 06:14:56.000000000

Patch Set 2:

(1 comment)

Line:25, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ReportingTypedConfigGetter.java -> Gunnar proposed a bridge implementation for platform here
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=514326
and https://git.eclipse.org/r/#/c/96277/

I have it on my must-review list, will review this change later this week

-------------------------------------
author: Alayna Houston
date: 2017-08-21 09:12:52.000000000

Patch Set 2:

(1 comment)

Line:25, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ReportingTypedConfigGetter.java -> I agree it would be good if platform provided this. But what would we do for older platforms (Luna to Oxygen)?

-------------------------------------
author: Douglas Trujillo
date: 2017-08-21 21:18:17.000000000

Patch Set 2:

> > include the bridge in the egit p2 repository to enable
 > installation
 > > on older platform versions ?
 > 
 > Perhaps. If the bridge is Luna-compatible it might work. Currently
 > it isn't; it requires org.eclipse.core.runtime 3.12.0 whereas Luna
 > has 3.10.0. It also requires slf4j-nop 1.7.10; Luna has slf4j 1.7.2
 > and slf4j-log4j 1.7.2. I doubt this is going to be backported, and
 > having different minimum requirements than the rest of this logging
 > (see logging/pom.xml) is probably also not a good idea.

ok I agree, if this isn't straight forward we shouldn't move ReportingTypedConfigGetter to JGit now

-------------------------------------
