On Fri, Oct 12, 2007 at 11:50:51 +0100, Peter Karlsson wrote:
It does not -- the blob ID is the same. And you can indeed get $Id$ expanded
to that (see gitattributes(5)). However, that's the ONLY thing that is the
same. The date of last modification or ID of commit that last touched that
file might not.
Why? Because git tracks content, not history. The trees and blobs (files) a=
re
identified by SHA1 hashes of their content. Only commit objects add the
notion of history. Thus if two commits contain file with the same text, it's
the same file. Even if the file is the same in those commit purely by
accident.
Yes. But you need the (current) commit for that. Now if a file foo is the
same on branches A and B, switching between them will not touch that file,
but git log foo may well give you completely different results. That's why
there's no date or commit that last touched a file.
If you read the (already mentioned) gitattributes(5) manpage, you'll find
description of smudge and clean filters. They will be applied to each file
written out to the tree and read back respectively. But be sure to understa=
nd
why you can't -- for principial, not techical reasons -- have the date or
commit ID expanded correctly in all cases.
--=20
Jan 'Bulb' Hudec <bulb@ucw.cz>