{"thread":{"id":"9723","subject":"CVS-$Id:$ replacement in git?","startedAt":"2007-08-31T15:03:31Z","lastAt":"2007-08-31T18:45:02Z","messageCount":6,"participants":["Andreas Hildebrandt","Johannes Schindelin","Junio C Hamano","Rogan Dawes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"52053","messageId":"46D82DC3.2030203@bioinf.uni-sb.de","threadId":"9723","inReplyTo":null,"subject":"CVS-$Id:$ replacement in git?","fromName":"Andreas Hildebrandt","fromEmail":"anhi@bioinf.uni-sb.de","sentAt":"2007-08-31T15:03:31Z","receivedAt":"2007-08-31T15:03:31Z","isPatch":false,"sender":{"key":"anhi@bioinf.uni-sb.de","avatar":null},"body":"Dear all,\n\nwe would very much like to migrate our currently CVS-managed project,\nthe Biochemical ALgorithms Library BALL (http://www.ball-project.org) to\ngit. Apart from the problem that our repository turned out to be\nhorribly broken after 12 years of development -- which made conversion\nto git a somewhat unpleasant experience -- we would now be nearly ready\nto migrate. But unfortunately, we internally rely heavily on the $Id:$ -\nexpansion of CVS, that is the ability to have a line like\n\n$Id:$\n\nin the source file expanded to something like\n\n$Id: HINFile.C,v 1.64 2005/02/09 13:02:41 oliver Exp $\n\nThe information we want to store in the file would be something like the\nSHA1 of the last commit that touched that file, the date when it\nhappened and the person who commited it.\n\nI have been thinking about trying to achieve something like this in git.\nFrom my very limited understanding of the internals of git, I thought it\nshould be possible to have a sed-script at the appropriate hooks that\ninserts the updated information into a file whenever it is affected by a\ncommit.\n\nDo you think that this could work? And if so, would it suffice to add a\npre-commit hook?\n\nI can currently see two main problems of this idea: the first is that I\nwould expect this to do strange things when people work with a cloned or\ncopied repository but forget to install the scripts at the correct\nlocation. This, I would be willing to ignore. The other problem I expect\nare lots of meaningless conflicts upon merging, since for a file that\nhas been touched in two branches, the $Id:$ - lines will necessarily be\ndifferent. Is there a way around this problem? And, more importantly,\ndid I overlook any potentially more serious problems with such an approach?\n\nThanks a lot,\n\n  Andreas Hildebrandt\n"},{"id":"52056","messageId":"Pine.LNX.4.64.0708311732580.28586@racer.site","threadId":"9723","inReplyTo":"46D82DC3.2030203@bioinf.uni-sb.de","subject":"Re: CVS-$Id:$ replacement in git?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-31T16:33:55Z","receivedAt":"2007-08-31T16:33:55Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 31 Aug 2007, Andreas Hildebrandt wrote:\n\n> But unfortunately, we internally rely heavily on the $Id:$ - expansion \n> of CVS, that is the ability to have a line like\n> \n> $Id:$\n> \n> in the source file expanded to something like\n> \n> $Id: HINFile.C,v 1.64 2005/02/09 13:02:41 oliver Exp $\n> \n> The information we want to store in the file would be something like the \n> SHA1 of the last commit that touched that file, the date when it \n> happened and the person who commited it.\n\nPlease see Documentation/gitattributes.txt, look for 'ident'.\n\nHth,\nDscho\n"},{"id":"52057","messageId":"7v8x7r1wyy.fsf@gitster.siamese.dyndns.org","threadId":"9723","inReplyTo":"Pine.LNX.4.64.0708311732580.28586@racer.site","subject":"Re: CVS-$Id:$ replacement in git?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-31T16:37:41Z","receivedAt":"2007-08-31T16:37:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Fri, 31 Aug 2007, Andreas Hildebrandt wrote:\n>\n>> But unfortunately, we internally rely heavily on the $Id:$ - expansion \n>> of CVS, that is the ability to have a line like\n>> \n>> $Id:$\n>> \n>> in the source file expanded to something like\n>> \n>> $Id: HINFile.C,v 1.64 2005/02/09 13:02:41 oliver Exp $\n>> \n>> The information we want to store in the file would be something like the \n>> SHA1 of the last commit that touched that file, the date when it \n>> happened and the person who commited it.\n>\n> Please see Documentation/gitattributes.txt, look for 'ident'.\n\nPlease do _not_ see that.  ident is about blob object name and\ndoes not have anything to do with the commit, pathname,\ncommitter, nor date, and this is deliberately so.\n"},{"id":"52060","messageId":"46D848CA.3060707@dawes.za.net","threadId":"9723","inReplyTo":"7v8x7r1wyy.fsf@gitster.siamese.dyndns.org","subject":"Re: CVS-$Id:$ replacement in git?","fromName":"Rogan Dawes","fromEmail":"discard@dawes.za.net","sentAt":"2007-08-31T16:58:50Z","receivedAt":"2007-08-31T16:58:50Z","isPatch":false,"sender":{"key":"discard@dawes.za.net","avatar":null},"body":"Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n>> On Fri, 31 Aug 2007, Andreas Hildebrandt wrote:\n>>\n>>> But unfortunately, we internally rely heavily on the $Id:$ - expansion \n>>> of CVS, that is the ability to have a line like\n>>>\n>>> $Id:$\n>>>\n>>> in the source file expanded to something like\n>>>\n>>> $Id: HINFile.C,v 1.64 2005/02/09 13:02:41 oliver Exp $\n>>>\n>>> The information we want to store in the file would be something like the \n>>> SHA1 of the last commit that touched that file, the date when it \n>>> happened and the person who commited it.\n>> Please see Documentation/gitattributes.txt, look for 'ident'.\n> \n> Please do _not_ see that.  ident is about blob object name and\n> does not have anything to do with the commit, pathname,\n> committer, nor date, and this is deliberately so.\n> \n\nFor more details see this thread:\n\n<http://thread.gmane.org/gmane.comp.version-control.git/44750>\n\nRogan\n"},{"id":"52062","messageId":"Pine.LNX.4.64.0708311812000.28586@racer.site","threadId":"9723","inReplyTo":"7v8x7r1wyy.fsf@gitster.siamese.dyndns.org","subject":"Re: CVS-$Id:$ replacement in git?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-31T17:12:33Z","receivedAt":"2007-08-31T17:12:33Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 31 Aug 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Fri, 31 Aug 2007, Andreas Hildebrandt wrote:\n> >\n> >> But unfortunately, we internally rely heavily on the $Id:$ - expansion \n> >> of CVS, that is the ability to have a line like\n> >> \n> >> $Id:$\n> >> \n> >> in the source file expanded to something like\n> >> \n> >> $Id: HINFile.C,v 1.64 2005/02/09 13:02:41 oliver Exp $\n> >> \n> >> The information we want to store in the file would be something like the \n> >> SHA1 of the last commit that touched that file, the date when it \n> >> happened and the person who commited it.\n> >\n> > Please see Documentation/gitattributes.txt, look for 'ident'.\n> \n> Please do _not_ see that.  ident is about blob object name and\n> does not have anything to do with the commit, pathname,\n> committer, nor date, and this is deliberately so.\n\nBut this is what I was suggesting...  To change the ways for the better.  \nI admit that I was really sneaky about it.\n\nCiao,\nDscho\n"},{"id":"52064","messageId":"7v4pif1r2p.fsf@gitster.siamese.dyndns.org","threadId":"9723","inReplyTo":"Pine.LNX.4.64.0708311812000.28586@racer.site","subject":"Re: CVS-$Id:$ replacement in git?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-31T18:45:02Z","receivedAt":"2007-08-31T18:45:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Fri, 31 Aug 2007, Junio C Hamano wrote:\n> ...\n>> Please do _not_ see that.  ident is about blob object name and\n>> does not have anything to do with the commit, pathname,\n>> committer, nor date, and this is deliberately so.\n>\n> But this is what I was suggesting...  To change the ways for the better.  \n\nThe thing is that it is not \"for the better\".  See earlier\ndiscussion and please do not beat the dead horse.\n"}]}