DESCRIPTION

[398982] GitFileHistory should return the full history of its target.

When using GitFileHistoryProvider.getFileHistoryFor(IResource,...), a
user expects the full history of the target resource to be returned,
except if the SINGLE_REVISION or SINGLE_LINE_OF_DESCENT flags are
positionned.

The SINGLE_REVISION flag is properly handled, however when no flags are
set, EGit previously returned only the commits descending from HEAD,
without considering the history that exists on other branches or
references.

This adds specific tests to make sure of the behavior when either no
flag or the SINGLE_REVISION flag are set.

The SINGLE_LINE_OF_DESCENT flag remains to be handled.

Bug: 398982
Change-Id: Id596d4501cdca815e9563a1f7f4a1d58bc3920c9


COMMENTS

author: Gustavo Green
date: 2013-02-08 15:39:20.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2013-02-08 15:39:26.000000000

Patch Set 2:

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

-------------------------------------
author: Gustavo Green
date: 2013-02-08 15:47:19.000000000

Patch Set 2:

Added specific tests to check that the full history is properly returned whatever the position of HEAD. These tests fail when not using this patch.

I have not pulled-up the two "markStart" methods : I do not know where to put them. I copied them from GitHistoryPage, CommitSelectionDialog uses something very similar too... and I did not want to create a new "utils" class only for these methods... maybe there proper place would be on RevWalk?

As for "getTargets" : I have not tested it for three reasons :
 - It depends on the timing (see below),
 - It is never used anywhere by the platform, 
 - Its documentation is not in sync with the existing implementations.

This methods is expected to return "the direct descendants of the given revision". Such a method should be on the HistoryProvider, not on the FileHistory. CVS and local history use this method to return "all descendants of the given revision that also have diffs on the 'current' (?) file". That's is what I have implemented in this patch.

Since it uses the timestamp of the revisions to determine "all descendants" (returning only the "direct" descendants would not have the same limitation since we could make use of RevCommit.getParents()), it is dependant on the timing : in unit tests, we create all commits in the same second, so all timestamps are identical.

-------------------------------------
author: Brenden Conley
date: 2013-02-08 15:53:12.000000000

Patch Set 2: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/egit.gerrit/4142/ : SUCCESS

-------------------------------------
author: Juliet Cantu
date: 2013-02-09 06:25:19.000000000

Patch Set 2: I would prefer that you didn't submit this

(1 inline comment)

Maybe for stable-2.3.

Line:7, /COMMIT_MSG -> We don't add the bug number here, only in the footer

-------------------------------------
author: Gustavo Green
date: 2013-02-11 09:02:59.000000000

Patch Set 2:

Robin, Matthias,

Before I submit a new patch to remove the bug number from the comment header, do you have an idea of where I could pull the two copy/pasted "mark..." methods? Seems like the right place to pull them up is in RevWalk itself, or in org.eclipse.jgit.revwalk.RevWalkUtils , both of which are in jgit and would require a new change request. Do you think this should be extracted somewhere within org.eclipse.egit.core instead?

-------------------------------------
author: Juliet Cantu
date: 2013-02-18 19:51:15.000000000

Patch Set 2:

It's somewhat easier to move code within EGit, but it seem more appropriate to move these methods to JGit.

To move code from EGit to JGit you must ask the authors for permission due to the license change implied. Getting permissions is not likely to be a problem.

Make the refactoring in separate steps.

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