{"thread":{"id":"13147","subject":"Confused about \"ident\" filter","startedAt":"2008-04-17T07:15:42Z","lastAt":"2008-04-19T08:27:30Z","messageCount":3,"participants":["Peter Karlsson","Paolo Bonzini","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"74619","messageId":"Pine.LNX.4.64.0804170812230.7970@ds9.cixit.se","threadId":"13147","inReplyTo":null,"subject":"Confused about \"ident\" filter","fromName":"Peter Karlsson","fromEmail":"peter@softwolves.pp.se","sentAt":"2008-04-17T07:15:42Z","receivedAt":"2008-04-17T07:15:42Z","isPatch":false,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"Hi!\n\nWhile convincing my employer to convert to Git, I've ran into the old\nRCS keyword expansion problem again. They have files that they need to\nexport to a customer, without revision history, but they need to embed\nan identifier that can tell them which version of the file it was.\n\nSo, I tried setting up a .gitattributes file:\n\n   * ident\n\nand a simple test perl script that would show me the ident:\n\n   #!/usr/bin/perl\n   print 'I am $Id$', \"\\n\";\n\nbut I cannot figure out how to get it to actually expand the $Id$. I\ntried doing \"git checkout test.perl\", I tried \"git clone\" to get a new\ncopy of the repository, but still it showed only \"$Id$\".\n\nI found that \"git archive\" *does* work.\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"74639","messageId":"48076059.4040503@gnu.org","threadId":"13147","inReplyTo":"Pine.LNX.4.64.0804170812230.7970@ds9.cixit.se","subject":"Re: Confused about \"ident\" filter","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2008-04-17T14:36:09Z","receivedAt":"2008-04-17T14:36:09Z","isPatch":false,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"Peter Karlsson wrote:\n> I tried doing \"git checkout test.perl\", I tried \"git clone\" to get a new\n> copy of the repository, but still it showed only \"$Id$\".\n\nIn fact I'm a little confused too.  The only way I found to expand \n\"$Id$\" consistently was \"rm test.perl; git checkout test.perl\", or \"rm \ntest.perl; git reset --hard HEAD\".\n\nI was not so surprised that clone did not expand, though IMHO it is a \nbug -- but I was *very* surprised to see that cloning a bare repository \ndid not expand, either.\n\nPaolo\n"},{"id":"74747","messageId":"m3skxiqmfr.fsf@localhost.localdomain","threadId":"13147","inReplyTo":"48076059.4040503@gnu.org","subject":"Re: Confused about \"ident\" filter","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-04-19T08:27:30Z","receivedAt":"2008-04-19T08:27:30Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Paolo Bonzini <bonzini@gnu.org> writes:\n\n> Peter Karlsson wrote:\n> > I tried doing \"git checkout test.perl\", I tried \"git clone\" to get a new\n> > copy of the repository, but still it showed only \"$Id$\".\n> \n> In fact I'm a little confused too.  The only way I found to expand\n> \"$Id$\" consistently was \"rm test.perl; git checkout test.perl\", or \"rm\n> test.perl; git reset --hard HEAD\".\n\nI think that \"git checkout -f test.perl\" should work, forcing git to\nreplace existing file.\n\nAs to clone problem: it might be chicken and egg problem, with `ident`\nfilter needing .gitattribites in working directory during checkout\nphase (currently there is no way to use gitattributes from a tree in\nrepository), and checkout writing this file.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}