Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Johannes Sixt <johannes.sixt@telecom.at>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add core.symlinks to mark filesystems that do not support symbolic links.
Date: Fri, 02 Mar 2007 16:12:01 -0800	[thread overview]
Message-ID: <7vr6s7chim.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vvehjchsp.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Fri, 02 Mar 2007 16:05:58 -0800")

Junio C Hamano <junkio@cox.net> writes:

> This code (I am the guilty one before your change above) always
> confused me.  How about doing something like this instead?
>
>     static inline unsigned int ce_mode_from_stat(struct cache_entry *ce,...
>     {
>         /*
>          * A regular file that appears on the filesystem can have
>          * a "wrong" st_mode information.  A few repository config
>          * variables can tell us to trust the mode recorded in the
>          * index more than what we get from the filesystem.
>          */
>         if (ce && S_ISREG(mode)) {
>             extern int trust_executable_bit, has_symlinks;
>
>             if (!has_symlinks && S_ISLNK(ntohl(ce->ce_mode)))
>                 return ce->ce_mode;

Oops, these three lines

>             if (!trust_executable_bit && S_ISREG(ntohl(ce->ce_mode)))
>                 return ce->ce_mode;
>             return create_ce_mode(0666);

should be:

		if (!trust...) {
                	if (S_ISREG(...))
                        	return ce->ce_mode;
			return create_ce_mode(0666);
		}

Still confused I am ;-(.

  reply	other threads:[~2007-03-03  0:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-02 21:11 [PATCH] Add core.symlinks to mark filesystems that do not support symbolic links Johannes Sixt
2007-03-02 21:35 ` Johannes Schindelin
2007-03-02 22:05   ` Johannes Sixt
2007-03-03  0:05 ` Junio C Hamano
2007-03-03  0:12   ` Junio C Hamano [this message]
2007-03-03 12:20     ` Johannes Sixt
2007-03-03 12:44       ` Junio C Hamano
2007-03-03  0:14   ` Narrow checkouts, was " Johannes Schindelin

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=7vr6s7chim.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=johannes.sixt@telecom.at \
    /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