Re: Something like $Id$, $Revision$ or $Date$?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dnia poniedziałek 10. listopada 2008 18:38, Michal Nazarewicz napisał:
> Jakub Narebski <jnareb@xxxxxxxxx> writes:
> 
> > The reason why git doesn't support keywords like $Revision$ or $Date$
> > is performance: the $Revision$ and $Date$ are keywords related to
> > _commit_ data, not blob data. 
> 
> In my case identifying content not commit would be even better.

Well, in that case using `ident` attribute would be enough
(but cryptic).

 # set `ident` attribute for all files
 $ echo '* ident' > .gitattributes

 # check that it is set for file 'foo'
 $ git check-attr ident -- foo
 foo: ident: set

 # edit file to contain '$Id$' keyword
 $ cat foo
 ...
 ... $Id$ ...
 ...

 # make a commit
 $ git commit -a

 # $Id$ keyword is replaced on checkout
 $ git add foo
 $ git checkout foo

 # and check that it got replaced
 $ cat foo
 ...
 ... $Id: 0ca1524d4460ba6bc91bf3adc9dab13212599243 $ ...
 ...

But you need git to make use of this SHA-1 _blob_ (contents) identifier

-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux