Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git: detect if a github PR squash is a no-op

Tags:

git

github

Background:

  • A user sends me a github Pull Request with 3 commits.
  • I review that PR and like it, but I want commits 1-2 squashed together.
  • User squashes those commits and re-pushes.

How can I know that the net state of the PR has not changed? I don't want to re-review it if literally the final state is identical.

Is there a fast way to get a checksum of the current content (but not commit sequence) of the tree?

like image 474
Tim Hockin Avatar asked May 13 '26 07:05

Tim Hockin


1 Answers

"A checksum of the ... content" would be the TREE hash from the commit. So I guess you could

git log -n1 --format=%T

on each of the new and old commits, and see if the values match.

Or you could just use git diff to compare the commits' content (which will notice that the TREE hashes are the same and be done, so...)

like image 196
Mark Adelsberger Avatar answered May 15 '26 05:05

Mark Adelsberger