git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Strange situation with --assume-unchanged and diff --find-copies-harder
@ 2014-05-11 19:20 Elliott Cable
  2014-05-14 22:13 ` [PATCH] run_diff_files: do not look at uninitialized stat data Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Elliott Cable @ 2014-05-11 19:20 UTC (permalink / raw)
  To: git

So, I've spent some time in the #git channel on Freenode chatting
about this, and we couldn't figure it out. I can't reproduce it in a
newly-made repository, but it's reproducible with the repository I've
been working in.

    > git status
    On branch Master
    Your branch is ahead of 'ec/Master' by 2 commits.
     (use "git push" to publish your local commits)

    nothing to commit, working directory clean
    > g diff --find-copies-harder
    diff --git i/Executables/paws.js w/Executables/paws.js
    old mode 100755
    new mode 100644
    > stat -f '%p' Executables/paws.js
    100755
    >

 - As demonstrated by the `stat`, the mode-change shown by `git diff`
is a phantom change; it never happened.
 - If I remove the `--find-copies-harder` flag, it doesn't show up.
 - If I choose to --no-assume-unchanged the executable, it doesn't show up.
 - If I change the actual file-mode to the 644 it thinks it is, and
commit it, it doesn't show up.

It's only the precise combination of A) a file flagged +x, B) that
file --assume-unchange'd on the index, and C) diff called with the
--find-copies-harder flag, that shows the phantom mode-change.

I tried reproducing that situation in a clean repository, and the
problem didn't seem to surface. You're welcome to clone the repository
in question, however, and reproduce it yourself:

    > git clone https://github.com/ELLIOTTCABLE/Paws.js.git
    > git update-index --assume-unchanged Executables/paws.js
    > git diff --find-copies-harder
    > stat -f '%p' Executables/paws.js

I'm working on git 1.9.2.

⁓ ELLIOTTCABLE — fly safe.
  http://ell.io/tt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-15 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-11 19:20 Strange situation with --assume-unchanged and diff --find-copies-harder Elliott Cable
2014-05-14 22:13 ` [PATCH] run_diff_files: do not look at uninitialized stat data Jeff King
2014-05-15 16:37   ` Junio C Hamano

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