How to determine which commits were compressed in git?

I am writing a script that maintains a link to some commits in the repository, but if some commits become crushed, the links become invalid. I know there is a pre-rebase , but no post-rebase hook, so is there a way to determine which commits are compressed together?

For example, before rebase, I had this story:

 cf79121 Refactor the trim_file_name method. Closes #1965. 82ed26a Updated dependencies and project versions. 8047297 Updated Node.js implementation package information. b2b727c Added "finished" callback, which is called for each "completed" or "failed" event. 

After reinstalling, I received:

 cf79121 Refactor the trim_file_name method. Closes #1965. 9b7ac26 Updated dependencies, project versions, and node.js package information. b2b727c Added "finished" callback, which is called for each "completed" or "failed" event. 

How can I find out that 82ed26a + 8047297 = 9b7ac26 ?

+4
source share
1 answer

If this information is still in the repo reflog where you only git makes squash ... I don’t think you can return this information.
See " How to reverse git squash merging? ".

So your script may work in the local git repository where the squash occurred, but it would not work in a clone of the same repo.

If squash is not systematically documented in the comments when the user does this, this information (which is committed was crushed) will not be available.

+3
source

All Articles