[openstack-dev] Gerrit shortcut question

Sean Dague sean at dague.net
Mon May 12 18:10:39 UTC 2014


On 05/12/2014 01:03 PM, Lowery, Mathew wrote:
> Gerrit supplies the following "shortcuts" for any change (in the "new
> screen", there's a Download drop down in the top right or for the "old
> screen", it's just under the Patch Set heading):
> 
> Checkoutgit fetch https://review.openstack.org/openstack/trove
> refs/changes/09/88709/11 && git checkout FETCH_HEAD
> Cherry-Pickgit fetch https://review.openstack.org/openstack/trove
> refs/changes/09/88709/11 && git cherry-pick FETCH_HEAD
> Format-Patchgit fetch https://review.openstack.org/openstack/trove
> refs/changes/09/88709/11 && git format-patch -1 --stdout FETCH_HEAD
> Pullgit pull https://review.openstack.org/openstack/trove
> refs/changes/09/88709/11
> Patch-File629016b.diff.base64 | 629016b.diff.zip
> 
> I have questions regarding these shortcuts, specifically in the context
> of Gerrit dependencies (i.e. one Gerrit change depends on another Gerrit
> change) Let's say my ultimate goal is to get the patch set including its
> dependencies and apply those to the latest master because I want to do
> some manual testing. Below is my understanding of the existing options
> (feel free to correct any incorrect statements):
> 
>   * Checkout grabs the original sequence of commits as they were at
>     submit time. In other words, all the parent commits are the same as
>     when the patch set was submitted. The master and the parent
>     dependencies could have all advanced or changed.
>   * Cherry-pick applies the diff introduced by the named patch set
>     alone. Parent dependencies are not involved.\
>   * Format-patch: I don't know when to use this.
>   * Pull: By default this will merge the two branches (and create a
>     merge commit). However, I have pulls configured to always rebase.
>     When the pull does a rebase, the patch set and its dependencies do
>     not appear as the most recent commits which I find not ideal.
>   * Patch-File: Isn't this a portable cherry-pick? How does it relate to
>     format-patch?
> 
> So that summarizes my understanding of the current shortcuts.
> 
> What (I think) I want (that is not provided) is this:
> 
> git fetch https://review.openstack.org/openstack/trove
> refs/changes/09/88709/11 && git checkout FETCH_HEAD && git
> fetch https://review.openstack.org/openstack/trove master && git rebase
> FETCH_HEAD
> 
> In other words, fetch the patch set with dependencies then check it out
> (detached head). Fetch the latest master then rebase the patch set (and
> dependencies) on the latest master. End result: latest master with patch
> set and all dependencies as the most recent commits.
> 
> Am I missing something fundamental or would this be a useful shortcut to
> have?

Is there a reason you aren't just using git-review for this?

git review -d 88709 && git rebase master

	-Sean

-- 
Sean Dague
http://dague.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140512/abc80b7c/attachment.pgp>


More information about the OpenStack-dev mailing list