When uploading a git commit for code review on Gerrit (2.8), I would like to be able to set the topic field (e.g. g-tune-pme-reform here https://gerrit.gromacs.org/#/c/3453/3). How can this be done from the command line? Can it be done in the original git push?
Asked
Active
Viewed 1.5k times
1 Answers
23
yes, it is possible using the push command:
git push origin HEAD:refs/for/master/<topic_name>

laplasz
- 3,359
- 1
- 29
- 40
-
9You have to use a new syntax in newer Gerrit versions: `git push origin HEAD:refs/for/master%topic=
` – Josef Glatz Mar 14 '19 at 23:04 -
Is it possible to make topic required? E.g. reject push without topic – Oleg Oleg Jun 15 '21 at 09:49
-
@OlegOleg ask this in a separate question – laplasz Jun 16 '21 at 19:09
-
What if I don't want to amend the patchset but **ONLY** to rename a topic? Currently I have the error: `commit already exists as current patchset` ? – bloody Nov 22 '22 at 09:11
-
@bloody - i think you should create a new question for this – laplasz Nov 26 '22 at 22:43
-
I could create a question if you knew the solution. You didn't assure this so I deduce you do not. – bloody Nov 27 '22 at 22:21
-
@bloody yes, but someone else might know, just use the tag gerrit – laplasz Nov 27 '22 at 22:49
-
Gerrit documentation: https://gerrit-review.googlesource.com/Documentation/intro-user.html#topics – Sybille Peters Feb 26 '23 at 18:57