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

Re: On git 1.6 (novice's opinion)

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 27, 2009, 14:09 UTC
Message-ID
<m3fxgz2h2n.fsf@localhost.localdomain>
In-Reply-To
<49CCE72E.20081.258EE61F@Ulrich.Windl.rkdvmks1.ngate.uni-regensburg.de>
"Ulrich Windl" <ulrich.windl@rz.uni-regensburg.de> writes:
Show 14 quoted lines
> On 27 Mar 2009 at 13:49, Michael J Gruber wrote: 
> > Ulrich Windl venit, vidit, dixit 27.03.2009 08:21:
> 
> [...]
> 
> > Keyword substitution and cvs/svn style version numbers are independent
> > issues. The sha1 describes a commit uniquely, one could use that as a
> > keyword.
> 
> However version numbers and time stamps have the property of being at least 
> partially ordered in respect of "newer/older". That property does not hold for 
> SHA-1 checksums. Just imagine suggesting users to upgrade from Microsoft 
> Word/004765c2a1e9771e886f0dbe87d4f89643cd6f70 to Microsoft 
> Word/00b7e6f51130f234a969c84ee9231a5ff7fc8a82 ;-)

That is why people use output of git-describe and _tag_ their releases, and make embedding version number in released version (tarball / binary) the job of make: see GIT-VERSION-GEN script in git sources, and how it is used in Makefile.

Show 11 quoted lines
> 
> > 
> > Increasing version numbers are meaningless in a true DVCS world. What is
> > your 100th commit may not be someone else's, even if both your master's
> > heads are the same! This is why hg version numbers are a local thing.
> > They are merely a local shortcut for specifying a revision and serve the
> > same purpose as git's "backward" counts like HEAD~3 etc. Neither of them
> > work permanently, not even in a local repo, if you allow rebasing.
> 
> Maybe I didn't fully understand, but having a version number that is larger than 
> any parent's version numbers when doing a merge/commit doesn't look wrong to me.

I'm sorry to dissapoint you, but without central server assigning numbers to commits it wouldn't simply work in distributed version control world. Take for example the following situation: somebody clones your repository, and creates new commit on 'master' (trunk) and it gets version number N. Meanwhile you also independently create new commit on 'master'... and without central authority it would also get version number N. Then you would merge (pull) his/her changes, and you would have two commits with the same number; not something you want.

Not to mention that you can have multiple roots (multiple commits with no parent) in git repository; besides independent branches (like 'man', 'html' or 'todo') it is usually result of absorbing or subtree-merging other projects. In 'master' branch there are 5 roots or more: joined 'git-tools' (mailinfo / mailsplit), absorbed gitweb, and subtree-merged gitk and git-gui. And here you would again have multiple commits with the same number...

The idea of generation numbers was discussed on git mailing list, but rather as mechanism helping in faster topological ordering of commits (--topo-sort)... but it was dropped.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Ulrich WindlNext: Ulrich Windl
Message 28 of 49 in “On git 1.6 (novice's opinion)”
  1. Ulrich WindlMar 27, 2009
  2. H.Merijn BrandMar 27, 2009
  3. Ulrich WindlMar 27, 2009
  4. Etienne Vallette d'OsiaMar 27, 2009
  5. Etienne Vallette d'OsiaMar 27, 2009
  6. Dmitry PotapovMar 27, 2009
  7. Ulrich WindlMar 27, 2009
  8. Matthieu MoyMar 27, 2009
  9. Etienne Vallette d'OsiaMar 27, 2009
  10. Ulrich WindlApr 1, 2009
  11. Matthieu MoyApr 1, 2009
  12. Junio C HamanoMar 28, 2009
  13. Junio C HamanoMar 28, 2009
  14. Dmitry PotapovMar 28, 2009
  15. Russ DillMar 30, 2009
  16. Ulrich WindlApr 1, 2009
  17. Andreas EricssonApr 1, 2009
  18. Ulrich WindlApr 1, 2009
  19. Andreas EricssonApr 1, 2009
  20. Heiko VoigtApr 1, 2009
  21. Dmitry PotapovMar 27, 2009
  22. Ulrich WindlMar 27, 2009
  23. Matthieu MoyMar 27, 2009
  24. Ulrich WindlApr 1, 2009
  25. Matthieu MoyApr 1, 2009
  26. Michael J GruberMar 27, 2009
  27. Ulrich WindlMar 27, 2009
  28. Jakub NarebskiMar 27, 2009
  29. Ulrich WindlApr 1, 2009
  30. Andreas EricssonApr 1, 2009
  31. Matthieu MoyApr 1, 2009
  32. Ulrich WindlApr 1, 2009
  33. Andreas EricssonApr 1, 2009
  34. Jakub NarebskiApr 2, 2009
  35. demerphqMar 28, 2009
  36. Junio C HamanoMar 28, 2009
  37. Ulrich WindlApr 1, 2009
  38. Bryan DonlanMar 29, 2009
  39. Johannes SchindelinMar 29, 2009
  40. Ulrich WindlApr 1, 2009
  41. Ulrich WindlApr 1, 2009
  42. Andreas EricssonMar 30, 2009
  43. Ulrich WindlApr 1, 2009
  44. Andreas EricssonApr 1, 2009
  45. Ulrich WindlApr 1, 2009
  46. Andreas EricssonApr 1, 2009
  47. Ulrich WindlApr 1, 2009
  48. Andreas EricssonApr 1, 2009
  49. Kris ShannonApr 1, 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.