git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Confused about "ident" filter
@ 2008-04-17  7:15 Peter Karlsson
  2008-04-17 14:36 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Karlsson @ 2008-04-17  7:15 UTC (permalink / raw)
  To: Git Mailing List

Hi!

While convincing my employer to convert to Git, I've ran into the old
RCS keyword expansion problem again. They have files that they need to
export to a customer, without revision history, but they need to embed
an identifier that can tell them which version of the file it was.

So, I tried setting up a .gitattributes file:

   * ident

and a simple test perl script that would show me the ident:

   #!/usr/bin/perl
   print 'I am $Id$', "\n";

but I cannot figure out how to get it to actually expand the $Id$. I
tried doing "git checkout test.perl", I tried "git clone" to get a new
copy of the repository, but still it showed only "$Id$".

I found that "git archive" *does* work.

-- 
\\// Peter - http://www.softwolves.pp.se/

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

* Re: Confused about "ident" filter
  2008-04-17  7:15 Confused about "ident" filter Peter Karlsson
@ 2008-04-17 14:36 ` Paolo Bonzini
  2008-04-19  8:27   ` Jakub Narebski
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2008-04-17 14:36 UTC (permalink / raw)
  To: Peter Karlsson; +Cc: Git Mailing List

Peter Karlsson wrote:
> I tried doing "git checkout test.perl", I tried "git clone" to get a new
> copy of the repository, but still it showed only "$Id$".

In fact I'm a little confused too.  The only way I found to expand 
"$Id$" consistently was "rm test.perl; git checkout test.perl", or "rm 
test.perl; git reset --hard HEAD".

I was not so surprised that clone did not expand, though IMHO it is a 
bug -- but I was *very* surprised to see that cloning a bare repository 
did not expand, either.

Paolo

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

* Re: Confused about "ident" filter
  2008-04-17 14:36 ` Paolo Bonzini
@ 2008-04-19  8:27   ` Jakub Narebski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Narebski @ 2008-04-19  8:27 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Karlsson, Git Mailing List

Paolo Bonzini <bonzini@gnu.org> writes:

> Peter Karlsson wrote:
> > I tried doing "git checkout test.perl", I tried "git clone" to get a new
> > copy of the repository, but still it showed only "$Id$".
> 
> In fact I'm a little confused too.  The only way I found to expand
> "$Id$" consistently was "rm test.perl; git checkout test.perl", or "rm
> test.perl; git reset --hard HEAD".

I think that "git checkout -f test.perl" should work, forcing git to
replace existing file.

As to clone problem: it might be chicken and egg problem, with `ident`
filter needing .gitattribites in working directory during checkout
phase (currently there is no way to use gitattributes from a tree in
repository), and checkout writing this file.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

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

end of thread, other threads:[~2008-04-19  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-17  7:15 Confused about "ident" filter Peter Karlsson
2008-04-17 14:36 ` Paolo Bonzini
2008-04-19  8:27   ` Jakub Narebski

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