git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CVS-$Id:$ replacement in git?
@ 2007-08-31 15:03 Andreas Hildebrandt
  2007-08-31 16:33 ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Hildebrandt @ 2007-08-31 15:03 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CVS-$Id:$ replacement in git?
  2007-08-31 15:03 CVS-$Id:$ replacement in git? Andreas Hildebrandt
@ 2007-08-31 16:33 ` Johannes Schindelin
  2007-08-31 16:37   ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2007-08-31 16:33 UTC (permalink / raw)
  To: Andreas Hildebrandt; +Cc: git

Hi,

On Fri, 31 Aug 2007, Andreas Hildebrandt wrote:

> 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.

Please see Documentation/gitattributes.txt, look for 'ident'.

Hth,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CVS-$Id:$ replacement in git?
  2007-08-31 16:33 ` Johannes Schindelin
@ 2007-08-31 16:37   ` Junio C Hamano
  2007-08-31 16:58     ` Rogan Dawes
  2007-08-31 17:12     ` Johannes Schindelin
  0 siblings, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2007-08-31 16:37 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Andreas Hildebrandt, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Fri, 31 Aug 2007, Andreas Hildebrandt wrote:
>
>> 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.
>
> Please see Documentation/gitattributes.txt, look for 'ident'.

Please do _not_ see that.  ident is about blob object name and
does not have anything to do with the commit, pathname,
committer, nor date, and this is deliberately so.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CVS-$Id:$ replacement in git?
  2007-08-31 16:37   ` Junio C Hamano
@ 2007-08-31 16:58     ` Rogan Dawes
  2007-08-31 17:12     ` Johannes Schindelin
  1 sibling, 0 replies; 6+ messages in thread
From: Rogan Dawes @ 2007-08-31 16:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, Andreas Hildebrandt, git

Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
>> On Fri, 31 Aug 2007, Andreas Hildebrandt wrote:
>>
>>> 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.
>> Please see Documentation/gitattributes.txt, look for 'ident'.
> 
> Please do _not_ see that.  ident is about blob object name and
> does not have anything to do with the commit, pathname,
> committer, nor date, and this is deliberately so.
> 

For more details see this thread:

<http://thread.gmane.org/gmane.comp.version-control.git/44750>

Rogan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CVS-$Id:$ replacement in git?
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2007-08-31 17:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Andreas Hildebrandt, git

Hi,

On Fri, 31 Aug 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Fri, 31 Aug 2007, Andreas Hildebrandt wrote:
> >
> >> 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.
> >
> > Please see Documentation/gitattributes.txt, look for 'ident'.
> 
> Please do _not_ see that.  ident is about blob object name and
> does not have anything to do with the commit, pathname,
> committer, nor date, and this is deliberately so.

But this is what I was suggesting...  To change the ways for the better.  
I admit that I was really sneaky about it.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CVS-$Id:$ replacement in git?
  2007-08-31 17:12     ` Johannes Schindelin
@ 2007-08-31 18:45       ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2007-08-31 18:45 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Andreas Hildebrandt, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Fri, 31 Aug 2007, Junio C Hamano wrote:
> ...
>> Please do _not_ see that.  ident is about blob object name and
>> does not have anything to do with the commit, pathname,
>> committer, nor date, and this is deliberately so.
>
> But this is what I was suggesting...  To change the ways for the better.  

The thing is that it is not "for the better".  See earlier
discussion and please do not beat the dead horse.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-31 18:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-31 15:03 CVS-$Id:$ replacement in git? Andreas Hildebrandt
2007-08-31 16:33 ` 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

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).