Git development
 help / color / mirror / Atom feed
* diff for deleted file only, when changed to directory
@ 2010-12-08  8:12 Bert Wesarg
  2010-12-08  8:21 ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: Bert Wesarg @ 2010-12-08  8:12 UTC (permalink / raw)
  To: Git Mailing List

Hi,

when I stage a file deletion (named foo) and than add a new file
(named foo/bar) in a directory with  the name of deleted file. git
diff --cached -- foo shows me the diff for both the file foo and file
foo/bar.

Here is a recipe:

echo foo >f
git add f
git commit -mfoo
git rm f
mkdir f
echo bar >f/0
git add f/0
git diff -- f
git diff --cached -- f

gives me this:

diff --git c/f i/f
deleted file mode 100644
index 257cc56..0000000
--- c/f
+++ /dev/null
@@ -1 +0,0 @@
-foo
diff --git c/f/0 i/f/0
new file mode 100644
index 0000000..5716ca5
--- /dev/null
+++ i/f/0
@@ -0,0 +1 @@
+bar

For the other case, when I stage a symlink under the name foo, I can
understand that git diff shows me two diffs. But for the case
file->directory, I would like to see only the deleted diff, not
recursing into the directory.

Bert

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

end of thread, other threads:[~2010-12-08  9:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-08  8:12 diff for deleted file only, when changed to directory Bert Wesarg
2010-12-08  8:21 ` Jonathan Nieder
2010-12-08  9:29   ` Bert Wesarg
2010-12-08  9:56     ` Nguyen Thai Ngoc Duy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox