3 ms·
It's more or less equivalent to: git log -p master..fix-typos@{3} > tmp1 git log -p master..fix-typos > tmp2 diff -u tmp1 tmp2 except that pipes are use
by jwilk 8y ago
It's more or less equivalent to:
git log -p master..fix-typos@{3} > tmp1
git log -p master..fix-typos > tmp2
diff -u tmp1 tmp2
except that pipes are used instead of temporary files.
- jolmg 8y agoPerhaps, yosito meant what the purpose of the whole command was, rather than what <() meant. It looks like a diff of diffs and commit info, but I've never used branch@{n} before. Looking into gitrevisions(7), it gives the nth prior value of branch, so doing a regular commit would be represented as an addition of a commit and its changes and doing a `git reset @~` in that branch would be shown as a deletion. Doing a `git commit --amend` appears as a modification of that commit. It seems useful.
- yosito 8y agoSo what does it do?
- u801e 8y agogit log -p start-commit-sha1..end-commit-sha1 will display the commit log including diffs associated with each commit from the commit after start-commit-sha1 up to the end-commit-sha1. If you make changes to your code and/or commit messages and subsequently rebase the branch, then the end-sha1-value will change (since you now have a different set of commits). If you run the same git log -p command with the new end-commit-sha1 value, then the log output will differ based on the changes you made when you rebased. So if run a diff between the two git log -p outputs (one with the original end-commit-sha1 and the other with the new end-commit-sha1), you'll be able to see the difference between the two logs which includes the changes you made to the code and/or commit messages).