git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Wong <andrew.w-lists@sohovfx.com>
To: Peter Krefting <peter@softwolves.pp.se>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Interactive rebase with pre-built script?
Date: Wed, 12 Sep 2012 12:38:40 -0400	[thread overview]
Message-ID: <5050BA90.2010105@sohovfx.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1209110725130.8398@ds9.cixit.se>

On 09/11/2012 02:32 AM, Peter Krefting wrote:
> Now, to my question. Is there an easy way to run interactive rebase on 
> the upstream branch with this recipe? The best we have come up with so 
> far is
>
>   git checkout master # the upstream branch
>   git rebase -i HEAD~
>
> and then just append everything from the generated recipe.
Instead of rebasing to "HEAD~", you should be able to do:
     git rebase -i HEAD
The default recipe should then just be "noop", and you can replace the 
whole default recipe with your recipe. This should also work even if the 
last commit was a merge.

Instead of appending your own recipe, you could also abuse the EDITOR 
environment variable.
Say your recipe is stored in a file called "my_recipe". Then, you could 
do this:
     env EDITOR="cp my_recipe" git rebase -i HEAD

But this could potentially be dangerous because if "rebase" fires up a 
editor for any other reason (e.g. having a "reword" or "squash" in your 
recipe), then the commit message will be messed up. So you need to make 
sure your recipe won't trigger any editor except for the recipe.

  parent reply	other threads:[~2012-09-12 17:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11  6:32 Interactive rebase with pre-built script? Peter Krefting
2012-09-11 15:35 ` Junio C Hamano
2012-09-12 16:38 ` Andrew Wong [this message]
2012-09-13 13:33   ` Peter Krefting
2012-09-13 18:08     ` Andrew Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5050BA90.2010105@sohovfx.com \
    --to=andrew.w-lists@sohovfx.com \
    --cc=git@vger.kernel.org \
    --cc=peter@softwolves.pp.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).