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.

The SINGLE_LINE_OF_DESCENT flag remains to be handled.

Bug: 398982
Change-Id: Id596d4501cdca815e9563a1f7f4a1d58bc3920c9


COMMENTS

author: Brenden Conley
date: 2013-02-04 13:05:49.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2013-02-04 13:20:44.000000000

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

Build Unstable 

https://hudson.eclipse.org/sandbox/job/egit.gerrit/4131/ : UNSTABLE

-------------------------------------
author: Douglas Trujillo
date: 2013-02-07 22:46:39.000000000

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

(2 inline comments)

- any hint how to test this ?
- this needs unit tests. Have a look at GitTestCase and its subclasses for examples how to create repositories during unit tests

Line:152, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java -> these methods shouldn't be copied but moved down from egit.ui down to egit.core, I'd recommend to then move all related methods

Line:196, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java -> are you sure this is correct ? CommitFileRevision.getTimestamp() returns author time which isn't necessarily matching topological order of the history graph

-------------------------------------
author: Gustavo Green
date: 2013-02-08 08:35:51.000000000

Patch Set 1: (2 inline comments)

This can be fairly easily unit tested by querying the file history and checking that all revisions are available. What I was missing was a test fixture with which to create sample repositories with the necessary setup (multiple branches and commits).

I'll take a look at GitTestCase and see if I can manage to put tests together for this feature.

Line:152, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java -> These two were copy/pasted from GitHistoryPage (see comment on related bug 398982 ) since I did not really know where to factorize them. Is there already an utility that would be a good place for that?

Line:196, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java -> I was pretty sure since that gave me the correct answer for my tests. I had no idea that this wasn't the "commit" time :s. This code is exactly the same as what is used by CVS ( http://git.eclipse.org/c/platform/eclipse.platform.team.git/tree/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java#n255 ). How exactly could I get all descendants of a given commit if not using the timestamp?

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