If I were to receive a patch file generated with something like git diff rev^ rev
or even git show -p rev
, how can I discover which commits are being diffed?
I'm not positive this use case is even relevant in git, but noting a file's path and/or revision numbers in the patch header included with cvs/svn give me a warm fuzzy that the patch that I have received, or created, is diffing against the correct source or revision.
Specifically, if we examine a git diff header:
diff --git a/lib/blueprint/semantic_class_names.rb b/lib/blueprint/semantic_class_names.rb
index 41bd496..c17af1d 100644
--- a/lib/blueprint/semantic_class_names.rb
+++ b/lib/blueprint/semantic_class_names.rb
I can find no distinguishing information about the commits involved in this diff. There is an index line, that I can only assume is not an abbreviated commit hash, but rather a hash of the diffed portions of the files. It certainly doesn't match the associated commit signatures.
If I diff a couple files, and decide to go old school with an emailed patch, is there no way for me to double-check quickly that I've diffed the right files/revisions before sending out the patch I made with a quick glance at the header? I understand that revisions aren't as meaningful in git as they are in cvs/svn due to the distributed nature, but am I the only one who wouldn't mind seeing at least the abbreviated commit signature of the files in the header?