pre-commit hooks and $Id$ banners?

Matthew D. Fuller fullermd at over-yonder.net
Mon Apr 24 08:15:56 BST 2006


On Sun, Apr 23, 2006 at 12:26:35PM -0500 I heard the voice of
John Arbash Meinel, and lo! it spake thus:
> 
> Can you explain your use case, for why you want that behavior? I
> think we can support it, but it might be best to support what a user
> is trying to do, rather than trying to support their exact steps.

Well, part of the issue here is that there ARE two separate cases; one
where we care about the tree, and one where we only care about the
individual file.

With CVS, you don't get the choice; all you can talk about is the
individual files, and at best you can try and reconstruct a tree from
that.  That's a Bad Thing, and we don't want to recreate that.  OTOH,
we don't want to go the other way, and force you to try and use the
tree info to try and find out about the individual file, either.

The simplest and most obvious case where we care about one file is
something like:
% tail -1 foo.html
    <p>Last modified: $Date$</p>

Other cases can involve files that often get flung around on their
own; they may be VCS'd together with other files, but often I may want
to look at just one file, and know when it's from.  I deal with a
number of cases where people edit the code outside the VCS, and it's
left to me to try and merge the changes in to the latest version.
Too, they may well mix pieces of tree revisions; having the info in
each file is the only way I can be [reasonably] sure to have it and
that it's maybe correct; an external file wouldn't cut it.

Now, if the tree is at revision 123, and the file was last modified at
111, in theory at least it's just as valid for it to give the tree rev
(123) as the file's rev (111), and we may want the capability to do
both, but I LIKE having the filerev in the keyword.  I can tell at a
glance from a CVS $Id$ who last changed it and when it was last
changed.  If all I had was a tree rev, I'd have to go poke through the
log and file the last mod before that tree rev, which would be
difficult to do precisely (or programmatically).


Now, I HAVE done things where I care about the tree revisions too; in
that case, I schlumped `bzr testament` through a quick script to stick
some #define's in a header file.  But I think that's a distinct case;
the two aren't necessarily the same thing.


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.




More information about the bazaar mailing list