git-diff-tree rename detection for single file
- From
David Ho <davidkwho@gmail.com>
- Date
- Oct 18, 2005, 19:56 UTC
- Message-ID
- <4dd15d180510181256i1c5a82d9ld62acaedb493cf71@mail.gmail.com>
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