git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Dice <dicej@mailsnare.net>
To: Shawn Pearce <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: Subversion-style incrementing revision numbers
Date: Tue, 19 Sep 2006 16:40:40 -0600 (MDT)	[thread overview]
Message-ID: <Pine.LNX.4.62.0609191630360.9752@joeldicepc.ecovate.com> (raw)
In-Reply-To: <20060919220936.GA11601@spearce.org>

On Tue, 19 Sep 2006, Shawn Pearce wrote:

> Joel Dice <dicej@mailsnare.net> wrote:
>> I'm considering adopting Git for a medium-sized project which is currently
>> managed using Subversion.  I've used Git for a few smaller projects
>> already, and the thing I've missed most from Subversion is the convenience
>> of incrementing revision numbers.  The following is a proposal to add this
>> feature to Git.
>
> I can't say I miss that particular feature.  Abbrevations of
> SHA1 IDs tend to work very well for the projects I use Git on;
> 6-8 characters is easily more than enough to uniquely identify
> a revision.  Heck half the time even 4 hex characters is enough.
>
>> Rationale:
>>
>> Incrementing revision numbers (IRNs - an acronym I just made up) are
>> useful in that they can be treated as auto-generated tags which are easier
>> to remember and communicate than SHA hashes, yet do not require extra
>> effort to create like real tags.  Also, they have the advantage of being
>> chronologically ordered, so if I assert that a bug was fixed in revision
>> 42 of a shared repository, everyone may assume that revision 45 has that
>> fix as well.
>
> But with respect to what branch?
>
> Branches in a Git repository are very common:
>
>    o------o-o-o-o-o-o---  B1
>   /
>  -o--o--o-----o--------o  B2
>
> Assuming the branch point on the left was r60, what is the latest
> commit on B1?  On B2?  What about if I merge B1 and B2 together?

Branches in Subversion are also very common.  The "last changed" IRN for a 
branch is the index of the head of the branch in the history.

> Or are you proposing that the commits are ordered by the time that
> they arrive into the repository?

Yes.

> But even if that's the case lets say I fix the bug on B1 in r42
> but a commit on B2 gets assigned r45.  The bug isn't fixed in r45;
> not unless B1 was merged into B2 in r43, r44 or r45. But there's
> no way to know that from just an IRN.
>
> I fail to see how IRNs simplify commit naming or determining where
> a feature or bug fix is within the branching structure.

I'm not suggesting that an IRN stand on it's own in this way.  Additional 
context may be necessary depending on the situation.  It's intended as a 
convenience, not a replacement for the SHA IDs.

>> A simple, efficient implementation of this feature would be based on a
>> single file, $GIT_DIR/history, which would contain a newline-delimited
>> list of SHA commit IDs in chronological order, oldest first.  The current
>> repository IRN would be calculated as the size of that file divided by the
>> SHA+newline length, and the commit ID of any IRN could be determined by
>> seeking to the correct offset in that file.  Every commit would cause a
>> new line to be appended to the history file with that commit's ID.
>> Finally, a history file could be generated for an existing repository by
>> serializing the commit history based on chronological order.
>
> How about just using bare tags under the namespace 'refs/tags/r/'?
> With the new packed refs implemention these would cost you a tiny
> amount of overhead over what you propose (due to the ref name also
> being stored) but its already implemented and does the job just
> as well.

Good idea.  I'll try that.

  - Joel

      reply	other threads:[~2006-09-19 22:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-19 21:07 Subversion-style incrementing revision numbers Joel Dice
2006-09-19 21:18 ` Petr Baudis
2006-09-19 21:42   ` Joel Dice
2006-09-19 22:00     ` Petr Baudis
2006-09-19 22:24       ` Joel Dice
2006-09-19 22:33         ` Shawn Pearce
2006-09-19 22:40         ` Johannes Schindelin
2006-09-19 22:39     ` Shawn Pearce
2006-09-19 21:58   ` Jakub Narebski
2006-09-19 21:51 ` Linus Torvalds
2006-09-19 22:06   ` Petr Baudis
2006-09-19 22:20     ` Linus Torvalds
2006-09-19 23:35       ` Joel Dice
2006-09-20  0:15         ` Jakub Narebski
2006-09-20 16:13           ` Joel Dice
2006-09-20  7:46     ` Junio C Hamano
2006-09-20 17:28     ` Robin Rosenberg
2006-09-20 18:22       ` Petr Baudis
2006-09-20 19:07         ` Junio C Hamano
2006-09-19 22:07 ` Jakub Narebski
2006-09-19 22:11   ` Petr Baudis
2006-09-19 22:17   ` Jakub Narebski
2006-09-19 23:07     ` Joel Dice
2006-09-19 22:18   ` Shawn Pearce
2006-09-19 22:23   ` Shawn Pearce
2006-09-19 22:30   ` Joel Dice
2006-09-19 22:09 ` Shawn Pearce
2006-09-19 22:40   ` Joel Dice [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.62.0609191630360.9752@joeldicepc.ecovate.com \
    --to=dicej@mailsnare.net \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).