git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Stephen Kelly <steveire@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git interactive rebase 'consume' command
Date: Sun, 20 Jan 2013 14:17:25 +0000	[thread overview]
Message-ID: <20130120141725.GL31172@serenity.lan> (raw)
In-Reply-To: <kdgtir$apt$1@ger.gmane.org>

On Sun, Jan 20, 2013 at 03:05:18PM +0100, Stephen Kelly wrote:
> I find the fixup command during an interactive rebase useful.
> 
> Sometimes when cleaning up a branch, I end up in a situation like this:
> 
>  pick 07bc3c9 Good commit.
>  pick 1313a5e Commit to fixup into c2f62a3.
>  pick c2f62a3 Another commit.
> 
> So, I have to reorder the commits, and change 1313a5e to 'f'. An alternative 
> would be to squash 's' c2f62a3 into 1313a5e and clean up the commit message. 
> The problem with that is it ends up with the wrong author time information.
> 
> So, I usually reorder and then fixup, but that can also be problematic if I 
> get a conflict during the re-order (which is quite likely).
> 
> I would prefer to be able to mark a commit as 'should be consumed', so that:
> 
>  pick 07bc3c9 Good commit.
>  consume 1313a5e Commit to fixup into c2f62a3.
>  pick c2f62a3 Another commit.
> 
> will result in 
> 
>  pick 07bc3c9 Good commit.
>  pick 62a3c2f Another commit.
> 
> directly.
> 
> Any thoughts on that? 

Are you aware of the "--autosqush" option to git-rebase (and the
"rebase.autosquash" config setting)?  I find that using that combined
with the "--fixup" option to git-commit makes this workflow a lot more
intuitive.

(Which is not to say that I wouldn't find an option like 'consume'
useful but I find myself reordering the list very rarely since I started
using "git commit --fixup=...".)


John

  reply	other threads:[~2013-01-20 14:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 14:05 git interactive rebase 'consume' command Stephen Kelly
2013-01-20 14:17 ` John Keeping [this message]
2013-01-20 14:23   ` Stephen Kelly
2013-01-20 19:05 ` Junio C Hamano
2013-01-20 19:13   ` Stephen Kelly
2013-01-20 20:23     ` Junio C Hamano
2013-01-21  1:49       ` Jeff King
2013-01-21  8:40       ` Stephen Kelly
2013-01-21 11:05 ` Michael Haggerty
2013-01-21 19:05   ` Stephen Kelly

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=20130120141725.GL31172@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=steveire@gmail.com \
    /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).