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

Re: Numeric Revision Names?

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 3, 2008, 16:07 UTC
Message-ID
<m3d4ihr7as.fsf@localhost.localdomain>
In-Reply-To
<19796862.post@talk.nabble.com>
marceloribeiro <marcelo@sonnay.com> writes:
Show 9 quoted lines
> I am new to git, and my question may be stupid, but anyway...
> I am used to the numeric revision names on svn, and on Git
> all I get are hexadecimal names.
> 
> Is there any way to configure it to start a projects revisions on
> lets say, revision 0, and keep incrementing it after each commit?
> 
> I tried finding it on git doc but wasnt able to. Maybe I am missing
> something....

First, it is simply not possible to have incremental revision numbers in distributed version control system like Git, at least not without some central authority (assigning revision numbers). Other distributed SCM use simple revision numbers, but either they are local to branch and local to repository (not shared) as in case of Mercurial, or require centralized workflow where one uses different merge than in leaf repositories, as from what I understand is the case with dotted revision numbers in Bazaar-NG.

Second, in my opinion revision numbers are not that useful for projects with large number of commits (where revision number might be something like r4321), and nonlinear history (you don't know how r4555 relates to r4556: they might be on different branches). Also you don't have to use full revision numbers: you can use shortened revision numbers (usually 6-8 characters is enough, e.g. 5f2d4160); if you use tags to mark released versions you can use git-describe output to count revisions from given tag (output contains sha-1 because history migh branch after tag, and number of commits since tag is not enough to determine commit/revision; e.g. v1.6.0-rc3-17-gc14c8ce which means 17 commits after tag v1.6.0-rc3).

Additionally when using git you usually use transient revision numbers, counting commits from tip of branch, for example master~5 means 5 commits in first-parent line from what branch 'master' points to now.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Bruce StephensNext: Stephen Haberman
Message 4 of 11 in “Numeric Revision Names?”
  1. marceloribeiroOct 3, 2008
  2. Robin BurchellOct 3, 2008
  3. Bruce StephensOct 3, 2008
  4. Jakub NarebskiOct 3, 2008
  5. Stephen HabermanOct 3, 2008
  6. Thomas RastOct 3, 2008
  7. Stephen HabermanOct 3, 2008
  8. André Goddard RosaOct 5, 2008
  9. Alex RiesenOct 5, 2008
  10. Jeff KingOct 3, 2008
  11. Jeff KingOct 3, 2008

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.