git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: lists@haller-berlin.de (Stefan Haller)
To: git@vger.kernel.org
Subject: git-update-index loses executable bit for unmerged files when core.filemode is false
Date: Fri, 22 Oct 2010 19:28:47 +0200	[thread overview]
Message-ID: <1jqpu2f.1qxnixxtdqhreM%lists@haller-berlin.de> (raw)

There's a bug with the handling of the executable bit when core.filemode
is false: when you have an executable file that has unmerged changes,
and you stage it with "git update-index", the executable bit is lost.
If you stage it with "git add" instead, it works fine.

    git init test
    cd test
    git config core.filemode false
    touch foo
    git add foo
    git update-index --chmod=+x foo
    git commit -m "Initial revision"
    git branch br
    echo bla >foo
    git commit -a -m "Changed foo"
    git checkout br
    echo blubb >foo
    git commit -a -m "Changed foo"
    git merge master
    git update-index foo
    git diff --staged

See how the diff shows that the mode goes from 100755 to 100644.  If you
replace the second-to-last line with "git add foo", it doesn't.

I started to trace this down, but I didn't get very far, as I'm not
familiar enough with the git codebase yet; so any help would be
appreciated.


-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/

             reply	other threads:[~2010-10-22 17:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 17:28 Stefan Haller [this message]
2010-10-24 11:40 ` [PATCH] Add tests to demonstrate update-index bug with core.symlinks/core.filemode Stefan Haller
2010-10-24 18:53   ` Stefan Haller
2010-10-25  7:34     ` Junio C Hamano
2010-10-24 23:41   ` Jakub Narebski
2010-10-25  8:59     ` Stefan Haller

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=1jqpu2f.1qxnixxtdqhreM%lists@haller-berlin.de \
    --to=lists@haller-berlin.de \
    --cc=git@vger.kernel.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).