I'm comparing linux-kernel git vs hg repositories.
While testing some changes to scripts/get_maintainer.pl,
I noticed that git and hg have different commit counts
for the same files.
For instance:
$ git log --since=1-year-ago -- MAINTAINERS | \
grep -P "^commit [0-9a-f]{40,40}$" | wc -l
514
$ hg log --template="commit {node}\n" --date -365 -- MAINTAINERS | \
grep -P "^commit [0-9a-f]{40,40}$" | wc -l
601
Anyone have any understanding why?
Joe Perches <[email protected]> writes:
> I'm comparing linux-kernel git vs hg repositories.
>
> While testing some changes to scripts/get_maintainer.pl,
> I noticed that git and hg have different commit counts
> for the same files.
>
> For instance:
>
> $ git log --since=1-year-ago -- MAINTAINERS | \
> grep -P "^commit [0-9a-f]{40,40}$" | wc -l
> 514
>
> $ hg log --template="commit {node}\n" --date -365 -- MAINTAINERS | \
> grep -P "^commit [0-9a-f]{40,40}$" | wc -l
> 601
>
> Anyone have any understanding why?
We simplify a merge history by discarding one branch when the merge result
matches one of the parents. Does "hg" know how to do that as well?
On Mon, 2009-10-26 at 17:18 -0700, Junio C Hamano wrote:
> > $ git log --since=1-year-ago -- MAINTAINERS | \
> > grep -P "^commit [0-9a-f]{40,40}$" | wc -l
> > 514
> > $ hg log --template="commit {node}\n" --date -365 -- MAINTAINERS | \
> > grep -P "^commit [0-9a-f]{40,40}$" | wc -l
> > 601
> > Anyone have any understanding why?
> We simplify a merge history by discarding one branch when the merge result
> matches one of the parents.
Thanks Junio.
> Does "hg" know how to do that as well?
I don't know.
I was hoping to get equivalent results though.
Anyone know how?
Joe Perches <[email protected]> writes:
> I'm comparing linux-kernel git vs hg repositories.
>
> While testing some changes to scripts/get_maintainer.pl,
> I noticed that git and hg have different commit counts
> for the same files.
>
> For instance:
>
> $ git log --since=1-year-ago -- MAINTAINERS | \
> grep -P "^commit [0-9a-f]{40,40}$" | wc -l
> 514
>
> $ hg log --template="commit {node}\n" --date -365 -- MAINTAINERS | \
> grep -P "^commit [0-9a-f]{40,40}$" | wc -l
> 601
>
> Anyone have any understanding why?
It *might* be caused by the fact that in Mercurial commit can have
only up to two parents. This means that octopus merges (merge commits
with more than two parents: there are a few of them in linux-kernel
history) have to be represented as a set of two-parent merges.
--
Jakub Narebski
http://stackoverflow.com/questions/1598759/git-and-mercurial-compare-and-contrast/1599930#1599930
On Tue, Oct 27, 2009 at 2:18 AM, Junio C Hamano <[email protected]> wrote:
> We simplify a merge history by discarding one branch when the merge result
> matches one of the parents. Does "hg" know how to do that as well?
57 of the differing changesets are normal merges (probably what Junio explained)
3 are duplicate changesets in hg, probably also related to that
27 changesets are octopus merge fixups
wrt octopus merges: in git, one merge commit can have an arbitrary
number of parents, but in hg a merge changeset always has 2 parents --
so a octopus merge is represented as multiple distinct changesets.
Marti
On Tue, 2009-10-27 at 03:16 +0200, Marti Raudsepp wrote:
> On Tue, Oct 27, 2009 at 2:18 AM, Junio C Hamano <[email protected]> wrote:
> > We simplify a merge history by discarding one branch when the merge result
> > matches one of the parents. Does "hg" know how to do that as well?
>
> 57 of the differing changesets are normal merges (probably what Junio explained)
> 3 are duplicate changesets in hg, probably also related to that
> 27 changesets are octopus merge fixups
>
> wrt octopus merges: in git, one merge commit can have an arbitrary
> number of parents, but in hg a merge changeset always has 2 parents --
> so a octopus merge is represented as multiple distinct changesets.
Thanks.
For hg support in get_maintainers, it's probably
simplest to ignore the delta in number of commits
as "close enough".