Consider the following scenario when running this line of code on a feature branch in git:
file path/* || echo Changed git diff —quiet master feature
If any file in the specified file path changes, the first statement will exit with a 0 value. The next command to the right will then echo "Changed" to indicate that there have been changes to the master branch.
I'd like to do something similar, but in the context of comparing a commit to itself in relation to previous amendments.
So, if I have commit A (patch 1), make a change, and run "git commit —amend," the commit is amended, and we'll call it B. (patch 2). The first patch will be A, and the second patch will be B. (as it will typically be in Gerrit).
Is it possible to compare the two patches and see which files have changed since the last "git commit —amend" command?
So, ideally, I'd like to use something like "git diff" to compare patch X relative to patch Y of a commit that specifies changed or updated files.