git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Greg KH <greg@kroah.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>,
	Linus Torvalds <torvalds@osdl.org>,
	git@vger.kernel.org
Subject: Re: [PATCH] fix compare symlink against readlink not data
Date: Fri, 06 May 2005 09:26:15 -0700	[thread overview]
Message-ID: <7vy8ascod4.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20050506160359.GB6904@kroah.com> (Greg KH's message of "Fri, 6 May 2005 09:03:59 -0700")

>>>>> "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="!"
            fi

Maybe 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" >$loc

would 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.



  parent reply	other threads:[~2005-05-06 16:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06 13:45 [PATCH] fix compare symlink against readlink not data Kay Sievers
2005-05-06 16:03 ` Greg KH
2005-05-06 16:23   ` Kay Sievers
2005-05-06 16:36     ` Greg KH
2005-05-06 16:59       ` Kay Sievers
2005-05-06 17:11       ` Linus Torvalds
2005-05-06 17:19         ` Greg KH
2005-05-06 16:26   ` Junio C Hamano [this message]
2005-05-06 16:37     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vy8ascod4.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).