git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Norbert Preining <preining@logic.at>
Cc: Daniel Barkalow <barkalow@iabervon.org>, git@vger.kernel.org
Subject: Re: Creating something like increasing revision numbers
Date: Wed, 21 Oct 2009 00:47:12 -0700	[thread overview]
Message-ID: <20091021074711.GB67773@gmail.com> (raw)
In-Reply-To: <20091019004447.GC11739@gamma.logic.tuwien.ac.at>

On Mon, Oct 19, 2009 at 02:44:47AM +0200, Norbert Preining wrote:
> Hi all,
> 
> thanks everyone for the nice feedback!
> 
> On So, 18 Okt 2009, Daniel Barkalow wrote:
> > It's possible as long as you don't think of the "version number" as a 
> > property of the commit, but rather a property that some commits get by 
> > virtue of having been at some time the commit that's what would be found 
> > on that particular server at that particular time. Even though the history 
> 
> Right! That is a good point. In fact I don't care about (local) commits,
> but about the pushes to the central server.
> 
> > of the *content* is non-linear, the sequence of values stored in 
> > refs/heads/master on your central server is linear, local, and easy to 
> > enumerate.
> 
> That is exactely what I need.


If you have any control over how people will use git,
then you can give your constantly-incrementing revision number
more stability by ensuring that everyone uses
'git pull --rebase'.

That'll literally keep the history completely linear.
If someone forgets then it's not a big deal; you'll
just get a merge commit and the number will increment
by 2 instead of by 1.

> Now my follow-up questions:
> - how would one access this "sequence" number on the server

If you've done the "tag the initial commit" as suggested
elsewhere on this thread:

	git tag projectname $(git rev-list HEAD | tail -n1)

then you can do this with simply:

	git describe --tags


It should output something like:

	projectname-101-g20912df

> - is there a way to determine at which of this "sequence" numbers a specific
>   file has been changed last?

	commit=$(git log --pretty=%H -1 -- <filename>)
	git describe --tags $commit


> JAIST Japan Advanced Institute of Science and Technology   preining@jaist.ac.jp
> Vienna University of Technology                               preining@logic.at
> Debian Developer (Debian TeX Task Force)                    preining@debian.org


Just another happy Debian user here,

-- 
		David

      parent reply	other threads:[~2009-10-21  7:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-18 14:41 Creating something like increasing revision numbers Norbert Preining
2009-10-18 15:03 ` Johan Herland
2009-10-18 15:20   ` Norbert Preining
2009-10-18 17:23     ` Johan Herland
2009-10-18 18:16       ` alexandrul
2009-10-19  1:15       ` Nicolas Pitre
2009-10-18 22:47     ` Junio C Hamano
2009-10-19  0:48       ` Norbert Preining
2009-10-18 15:29 ` alexandrul
2009-10-18 15:37   ` demerphq
2009-10-18 15:45     ` Norbert Preining
2009-10-18 16:16       ` demerphq
2009-10-18 16:35         ` alexandrul
2009-10-18 15:37 ` Jon Smirl
2009-10-18 21:43 ` Daniel Barkalow
2009-10-19  0:44   ` Norbert Preining
2009-10-19  1:16     ` Daniel Barkalow
2009-10-19  1:33       ` Norbert Preining
2009-10-19  2:41         ` Daniel Barkalow
2009-10-19  1:34     ` Nicolas Pitre
2009-10-19  1:42       ` Norbert Preining
2009-10-19  6:21     ` Johannes Sixt
2009-10-21  7:47     ` David Aguilar [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=20091021074711.GB67773@gmail.com \
    --to=davvid@gmail.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=preining@logic.at \
    /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).