[Development] [FYI] the smart way of pushing to gerrit, take 2
oswald.buddenhagen at gmx.de
Wed Apr 1 21:47:16 CEST 2020
not even six years after the initial announcement, i have landed my
git-gpush improvements and related tools to the qtrepotools repo.
note for early adopters (i heard that there are quite some of you at
kdab): the command lines and metadata storage changed over the years.
the landing page https://wiki.qt.io/Git-gpush-scripts explains the major
features, how to get started and perform advanced tasks, and counters
frequent skepticism. excerpts:
The general idea of these scripts is to make working with Gerrit more
- You can keep many unrelated Changes on one local branch without
creating spurious dependencies between them on Gerrit. While you can
achieve the same by having a separate local branch for every series,
having all Changes on a single branch is much more convenient.
- You can pull as often as you want, including right before pushing, as
you would usually do in a git pull --rebase based workflow. Without
git-gpush, this would unnecessarily rebase previously pushed Changes,
which would make Gerrit's inter-diff feature slower and much noisier.
You may have noticed that these major features are geared towards making
not your life easier, but that of your reviewers. Until roles are
switched, that is.
As usual, you should start with some solid RTFM: ;)
$ git-gpush -h
$ git-gpick -h
$ git-gpull -h
$ git-ggc -h
Get all your pending changes onto the current branch, in case you kept
them on separate branches:
$ git cherry-pick <…>
Alternatively, you could merge all your local branches and then rebase.
If you have pending Changes for the given branch on Gerrit, you need to
synchronize (bootstrap) the state:
$ git gpick --check --all
To get an idea about what gpush thinks you have in your branch:
$ git gpush --list
Group remaining loose Changes into series:
$ git gpush --group :3
$ git gpush --group ~3:5
Get a more thorough overview:
$ git gpush --list-online
Push out any modified Changes:
$ git gpush --all
More information about the Development