From: Andreas Hildebrandt <anhi@bioinf.uni-sb.de>
To: git@vger.kernel.org
Subject: CVS-$Id:$ replacement in git?
Date: Fri, 31 Aug 2007 17:03:31 +0200 [thread overview]
Message-ID: <46D82DC3.2030203@bioinf.uni-sb.de> (raw)
Dear all,
we would very much like to migrate our currently CVS-managed project,
the Biochemical ALgorithms Library BALL (http://www.ball-project.org) to
git. Apart from the problem that our repository turned out to be
horribly broken after 12 years of development -- which made conversion
to git a somewhat unpleasant experience -- we would now be nearly ready
to migrate. But unfortunately, we internally rely heavily on the $Id:$ -
expansion of CVS, that is the ability to have a line like
$Id:$
in the source file expanded to something like
$Id: HINFile.C,v 1.64 2005/02/09 13:02:41 oliver Exp $
The information we want to store in the file would be something like the
SHA1 of the last commit that touched that file, the date when it
happened and the person who commited it.
I have been thinking about trying to achieve something like this in git.
From my very limited understanding of the internals of git, I thought it
should be possible to have a sed-script at the appropriate hooks that
inserts the updated information into a file whenever it is affected by a
commit.
Do you think that this could work? And if so, would it suffice to add a
pre-commit hook?
I can currently see two main problems of this idea: the first is that I
would expect this to do strange things when people work with a cloned or
copied repository but forget to install the scripts at the correct
location. This, I would be willing to ignore. The other problem I expect
are lots of meaningless conflicts upon merging, since for a file that
has been touched in two branches, the $Id:$ - lines will necessarily be
different. Is there a way around this problem? And, more importantly,
did I overlook any potentially more serious problems with such an approach?
Thanks a lot,
Andreas Hildebrandt
next reply other threads:[~2007-08-31 16:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-31 15:03 Andreas Hildebrandt [this message]
2007-08-31 16:33 ` CVS-$Id:$ replacement in git? Johannes Schindelin
2007-08-31 16:37 ` Junio C Hamano
2007-08-31 16:58 ` Rogan Dawes
2007-08-31 17:12 ` Johannes Schindelin
2007-08-31 18:45 ` Junio C Hamano
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=46D82DC3.2030203@bioinf.uni-sb.de \
--to=anhi@bioinf.uni-sb.de \
--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).