{"thread":{"id":"21367","subject":"git vs hg commit counts?","startedAt":"2009-10-27T00:08:47Z","lastAt":"2009-10-27T04:14:29Z","messageCount":6,"participants":["Joe Perches","Junio C Hamano","Jakub Narebski","Marti Raudsepp"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125968","messageId":"1256602127.29938.8.camel@Joe-Laptop.home","threadId":"21367","inReplyTo":null,"subject":"git vs hg commit counts?","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2009-10-27T00:08:47Z","receivedAt":"2009-10-27T00:08:47Z","isPatch":false,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"I'm comparing linux-kernel git vs hg repositories.\n\nWhile testing some changes to scripts/get_maintainer.pl,\nI noticed that git and hg have different commit counts\nfor the same files.\n\nFor instance:\n\n$ git log --since=1-year-ago -- MAINTAINERS | \\\n\tgrep -P \"^commit [0-9a-f]{40,40}$\"  | wc -l\n514\n\n$ hg log --template=\"commit {node}\\n\" --date -365 -- MAINTAINERS  | \\\n\tgrep -P \"^commit [0-9a-f]{40,40}$\" | wc -l\n601\n\nAnyone have any understanding why?\n"},{"id":"125969","messageId":"7v8wexd6zq.fsf@alter.siamese.dyndns.org","threadId":"21367","inReplyTo":"1256602127.29938.8.camel@Joe-Laptop.home","subject":"Re: git vs hg commit counts?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-10-27T00:18:33Z","receivedAt":"2009-10-27T00:18:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joe Perches <joe@perches.com> writes:\n\n> I'm comparing linux-kernel git vs hg repositories.\n>\n> While testing some changes to scripts/get_maintainer.pl,\n> I noticed that git and hg have different commit counts\n> for the same files.\n>\n> For instance:\n>\n> $ git log --since=1-year-ago -- MAINTAINERS | \\\n> \tgrep -P \"^commit [0-9a-f]{40,40}$\"  | wc -l\n> 514\n>\n> $ hg log --template=\"commit {node}\\n\" --date -365 -- MAINTAINERS  | \\\n> \tgrep -P \"^commit [0-9a-f]{40,40}$\" | wc -l\n> 601\n>\n> Anyone have any understanding why?\n\nWe simplify a merge history by discarding one branch when the merge result\nmatches one of the parents.  Does \"hg\" know how to do that as well?\n"},{"id":"125971","messageId":"1256602985.29938.18.camel@Joe-Laptop.home","threadId":"21367","inReplyTo":"7v8wexd6zq.fsf@alter.siamese.dyndns.org","subject":"Re: git vs hg commit counts?","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2009-10-27T00:23:05Z","receivedAt":"2009-10-27T00:23:05Z","isPatch":false,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Mon, 2009-10-26 at 17:18 -0700, Junio C Hamano wrote:\n> > $ git log --since=1-year-ago -- MAINTAINERS | \\\n> > \tgrep -P \"^commit [0-9a-f]{40,40}$\"  | wc -l\n> > 514\n> > $ hg log --template=\"commit {node}\\n\" --date -365 -- MAINTAINERS  | \\\n> > \tgrep -P \"^commit [0-9a-f]{40,40}$\" | wc -l\n> > 601\n> > Anyone have any understanding why?\n> We simplify a merge history by discarding one branch when the merge result\n> matches one of the parents.\n\nThanks Junio.\n\n> Does \"hg\" know how to do that as well?\n\nI don't know.\n\nI was hoping to get equivalent results though.\n\nAnyone know how?\n"},{"id":"125978","messageId":"m3zl7dd4g6.fsf@localhost.localdomain","threadId":"21367","inReplyTo":"1256602127.29938.8.camel@Joe-Laptop.home","subject":"Re: git vs hg commit counts?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-10-27T01:14:43Z","receivedAt":"2009-10-27T01:14:43Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Joe Perches <joe@perches.com> writes:\n\n> I'm comparing linux-kernel git vs hg repositories.\n> \n> While testing some changes to scripts/get_maintainer.pl,\n> I noticed that git and hg have different commit counts\n> for the same files.\n> \n> For instance:\n> \n> $ git log --since=1-year-ago -- MAINTAINERS | \\\n> \tgrep -P \"^commit [0-9a-f]{40,40}$\"  | wc -l\n> 514\n> \n> $ hg log --template=\"commit {node}\\n\" --date -365 -- MAINTAINERS  | \\\n> \tgrep -P \"^commit [0-9a-f]{40,40}$\" | wc -l\n> 601\n> \n> Anyone have any understanding why?\n\nIt *might* be caused by the fact that in Mercurial commit can have\nonly up to two parents.  This means that octopus merges (merge commits\nwith more than two parents: there are a few of them in linux-kernel\nhistory) have to be represented as a set of two-parent merges.\n\n-- \nJakub Narebski\n\nhttp://stackoverflow.com/questions/1598759/git-and-mercurial-compare-and-contrast/1599930#1599930\n"},{"id":"125979","messageId":"54b33ccd0910261816x3c49d4ccr60a80a88dd4cfac9@mail.gmail.com","threadId":"21367","inReplyTo":"7v8wexd6zq.fsf@alter.siamese.dyndns.org","subject":"Re: git vs hg commit counts?","fromName":"Marti Raudsepp","fromEmail":"marti@juffo.org","sentAt":"2009-10-27T01:16:31Z","receivedAt":"2009-10-27T01:16:31Z","isPatch":false,"sender":{"key":"marti@juffo.org","avatar":null},"body":"On Tue, Oct 27, 2009 at 2:18 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> We simplify a merge history by discarding one branch when the merge result\n> matches one of the parents.  Does \"hg\" know how to do that as well?\n\n57 of the differing changesets are normal merges (probably what Junio explained)\n3 are duplicate changesets in hg, probably also related to that\n27 changesets are octopus merge fixups\n\nwrt octopus merges: in git, one merge commit can have an arbitrary\nnumber of parents, but in hg a merge changeset always has 2 parents --\nso a octopus merge is represented as multiple distinct changesets.\n\nMarti\n"},{"id":"125988","messageId":"1256616869.29938.30.camel@Joe-Laptop.home","threadId":"21367","inReplyTo":"54b33ccd0910261816x3c49d4ccr60a80a88dd4cfac9@mail.gmail.com","subject":"Re: git vs hg commit counts?","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2009-10-27T04:14:29Z","receivedAt":"2009-10-27T04:14:29Z","isPatch":false,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Tue, 2009-10-27 at 03:16 +0200, Marti Raudsepp wrote:\n> On Tue, Oct 27, 2009 at 2:18 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> > We simplify a merge history by discarding one branch when the merge result\n> > matches one of the parents.  Does \"hg\" know how to do that as well?\n> \n> 57 of the differing changesets are normal merges (probably what Junio explained)\n> 3 are duplicate changesets in hg, probably also related to that\n> 27 changesets are octopus merge fixups\n> \n> wrt octopus merges: in git, one merge commit can have an arbitrary\n> number of parents, but in hg a merge changeset always has 2 parents --\n> so a octopus merge is represented as multiple distinct changesets.\n\nThanks.\n\nFor hg support in get_maintainers, it's probably\nsimplest to ignore the delta in number of commits\nas \"close enough\".\n"}]}