Hi CrOS-dev,
Currently there are several ways to cherry-pick a CL into other branches:
2. In command line, do "git cherry-pick".
So I have a question: what's the "recommended approach"?
The story behind that is I want to know how to deal with the Change-Id when cherry-picking.
Gerrit web won't change Change-Id, but it'll add a "(cherry pick from commit $hash).
git cherry-pick won't change Change-Id, nor adding messages.
repo cherr-pick will replace the Change-Id by a "(cherry pick from commit $hash)" message. Also on the wiki page it said"make sure to delete the old ChangeID line so that a new one will automatically be generated for you."
From what I understand, Change-Id has a special meaning that Gerrit use it to track/track "a change set". Previously we have some guideline with something like "when cherry-picking, change Reviewed-* to Original-Reviewed-* and remove ChangeId to get new one"; seems like that's removed from wiki pages so I think we only care about Change-Id now.
I've seen bugs like "if we cherry-pick to same branch multiple times using same Change Id, merge one and abandon others, there's a chance Gerrit may reject further new changes based on change since it'll think the parent is abandoned" so I think ChangeId should be unique for cherry-pick CLs;
However, people using Gerrit Web are usually not aware of the Change-Id stuff and simply use same Change-Id; and in fact that also helps them to track "what branches have I cherry-picked this change to".
Example:
https://chromium-review.googlesource.com/#/c/400979/ # a cherry-pick change I've made by clicking the gerrit web button but deleted the original change id, to have a new id. You won't see Cherry-Picks list on Gerrit interface. You also can't find a link to this on the original change.
So that makes me confused: people doing command line (repo cherry-pick) seem to use different change-id by default, but people using we interface are encouraged to use same change ID.
Is there some new policy / guideline for what we should do?