git-diff-tree rename detection for single file
From: David Ho <hidden>
Date: 2016-06-15 22:42:09
Subsystem:
the rest · Maintainer:
Linus Torvalds
Hi, I have a small suggestion to make the diff of a renamed file a bit more meaningful. I have a file that is renamed-edited and commited. git-diff-tree -M -p <commit> shows one result and git-diff-tree -M -p <commit> <filename> shows another. If they both show a rename occurred then I think the single file git-diff-tree will be more useful. Any strange idea I have is to make git-diff-tree traverse the list of commits (assuming the list is returned from git-rev-list) to trace renames of the file to its origin. Of course I don't know how useful this is to most. David [davidho@penguin git-tutorial]$ git-diff-tree -r -M -p \ 8c77fe87790276b4e0b2650d7c5799eb893ac3ed 8c77fe87790276b4e0b2650d7c5799eb893ac3ed
diff --git a/goodbye b/ciao
similarity index 83%
rename from goodbye
rename to ciao
index 0561cce..d8259f5 100644
--- a/goodbye
+++ b/ciao@@ -4,3 +4,4 @@ Play, play, play Work, work, work Eat, eat, eat Drink, drink, drink +Chew, chew, chew
[davidho@penguin git-tutorial]$ git-diff-tree -r -M -p \ 8c77fe87790276b4e0b2650d7c5799eb893ac3ed ciao 8c77fe87790276b4e0b2650d7c5799eb893ac3ed
diff --git a/ciao b/ciao
new file mode 100644
index 0000000..d8259f5
--- /dev/null
+++ b/ciao@@ -0,0 +1,7 @@ +Hello World +It's a new day for git +Play, play, play +Work, work, work +Eat, eat, eat +Drink, drink, drink +Chew, chew, chew