Re: Fwd: Re: git checkout -f branch doesn't remove extra files

From: Petr Baudis <pasky@suse.cz>
Date: 2005-08-13 22:33:11
Dear diary, on Sat, Aug 13, 2005 at 02:10:53PM CEST, I got a letter
where Sergey Vlasov <vsu@altlinux.ru> told me that...
> However, cg-export is buggy - if you use the second argument
> (cg-export DESTFILE TREE_ID), the resulting tar file is different
> from what git-tar-tree produces for the same TREE_ID (unless that
> TREE_ID actually points to a tree - but in practice a commit or even
> tag ID is typically used).
> 
> The problem is in this line:
> 
> id=$(tree-id "$2")
> 
> This converts the passed commit or tag to the underlying tree, which
> is then passed to git-tar-tree.  However, git-tar-tree can follow
> such links itself, and, what's more important, it actually uses some
> information from the passed commit (it writes the commit ID to the
> tar file as an extended header, and sets timestamp of all archive
> members to the time of the commit).  Therefore reducing the ID
> passed to git-tar-tree to a plain tree ID is wrong - if a commit ID
> is available, it should be used.

Aha! Good catch, fixed, thanks.

BTW, I also changed cg-export usage to be more consistent and flexible,
by changing it from

	cg-export DESTFILE [TREE_ID]

to

	cg-export [-r TREE_ID] DESTFILE

since I think not many people are using cg-export anyway and much less
of them passing it TREE_ID explicitly.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Aug 13 22:37:12 2005

This archive was generated by hypermail 2.1.8 : 2005-08-13 22:37:14 EST