From: Michal Nazarewicz <mina86@tlen.pl>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Something like $Id$, $Revision$ or $Date$?
Date: Mon, 10 Nov 2008 18:38:12 +0100 [thread overview]
Message-ID: <8763mvlbwb.fsf@erwin.mina86.com> (raw)
In-Reply-To: m3iqqvefmo.fsf@localhost.localdomain
[-- Attachment #1: Type: text/plain, Size: 2015 bytes --]
Jakub Narebski <jnareb@gmail.com> writes:
> The reason why git doesn't support keywords like $Revision$ or $Date$
> is performance: the $Revision$ and $Date$ are keywords related to
> _commit_ data, not blob data.
In my case identifying content not commit would be even better.
> 1. You can try to use either hooks (post-commit, post-update I think)
> or smudge / clean filters (via gitattributes) to do keyword
> expansion. This hits performance, and you probably would have the
> problems CVS ad with keyword expansion.
Earlier in the thread there was following code for a pre-commit hook
mentioned:
#v+
files=$(git diff-index --name-only --diff-filter=AM HEAD)
perl -pi -e 's/\$Id.*?\$/\$Id: '$(TZ=UTC date +%s)' \$/g' $files
git add $files
#v-
Now, this meats all my needs except that (i) it adds all the files that
were modified (ie. makes `git commit` work like `git commit -a`) and
(ii) it modifies files even if the commit was aborted.
So, it seems that, what I need is: (i) a pre-commit-post-message-hook
and (ii) a way to get a list of files that are being committed.
> 2. You can use `export-subst` gitattribute and make git-archive do
> keyword expansion, which can include things like '$Format:%aD$'
> for commit date (equivalent of $Date:$?).
>
> 3. You can run some local equivalent of GIT-VERSION-GEN script git
> and Linux kernel uses, and make your build system (Makefile)
> replace '@@VERSION@@' or '++VERSION++' keywords / placeholders
> as part of compiling process.
That would work but the thing is I'd like to have visioning without the
need of creating releases or doing some other voodoo magic -- simply `scp
file remote:file` or attach to an email.
--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--
[-- Attachment #2: Type: application/pgp-signature, Size: 196 bytes --]
next prev parent reply other threads:[~2008-11-10 17:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-10 0:22 Something like $Id$, $Revision$ or $Date$? Michal Nazarewicz
2008-11-10 0:43 ` Sverre Rabbelier
2008-11-10 1:16 ` Michal Nazarewicz
2008-11-10 3:43 ` dhruva
2008-11-10 9:49 ` Michal Nazarewicz
2008-11-10 7:26 ` Johannes Sixt
2008-11-10 12:25 ` Johannes Schindelin
2008-11-10 14:05 ` dhruva
2008-11-10 15:48 ` Michal Nazarewicz
2008-11-10 15:58 ` Francis Galiegue
2008-11-10 15:59 ` Jakub Narebski
2008-11-10 17:38 ` Michal Nazarewicz [this message]
2008-11-10 18:03 ` Jakub Narebski
2008-11-10 20:00 ` Michal Nazarewicz
2008-11-10 20:17 ` Jakub Narebski
2008-11-10 20:24 ` Francis Galiegue
2008-11-10 20:32 ` Jakub Narebski
2008-11-10 20:58 ` Brian Gernhardt
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=8763mvlbwb.fsf@erwin.mina86.com \
--to=mina86@tlen.pl \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
/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