From: Jakub Narebski <jnareb@gmail.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: Dan Loewenherz <dloewenherz@gmail.com>,
Andreas Ericsson <ae@op5.se>, takeshin <admirau@gmail.com>,
git@vger.kernel.org
Subject: Re: update @version in file
Date: Thu, 14 May 2009 01:02:14 +0200 [thread overview]
Message-ID: <200905140102.15578.jnareb@gmail.com> (raw)
In-Reply-To: <vpqeiutrl09.fsf@bauges.imag.fr>
On Wed, 13 May 2009, Matthieu Moy napisał:
> Jakub Narebski <jnareb@gmail.com> writes:
>
> > 2. If you wanted however to have *file* version (like in CVS), then it
> > is impossible because Git doesn't store such info
>
> What could make sense is the commit id where the file was last
> modified (i.e. the first item that appears when one runs "git log" on
> the file). Not exactly as simple as it could be because of merge, but
> not completely meaningless either.
First, while it quite neatly solves the problem of cost of commit (only
changed files needs to have keyword expansion updated), it is also much
more costly (possibly much, much more, especially as Andreas wrote for
files which change rarely) than commit info based keywords (like those
`export-subst` keywords). Note that Git doesn't store per-file version
info.
Second, you are mistaken thinking that 'commit id where the file was
last modified' is a file-level variable. It is not, because file could
have arrived independently at given contents (e.g. by cherry-picking
bugfix, or by reverting some change one one branch while other is from
before a change). See for example sample history below
.---.---.---a--.---b---.---c <--- branch_1
\
\--.---d---c' <--- branch_2
where given file is at the same version (has the same contents) in both
"c" and "c'" commits, but for one 'last changed' would be "b", for other
it would be "d".
This means that not only rewinding is costly (as per previous point), but
also switching branches is costly; you have to get history for each and
every file, even if they didn't change in the switch.
Third, files in project are not independent. Last commit the file was
changed doesn't give us much informational value, I don't think. Well,
at least not as keyword expansion; you might want to ask your SCM about
this info. Whole project tags means that you can get to exact version
you stated. "File history" revision numbers would not.
I don't know why you need such keyword. Users either browse files via SCM
(where they have access to SCM to get such info, or browse files from
tarball, where project revision is embedded (substituted by Makefile)...
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2009-05-13 23:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 8:59 update @version in file takeshin
2009-05-13 9:11 ` Andreas Ericsson
2009-05-13 9:22 ` takeshin
2009-05-13 9:42 ` Jakub Narebski
2009-05-13 16:04 ` Dan Loewenherz
2009-05-13 16:56 ` Jakub Narebski
2009-05-13 17:05 ` Matthieu Moy
2009-05-13 17:38 ` Andreas Ericsson
2009-05-13 23:02 ` Jakub Narebski [this message]
2009-05-14 7:08 ` Matthieu Moy
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=200905140102.15578.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=Matthieu.Moy@imag.fr \
--cc=admirau@gmail.com \
--cc=ae@op5.se \
--cc=dloewenherz@gmail.com \
--cc=git@vger.kernel.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).