Context : We are a team of programmer who work on a project with severals branches :
Master, Release, Develop
Sometimes we need to fix a bug on release, and we need to report this fix on develop, to report our bug fix we use : git cherry-pick commit-SHA
With this command the bugfix is well reported on develop but the commit has a different hash
What we need :
Sometimes we need to know the list of commits that has not been reported, to do so, we use the command who compare the two branches and give us the list of commit which exist in release but not in develop : git log develop..origin/release
The ISSUE :
This command compare the hash of commits, but as i said before, when we report our commits, their hash changes, thus, we get some commits as if they were not been reported while they are
I'm lookin for a way to report our bugfix without changing the hash of commits, or a way to list the difference of commits between two branches, not by the hash but based on the message or another thing
Thanks
cherry-pick
is not the right way to apply a commit to two branches. Read this series of articles to learn whycherry-pick
is not good and how to do it correctly. – Vadimgit patch-id
, which computes a hash for the diff listing fromgit show
, i.e., a hash ID for a changeset, as opposed to a hash ID for a commit. Two different commits will generate the same patch ID if they make the same changes to the same files, for some definition of "the same". – Orcinolgit cherry
does this for branch sets, andgit rev-list
has--cherry-mark
for doing this with symmetric difference operations. All of them use thegit patch-id
code internally to do this, but if they don't do what you need, you can invokegit show <commit> | git patch-id
to compute your own patch IDs and use them however you like. – Orcinol