DESCRIPTION

Update equals() and hashCode() in GitModelCommit

Bug: 323201
Change-Id: I3ca7cc79ea47f9a735d7be57d99a4776dc1d4489
Signed-off-by: Leslie Stephenson xxx@xxx.xxx


COMMENTS

author: Leslie Stephenson
date: 2010-08-20 20:32:25.000000000

Uploaded patch set 4.

-------------------------------------
author: Malia Sampson
date: 2010-08-20 22:52:25.000000000

Patch Set 4: Looks good to me, approved; IP review completed

Worked for me while testing.

Dariusz, ideally it would be nice to write tests for this logic too.

-------------------------------------
author: Malia Sampson
date: 2010-08-20 22:52:26.000000000

Change has been successfully merged into the git repository.

-------------------------------------
author: Juliet Cantu
date: 2010-08-20 23:00:42.000000000

Patch Set 4: (2 inline comments)

A couple of thoughts...

Line:179, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCommit.java -> Technically we could have different merge bases, since the common ancestor cannot always be determined unambigiously in the case of so called criss-cross merges. Typically we would probably use the same algorithm in both cases though. but considereing all exotic use cases Git users come up with...

We could perhaps declare that different bases are impoossible here. I'm not familiar enough with the synchronization model.

Shawn?

BTW, Isn't the term base and common ancestor supposed to be synonyms? I.e. we determine the merge base by trying to find a common ancessor from the local and remote commits. I.e. "base" here could probably be better described as local (or our when remote is called their).

Line:194, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCommit.java -> commit hashcodes are pretty well distributed so you could just xor them if you want something faster.

-------------------------------------
author: Leslie Stephenson
date: 2010-08-20 23:48:52.000000000

Patch Set 4: (2 inline comments)



Line:179, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCommit.java -> We already had short discussion about common ancestors on jgit-dev list and according to this[1] Shawn's answer getting fist common ancestor is the best solution.

In case of naming strategy for variants. Team framework used to use 'local', 'base', and 'remote' names for variants where 'local' determinate locally stored file version. In case of git the 'local' in some cases can be version from branch that isn't current HEAD, even more we could exclude locally made changes from synchronization result. Therefore I've decided to use 'ancestor', 'base' and 'remote' names.

1. http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg00435.html

Line:194, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCommit.java -> Good hint! Thank you! ;)

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