From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Peter Karlsson <peter@softwolves.pp.se>
Cc: git@vger.kernel.org
Subject: Re: RCS keyword expansion
Date: Mon, 15 Oct 2007 15:28:51 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0710151520040.25221@racer.site> (raw)
In-Reply-To: <Pine.LNX.4.64.0710151457131.1901@ds9.cixit.se>
Hi,
On Mon, 15 Oct 2007, Peter Karlsson wrote:
> I wrote:
>
> > Finding out which commit last changed that file is slow. That's why
> > it breaks down.
>
> That might be, but it only needs to be done when a file is updated.
Almost.
It also needs to be updated when switching branches. For every file.
Since the commit blamed for the current version could be different for
every file.
> > You are just to used to CVS/SVN to see that there is a much better way
> > in git.
>
> I can see that favouring the argument that having a $Id$ that gives me
> the global state id when the file was last updated is a bad idea. Fair
> enough. Give me a local state tham (which you did, hash id for the file
> contents).
>
> My problem now is the file date. That could possibly be fixed by having
> it updated before I check in the file.
>
>
> So, to summarize, if I've understood the responses here correctly, what
> I really want is:
>
> on commit:
> - replace "$Date$" (or whatever) with the current time.
I think that would be more "on edit".
> - store the contents.
>
> on checkout:
> - update the file.
> - replace "$Id$" (ditto) with a magic identifier for the file state.
> - update git's state so that it doesn't see the "$Id$" expansion
> as a change in the file contents.
>
> Now the question is: Where can I find documentation on how to do this
> (i.e what should I search for--"hooks"?)?
For the $Id$ thing: Documentation/gitattributes.txt. For the $Date$
thing: Documentation/hooks.txt, and Documentation/git-rev-list.txt.
You'll need to roll your own thing there, since Git oldtimers feel that
what you want to do is the wrong thing (see Randal's comment on generating
it as part of the build process).
What you want to do might be frowned upon by many on the list, but it is
certainly doable. See ExampleScripts on the wiki for inspiration.
> And, if this goes into the ".git" directory, can I still have it
> replicated when I clone a repository? I noticed that my ".git/ignore"
> file wasn't replicated and that I had to replace it with a local
> ".gitignore" to get it under version control.
No, there is not way to have it replicated into the .git directory. The
common way would be to either have it installed as templates, so that
every user of yours gets them automatically, or to check them in under
different names, and make every user install them by hand.
The rationale: every cloner is free to choose what hooks she wants to run.
So checking in such hooks is always understood as suggestion what hooks
to install.
Ciao,
Dscho
next prev parent reply other threads:[~2007-10-15 14:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-11 14:47 RCS keyword expansion Peter Karlsson
2007-10-11 15:02 ` Johannes Sixt
2007-10-11 15:09 ` Randal L. Schwartz
2007-10-11 15:59 ` Oliver Kullmann
2007-10-11 18:09 ` Alex Riesen
2007-10-11 20:47 ` Johannes Schindelin
2007-10-11 21:35 ` Sam Vilain
2007-10-12 5:26 ` Peter Karlsson
2007-10-12 10:02 ` Johannes Schindelin
2007-10-12 10:50 ` Peter Karlsson
2007-10-12 11:05 ` Johannes Sixt
2007-10-12 11:21 ` Lars Hjemli
2007-10-12 11:34 ` Johannes Schindelin
2007-10-15 14:03 ` Peter Karlsson
2007-10-15 14:28 ` Johannes Schindelin [this message]
2007-10-12 12:57 ` Jan Hudec
2007-10-12 19:08 ` Salikh Zakirov
2007-10-12 22:42 ` Johannes Schindelin
2007-10-12 23:52 ` Zakirov Salikh
2007-10-11 17:55 ` Peter Karlsson
2007-10-11 19:21 ` Alex Riesen
2007-10-12 5:27 ` Peter Karlsson
2007-10-12 17:05 ` Barry Fishman
2007-10-12 17:44 ` Linus Torvalds
2007-10-12 17:51 ` Florian Weimer
2007-10-11 21:20 ` Sam Vilain
2007-10-11 19:16 ` Lars Hjemli
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.64.0710151520040.25221@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=peter@softwolves.pp.se \
/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).