* bug: git merge --no-commit loses track of file modes in the index
@ 2014-06-13 1:38 Joey Hess
2014-06-13 5:52 ` Stefan Haller
2014-06-13 6:26 ` Johannes Sixt
0 siblings, 2 replies; 3+ messages in thread
From: Joey Hess @ 2014-06-13 1:38 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 1925 bytes --]
If git merge --no-commit is used to merge a commit adding a
file with an unusual mode -- specifically a symlink which has "mode" 120000,
it fails to stage the right mode into the index.
This only happens when core.symlinks=false. I noticed it on FAT, but
have managed to reproduce it on ext4.
Here's an example of the bug:
joey@darkstar:~>git clone r1 r2
Cloning into 'r2'...
done.
joey@darkstar:~>cd r1
joey@darkstar:~/r1>ls -l
total 0
lrwxrwxrwx 1 joey joey 11 Jun 12 21:23 foo -> /etc/passwd
joey@darkstar:~/r1>git mv foo bar
joey@darkstar:~/r1>git commit -m moved
[master 516a53c] moved
1 file changed, 0 insertions(+), 0 deletions(-)
rename foo => bar (100%)
joey@darkstar:~/r1>cd ..
joey@darkstar:~>cd r2
joey@darkstar:~/r2>git config core.symlinks false
joey@darkstar:~/r2>git fetch origin
remote: Counting objects: 2, done.
remote: Total 2 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.
From /home/joey/r1
7ab8102..516a53c master -> origin/master
joey@darkstar:~/r2>git merge origin/master --no-commit --no-ff
Automatic merge went well; stopped before committing as requested
joey@darkstar:~/r2>git diff --cached
diff --git a/bar b/bar
new file mode 100644
index 0000000..3594e94
--- /dev/null
+++ b/bar
@@ -0,0 +1 @@
+/etc/passwd
\ No newline at end of file
diff --git a/foo b/foo
deleted file mode 120000
index 3594e94..0000000
--- a/foo
+++ /dev/null
@@ -1 +0,0 @@
-/etc/passwd
\ No newline at end of file
joey@darkstar:~/r2>git commit -m oops
[master 63bd960] oops
joey@darkstar:~/r2>git show
commit 63bd9608c96a91582b27c5853ff58053bab6c71c
Merge: 7ab8102 516a53c
Author: Joey Hess <joey@kitenet.net>
Date: Thu Jun 12 21:37:35 2014 -0400
oops
diff --cc bar
index 0000000,3594e94..3594e94
mode 000000,120000..100644
--- a/bar
+++ b/bar
joey@darkstar:~/r2>git version
git version 2.0.0
--
see shy jo
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: bug: git merge --no-commit loses track of file modes in the index
2014-06-13 1:38 bug: git merge --no-commit loses track of file modes in the index Joey Hess
@ 2014-06-13 5:52 ` Stefan Haller
2014-06-13 6:26 ` Johannes Sixt
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Haller @ 2014-06-13 5:52 UTC (permalink / raw)
To: Joey Hess, git
Joey Hess <joey@kitenet.net> wrote:
> If git merge --no-commit is used to merge a commit adding a
> file with an unusual mode -- specifically a symlink which has "mode" 120000,
> it fails to stage the right mode into the index.
>
> This only happens when core.symlinks=false. I noticed it on FAT, but
> have managed to reproduce it on ext4.
This sounds familiar; I wonder if it is related to the problem that git
can lose the executable bit when core.filemode is false.
<http://thread.gmane.org/gmane.comp.version-control.git/159716>
I had planned to look into fixing this for years now, as we still run
into it once in a while, and it's pretty annoying; but I still didn't
get around to it yet.
--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: bug: git merge --no-commit loses track of file modes in the index
2014-06-13 1:38 bug: git merge --no-commit loses track of file modes in the index Joey Hess
2014-06-13 5:52 ` Stefan Haller
@ 2014-06-13 6:26 ` Johannes Sixt
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2014-06-13 6:26 UTC (permalink / raw)
To: Joey Hess, git
Am 13.06.2014 03:38, schrieb Joey Hess:
> If git merge --no-commit is used to merge a commit adding a
> file with an unusual mode -- specifically a symlink which has "mode" 120000,
> it fails to stage the right mode into the index.
>
> This only happens when core.symlinks=false. I noticed it on FAT, but
> have managed to reproduce it on ext4.
There's a similar breakage with core.filemode=false, which loses the x bit
of files that need a content merge.
-- Hannes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-13 6:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13 1:38 bug: git merge --no-commit loses track of file modes in the index Joey Hess
2014-06-13 5:52 ` Stefan Haller
2014-06-13 6:26 ` Johannes Sixt
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).