https://codereview.qt-project.org/50795

Because "git cherry-pick-and-gpush" was too long. Suggestion:

        git config --global alias.gp gerrit-pick

As the long name says, it does cherry-picks and then pushes the result to 
Gerrit. The simple usage is, therefore, similar to git cherry-pick:

        git gp commit1 commit2 commit3
OR
        git gp commit1..commit2

Unlike cherry-pick, this command does NOT change the working tree. It uses git 
apply --cached for its functionality, so you do not have to stop what you're 
doing in order to do the pushes. You don't even have to commit unfinished 
changes!

Switches:
 -t | --target  target branch name (stable, dev); default: upstream of HEAD
 -r | --remote  name of the remote to push to; default: "gerrit"
 -b | --base    commit to apply the changes on top of; default: upstream
 -n | --dry-run do everything except actually push
 -v | --verbose produce more output

Example usages:

Pushing the last commit made to remote named "gerrit", to the upstream of the 
current branch:
        git gp HEAD

Same, but adding Ossi as a reviewer:

        git gp HEAD +ossi
        git gp +ossi HEAD

Same, and now sending the last two commits:

        git gp HEAD~ HEAD +ossi
        git gp HEAD~2.. +ossi

Same, but now targetting dev instead of the upstream branch:

        git gp -t dev HEAD~2.. +ossi

Same, and now set the base commit (hint: get the SHA-1 of the last patch-set 
from the Gerrit web interface and add ~):

        git gp -t dev -b 4d1dc4b32bb4c4c25bde720299557a4ff3e344e2~ HEAD~2..

Here's my lossage:
$ history -n 1 | grep 'git gp'
git gp HEAD +fregl +jpassion +lpotter
git gp [email protected] [email protected] HEAD
git gp [email protected] [email protected] HEAD
git gp [email protected] [email protected] HEAD
git gp HEAD
git gp +ogoffart c39fc596c6984e94af7f7e5b14de130ad520c26e
git gp 2ff6182
git gp +nierob +ogoffart 
11297b4c7661f99a91c9df5e4f6596dad3e5dea7..653bfe660e18f09df04dbd294ece64d7b8cda72a
 
-t dev
git gp HEAD [email protected] [email protected]
git gp
git gp HEAD
git gp HEAD [email protected]
git gp b5728f3 -b 714ff76a75c1262aee052a7f9a637528d2be8063~
git gp -b 4d1dc4b32bb4c4c25bde720299557a4ff3e344e2~ :/Re-shuffle

That "git gp" didn't do anything
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to