git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Deciding between Git/Mercurial

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 30, 2009, 11:09 UTC
Message-ID
<200909301309.51283.jnareb@gmail.com>
In-Reply-To
<ee2a733e0909291749s71801b29ufa827cab715d0abb@mail.gmail.com>
On Wed, 30 Sep 2009, Leo Razoumov wrote:
> On 2009-09-29, Jakub Narebski <jnareb@gmail.com> wrote:
>> On Tue, 29 Sep 2009, Leo Razoumov wrote:
>>> On 2009-09-28, Jakub Narebski <jnareb@gmail.com> wrote:
Show 33 quoted lines
>>>> [..snip..]
>>>>  Besides with nonlinear history with
>>>>  revision numbers such as 12678 and 12687 you know that 12678 is older
>>>>  than 12687 if and only if 12678 and 12687 are on the same line of
>>>>  development.
>>>
>>> The statement above is incorrect!! In a Mercurial repo local revision
>>> numbers are strictly ordered in commit time. 12678 < 12687 means that
>>> 12678 was committed prior to 12687. But these two commits could belong
>>> to two completely unrelated lines of development.
>>
>> This is impossible with distributed development.  If the second branch
>>  comes from other repository, with commits _created_ (in that repository)
>>  earlier than commits in current repository, but commits in first
>>  branch (from current repository) were created earlier than _fetching_
>>  those commits in second branch:
>>
>>   .---.---.---.---x---1---2---3---M---.
>>                    \             /
>>                     \-A---B---C-/             <-- from repository B
>>
>>
>>  Either you would have to change commits numbers, and therefore they would
>>  be not stable, or you would have to change commit time to mean 'time this
>>  commit got into current repository', which would kill performance for sure.
> 
> Jakub,
> in Mercurial sequential commit numbers are local to a repo and are not
> unique between the clones. Unique ID is SHA1 as in git. So mercurial
> commit 127:aaf123453dfgdfgddd...
> means commit number 127 in this repo with SHA1 "aaf123453dfgdfgddd..."
> In another clone commit 127 might mean completely different thing.
> Sequential commit numbers are strictly for "local convenience".

Yes, I know that in Mercurial commit numbers are local to repository, and even written about it (that sequential commit numbers are possible only either as local identifiers, or in centralized workflow).

The issue I was writing about that sequential commit numbers cannot tell us if commit was earlier or later than some other commit based solely on those commit numbers. As other people in this thread wrote Mercurial numbers commits not in order of commit creation, but in order of commit arriving (being present) in given repository. So commit numbers are not 'strictly ordered in commit time', but ordered in 'time commit got into current (local) repository'.

I'd like also to note that this means that at some time Mercurial has to number all those commit it got on fetch / pull from remote repository. This can be a lot of work... work which Git doesn't have to do (OTOH Git creates index for packfile on local side after fetch...).

-- 
Jakub Narebski
Poland
Previous: Andreas EricssonNext: Paolo Bonzini
Message 35 of 44 in “Deciding between Git/Mercurial”
  1. AnteruSep 27, 2009
  2. Robin RosenbergSep 27, 2009
  3. AnteruSep 27, 2009
  4. Alex RiesenSep 27, 2009
  5. Mark StrubergSep 27, 2009
  6. AnteruSep 27, 2009
  7. Alex RiesenSep 27, 2009
  8. Erik Faye-LundSep 27, 2009
  9. Pascal ObrySep 27, 2009
  10. Martin LanghoffOct 22, 2009
  11. Felipe ContrerasSep 28, 2009
  12. Matthieu MoySep 28, 2009
  13. Johannes SchindelinSep 28, 2009
  14. Felipe ContrerasSep 28, 2009
  15. Bruce StephensSep 28, 2009
  16. Matthias AndreeSep 30, 2009
  17. Dilip MSep 28, 2009
  18. Damien WyartSep 28, 2009
  19. Steven NoonanSep 28, 2009
  20. Sverre RabbelierSep 28, 2009
  21. Randal L. SchwartzSep 28, 2009
  22. Sverre RabbelierSep 29, 2009
  23. Mike RalphsonSep 29, 2009
  24. Matthieu MoySep 29, 2009
  25. Sverre RabbelierSep 29, 2009
  26. Jakub NarebskiSep 28, 2009
  27. Jakub NarebskiSep 29, 2009
  28. AnteruSep 29, 2009
  29. Leo RazoumovSep 29, 2009
  30. Jakub NarebskiSep 29, 2009
  31. Matthieu MoySep 29, 2009
  32. Leo RazoumovSep 30, 2009
  33. Björn SteinbrinkSep 30, 2009
  34. Andreas EricssonSep 30, 2009
  35. Jakub NarebskiSep 30, 2009
  36. Paolo BonziniSep 29, 2009
  37. Daniele SegatoSep 29, 2009
  38. Dilip MSep 29, 2009
  39. Matthias AndreeSep 30, 2009
  40. Daniel BarkalowSep 30, 2009
  41. Dilip MOct 22, 2009
  42. AnteruOct 22, 2009
  43. Dilip MOct 22, 2009
  44. AnteruOct 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.