Is it possible to have a 'custom' change-id in a gerrit commit message?
For example,
- My commit message
Change-Id: BM10945
Where BM10945
is the bluemine ticket the change is for.
I keep getting a (missing or invalid Change-Id line format in commit message footer)
from gerrit, and can't commit.
You can use the commentlink config to automatically parse ticket numbers in commit messages, and show them as links in the Gerrit web interface.
E.g. for your redmine ones:
[commentlink "redmine"]
match = "(BM[0-9]+)"
html = "<a href='http://www.redmine.org/issues/$1'>$1</a>"
Also, you can use the TrackingID to add a footer containing a link to a tracking database although note that if you're using the simplest setup which uses the embedded H2 database, the you have to run the ScanTrackingIds program manually when Gerrit is offline which doesn't make it feasible.
Finally, if you want some other form of linking tickets to redmine tickets, such as email updates containing a link or make gerrit actions (publish patchset, merge) update the ticket, use Gerrit hooks (slightly different than regular git hooks) and some scripting to connect them.
In complement to Carl Norum's answer, you can indeed create your own ChangeId as long as :
One sample format could be :
I201611160832aa0000000000786176696572
It starts with the date and time (YYYYMMDDHHMM
), followed by a separator, and then the name of the committer in hexa format (here i used ascii, but one could use another format), padded with 00.
No, you can't. You need to use Gerrit's own Change-Id format. You can have one autogenerated for your commit by installing the commit-msg hook script included with Gerrit. More information is available at the Gerrit Change-Ids documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With