From: Jakub Narebski <jnareb@gmail.com>
To: "Ulrich Windl" <ulrich.windl@rz.uni-regensburg.de>
Cc: Michael J Gruber <git@drmicha.warpmail.net>, git@vger.kernel.org
Subject: Re: On git 1.6 (novice's opinion)
Date: Thu, 2 Apr 2009 03:17:08 +0100 [thread overview]
Message-ID: <200904020417.09993.jnareb@gmail.com> (raw)
In-Reply-To: <49D32CE5.21780.391D18@Ulrich.Windl.rkdvmks1.ngate.uni-regensburg.de>
On Wed, 1 April 2009, Ulrich Windl wrote:
> On 27 Mar 2009 at 7:09, Jakub Narebski wrote:
>> "Ulrich Windl" <ulrich.windl@rz.uni-regensburg.de> writes:
>>> 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.
>
> OK, but imaginge someone sends you some file that originated from some git
> version, maybe with minor modifications. Is there a way to find out from what git
> version that file was derived? IMHO that's where "automatically replaced
> placeholders" (like $id$) make sense.
Is it theoretical exercise or some real problem?
First, if the file with modification was taken from _release_ (from
tarball of sources), they can have placeholders like @@VERSION@@ replaced
by actual version (taken from git-describe / GIT-VERSION-GEN) by make
during "make dist" step, or its equivalent. Usually it would be e.g.
v1.6.2.1, as you make distribution of tagged release.
Second, if the files was taken from _repository_ (from version control),
you can get modification send as git diff of changes (which includes
shortened sha-1 of original file contents, and tools such as git-am --3way
can make use of this information to apply patch), or at least in unified
patch format.
Last, you can use `ident` attribute to make git replace the only
"automatic replaced placeholder" (keyword) that makes sense for
distributed VCS, namely $Id$ keyword which get replaced by
$Id: <40-character hexadecimal blob object name>$; you can based
on this iformation find commit or commits that introduced this exact
version of a file.
See gitattributes(5).
>>>> 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.
>
> Anyway the result would have number "N+1". Maybe you misunderstood: I'm not
> proposing to replace git's internal version numbering (SHA-1), but so introduce
> some more comprehensible, primitive user-level numbering.
Errr... what? You would want to renumber _all_ (possibly large amount
of) fetched commits from other repository? It is very costly, and you
are left with commit numbers which are local to repository...
Or perhaps you would want to number only commits in first line parentage
of a branch, i.e. created in repository or fast-forwarded? This is what
Mercurial and (from what I understand) Bazaar does, and it also results
in commit numbers which are local to repository.
Or you were talking about having merge ("result") to have number "N+1".
But then you would have _two_ commits with number "N", and "N" would not
identify commit uniquely, even local for repository. Which means that
it would be useless.
Numbers local to repository cannot be used to pass in communication
to others (e.g. bug was caused by commit 5436); additionally I don't
see how revision number 7654 is any easier to use than HEAD~3, or
f348eae (copy'n'pasted).
>> 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...
>
> Which would not harm, because it would be version N from committer X. Any if
> committer X merges from anything else, the next number would be> N. I did not
> claim that my method makes a total ordering of commits and merges possible.
>
> I truly believe in unique IDs, but they are just not handy in every situation.
You have <branch>~<n>, <branch>@<n>, shortened sha-1, result of git-describe
that can be used in place of full sha-1...
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2009-04-02 2:19 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-27 7:21 On git 1.6 (novice's opinion) Ulrich Windl
2009-03-27 8:05 ` H.Merijn Brand
2009-03-27 9:50 ` Ulrich Windl
2009-03-27 10:57 ` Etienne Vallette d'Osia
2009-03-27 11:30 ` Etienne Vallette d'Osia
2009-03-27 12:24 ` Dmitry Potapov
2009-03-27 13:39 ` Ulrich Windl
2009-03-27 13:45 ` Matthieu Moy
2009-03-27 13:47 ` Etienne Vallette d'Osia
2009-04-01 6:50 ` Ulrich Windl
2009-04-01 7:41 ` Matthieu Moy
2009-03-28 1:30 ` Junio C Hamano
2009-03-28 1:30 ` Junio C Hamano
2009-03-28 9:53 ` Dmitry Potapov
2009-03-30 6:18 ` Russ Dill
2009-04-01 7:53 ` Ulrich Windl
2009-04-01 8:37 ` Andreas Ericsson
2009-04-01 9:47 ` Ulrich Windl
2009-04-01 10:17 ` Andreas Ericsson
2009-04-01 20:37 ` Heiko Voigt
2009-03-27 12:24 ` Dmitry Potapov
2009-03-27 13:35 ` Ulrich Windl
2009-03-27 13:44 ` Matthieu Moy
2009-04-01 6:45 ` Ulrich Windl
2009-04-01 7:42 ` Matthieu Moy
2009-03-27 12:49 ` Michael J Gruber
2009-03-27 13:48 ` Ulrich Windl
2009-03-27 14:09 ` Jakub Narebski
2009-04-01 6:59 ` Ulrich Windl
2009-04-01 7:29 ` Andreas Ericsson
2009-04-01 7:54 ` Matthieu Moy
2009-04-01 9:38 ` Ulrich Windl
2009-04-01 10:10 ` Andreas Ericsson
2009-04-02 2:17 ` Jakub Narebski [this message]
2009-03-28 10:33 ` demerphq
2009-03-28 1:30 ` Junio C Hamano
2009-04-01 7:35 ` Ulrich Windl
2009-03-29 5:41 ` Bryan Donlan
2009-03-29 9:50 ` Johannes Schindelin
2009-04-01 7:42 ` Ulrich Windl
2009-04-01 7:40 ` Ulrich Windl
2009-03-30 9:06 ` Andreas Ericsson
2009-04-01 8:15 ` Ulrich Windl
2009-04-01 8:41 ` Andreas Ericsson
2009-04-01 9:55 ` Ulrich Windl
2009-04-01 10:21 ` Andreas Ericsson
2009-04-01 11:52 ` Ulrich Windl
2009-04-01 12:40 ` Andreas Ericsson
2009-04-01 2:32 ` Kris Shannon
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=200904020417.09993.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=ulrich.windl@rz.uni-regensburg.de \
/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).