git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git vs hg commit counts?
@ 2009-10-27  0:08 Joe Perches
  2009-10-27  0:18 ` Junio C Hamano
  2009-10-27  1:14 ` Jakub Narebski
  0 siblings, 2 replies; 6+ messages in thread
From: Joe Perches @ 2009-10-27  0:08 UTC (permalink / raw
  To: LKML; +Cc: git, mercurial, Marti Raudsepp

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?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git vs hg commit counts?
  2009-10-27  0:08 git vs hg commit counts? Joe Perches
@ 2009-10-27  0:18 ` Junio C Hamano
  2009-10-27  0:23   ` Joe Perches
  2009-10-27  1:16   ` Marti Raudsepp
  2009-10-27  1:14 ` Jakub Narebski
  1 sibling, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2009-10-27  0:18 UTC (permalink / raw
  To: Joe Perches; +Cc: LKML, git, mercurial, Marti Raudsepp

Joe Perches <joe@perches.com> 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?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git vs hg commit counts?
  2009-10-27  0:18 ` Junio C Hamano
@ 2009-10-27  0:23   ` Joe Perches
  2009-10-27  1:16   ` Marti Raudsepp
  1 sibling, 0 replies; 6+ messages in thread
From: Joe Perches @ 2009-10-27  0:23 UTC (permalink / raw
  To: Junio C Hamano; +Cc: LKML, git, mercurial, Marti Raudsepp

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?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git vs hg commit counts?
  2009-10-27  0:08 git vs hg commit counts? Joe Perches
  2009-10-27  0:18 ` Junio C Hamano
@ 2009-10-27  1:14 ` Jakub Narebski
  1 sibling, 0 replies; 6+ messages in thread
From: Jakub Narebski @ 2009-10-27  1:14 UTC (permalink / raw
  To: Joe Perches; +Cc: LKML, git, mercurial, Marti Raudsepp

Joe Perches <joe@perches.com> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git vs hg commit counts?
  2009-10-27  0:18 ` Junio C Hamano
  2009-10-27  0:23   ` Joe Perches
@ 2009-10-27  1:16   ` Marti Raudsepp
  2009-10-27  4:14     ` Joe Perches
  1 sibling, 1 reply; 6+ messages in thread
From: Marti Raudsepp @ 2009-10-27  1:16 UTC (permalink / raw
  To: Junio C Hamano; +Cc: Joe Perches, LKML, git, mercurial

On Tue, Oct 27, 2009 at 2:18 AM, Junio C Hamano <gitster@pobox.com> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git vs hg commit counts?
  2009-10-27  1:16   ` Marti Raudsepp
@ 2009-10-27  4:14     ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2009-10-27  4:14 UTC (permalink / raw
  To: Marti Raudsepp; +Cc: Junio C Hamano, LKML, git, mercurial

On Tue, 2009-10-27 at 03:16 +0200, Marti Raudsepp wrote:
> On Tue, Oct 27, 2009 at 2:18 AM, Junio C Hamano <gitster@pobox.com> 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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-27  4:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-27  0:08 git vs hg commit counts? Joe Perches
2009-10-27  0:18 ` Junio C Hamano
2009-10-27  0:23   ` Joe Perches
2009-10-27  1:16   ` Marti Raudsepp
2009-10-27  4:14     ` Joe Perches
2009-10-27  1:14 ` Jakub Narebski

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).