问题
This works fine:
[git@hbhriq]$ git diff ..ers-gr-patch --name-only
sites/all/modules/brd_form_alters/brd_form_alters.module
sites/all/modules/brd_social/brd_social.module
sites/all/modules/globalredirect/globalredirect.module
But @qqx points out in one of my other recent posts that using ..erg-gr-patch
is not really the right way to do things. Unfortunately, the alternative fails:
[git@hbhriq]$ git diff ers-gr-patch --name-only
error: bad tree object ers-gr-patch
@qqx said the following about ..branch_name
:
BTW, your diff command is somewhat incorrect. The .. in front of the branch name causes that to be interpreted as a range of commits (equivalent to HEAD..stage/master), but diff operates on individual commits rather than ranges. This is a somewhat common mistake so diff has been adjusted to somewhat allow for it, but it can still give misleading results. In this case it will show changes reversed from what you'd likely expect showing the changes needed to go from your current state to stage/master rather than the changes that took place to bring the state from stage/master to the state reflected by the tip of your current branch. The latter is more likely be be what you were expecting.
Can someone help me understand what the problem is?
来源:https://stackoverflow.com/questions/17996531/why-cant-i-do-git-diff-on-this-specific-commit