git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git status / git diff -C not detecting file copy
@ 2014-11-30  0:35 Pol Online
  2014-11-30  1:03 ` Bryan Turner
  0 siblings, 1 reply; 12+ messages in thread
From: Pol Online @ 2014-11-30  0:35 UTC (permalink / raw)
  To: git

Hi,

The documentation for git status at http://git-scm.com/docs/git-status
implies that it should be able to detect both renames and copies (with
the R and C states). The command git diff -C should do it as well.

However I can't get either to detect copies in this simple test case -
what is happening?


mkdir test
cd test/
git init
echo 'Hello World!' > hello.txt
echo 'Goodbye World!' > goodbye.txt
git add -A
git commit -m "Initial commit"

cp hello.txt copied.txt
mv goodbye.txt moved.txt
git add -A

$ git status --short
A  copied.txt  <------------ NO COPY DETECTED
R  goodbye.txt -> moved.txt

$ git diff -M -C --summary --cached
 create mode 100644 copied.txt  <------------ NO COPY DETECTED
 rename goodbye.txt => moved.txt (100%)

$ git commit -m Test
$ git diff -M -C --summary HEAD~
  create mode 100644 copied.txt  <------------ NO COPY DETECTED
  rename goodbye.txt => moved.txt (100%)


-Pol

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

end of thread, other threads:[~2014-12-03 16:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-30  0:35 git status / git diff -C not detecting file copy Pol Online
2014-11-30  1:03 ` Bryan Turner
2014-11-30  1:30   ` Pol Online
2014-11-30  1:54     ` Bryan Turner
2014-12-02  6:55       ` Jeff King
2014-12-02 14:15         ` Pol Online
2014-12-02 17:57         ` Junio C Hamano
2014-12-02 20:09           ` Jeff King
2014-12-03 16:01             ` Junio C Hamano
2014-12-02 21:40         ` Bryan Turner
2014-12-02 21:50           ` Jeff King
2014-12-03 16:03             ` 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).