I want to know, how exactly does git review
command work? I mean does it use git push
command (internally) or something else to upload the changes to gerrit. This information would be useful for me while writing git hooks for git review
.
Asked
Active
Viewed 1.3k times
9

Eugene Yarmash
- 142,882
- 41
- 325
- 378

Yo Yo Money Singh
- 679
- 3
- 11
- 22
-
4`git review -v` prints out all of the git commands that are being run. – Eugene Yarmash Apr 26 '15 at 21:20
1 Answers
11
From the fine manual:
When you submit a change, git review
does the following things:
- it looks up which branch to push to (production or whatever) in the
.gitreview
file. If it can't find this information, it pushes tomaster
- it figures out what "topic" to put on the revision (you can set the topic manually with
-t
)
- if you're resubmitting a downloaded change, it will reuse the tag of the original change
- if your commit summary contains a bug number like
bug 12345
, the tag will bebug/12345
- otherwise, the tag will be the name of your local branch
- it rebases your change against the
HEAD
of the branch you're pushing to (use-R
to skip this) - if you are submitting more than one change at once, or submitting a change that's based on another unmerged change, it will ask you whether you really meant to do that (use
-y
to skip this) - it pushes the change for review

Eugene Yarmash
- 142,882
- 41
- 325
- 378
-
2
-
the location of .gitreview file is the root of you tree. and you change the following attribute. [gerrit] defaultbranch=
– irsis Jan 22 '23 at 08:35