Re: [PATCH] fix compare symlink against readlink not data
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 6, 2005, 16:26 UTC
- Message-ID
- <7vy8ascod4.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20050506160359.GB6904@kroah.com>
>>>>> "GKH" == Greg KH <greg@kroah.com> writes:
GKH> On Fri, May 06, 2005 at 03:45:01PM +0200, Kay Sievers wrote:
>> Thanks to Greg for recognizing this while he added our list of symlinks >> back to the udev repository.
GKH> Hm, even with this patch applied (it's in Linus's tree right now), I GKH> still get the following with a clean checked out udev tree: GKH> $ cg-diff GKH> Index: test/sys/block/cciss!c0d0/device GKH> =================================================================== GKH> Index: test/sys/block/rd!c0d0/device GKH> ===================================================================
GKH> Any idea?
I do not use Cogito but probably it is this piece of code in cg-Xdiffdo. It is assuming that a valid SHA1 means it can diff against the filesystem object that resides there. It used to be the case before symlinks but not anymore.
mkbanner () {
loc=$1; treeid=$2; fname=$3; mode=$4; sha1=$5; if [ "$sha1" != "0000000000000000000000000000000000000000" ]; then
git-cat-file blob $sha1 >$loc
else
ln -s "$(pwd)/$fname" "$loc"
sha1="!"
fiMaybe changing the if to (I'm writing this in e-mail editor so completely untested) something like:
if expr "$sha1" : '0*$' >/dev/null ||
expr "$mode" : '.*120000$' >/dev/null
then
git-cat-file blob "$sha1" >$locwould help?
Also could you try the low-level git command, git-diff-cache -p, against the tree you are comparing? The built-in diff stuff might get this wrong too.