git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A couple of rebase --autosquash proposals
@ 2013-12-09  2:23 Brett Randall
  2013-12-09  6:51 ` Johannes Sixt
  0 siblings, 1 reply; 7+ messages in thread
From: Brett Randall @ 2013-12-09  2:23 UTC (permalink / raw)
  To: git

Hi,

I am using Git 1.8.4.3 compiled by me on OEL6.  I'd like to be able to
use rebase --autosquash like this:

======================
# git log

commit b94f970cd869dfbf5254b19867fa7200df732d4f
Author: Me <me@me.com>
Date:   Mon Dec 9 17:02:32 2013 -0800

    fixup!
    This is a second fixup.

commit 64e516c8b26b7e0531a1e8b2fc8dfa21de259b85
Author: Me <me@me.com>
Date:   Sun Dec 8 17:02:32 2013 -0800

    fixup!
    This is a meaningful commit-log message, on a new line, that will
be discarded later during rebase --autosquash.

commit f21cd48d5eeac92130dc0617252c6ee6989c0252
Author: Me <me@me.com>
Date:   Tue Dec 3 21:47:52 2013 -0800

    This is the commit that will be fixed-up.

commit 259c0eb41ef16ac94868ee3c9253ba938ed24c9f
Author: Me <me@me.com>
Date:   Mon Dec 2 21:47:52 2013 -0800

    This commit is origin/master.
======================

then

# git rebase -i --autosquash 259c0eb41ef16ac94868ee3c9253ba938ed24c9f

The differences here are:

* fixup! or squash! on it's own would default to fixing-up the
previous commit (or result of previous step of rebase if that was a
squash/fixup).  Interestingly using HEAD~1 or HEAD^1 works, but it
only works for a single fixup/squash.  Is there another treeish that
would work?
* Allow real commit-log text, perhaps only on lines other than the
first line (the one containing the fixup).

The motivations are:

* I can default a fixup to apply to the previous commit (a common
wish) without explicitly stating it's treeish or commit-message.
* I can easily apply multiple fixups.
* I can retain a meaningful WIP commit-log prior to the rebase - I can
still see what each commit does, without needing to forgo the future
autosquash capability - just put the !fixup or !squash on the first
line on its own, and put the real changes on line 2 and onwards.  In
the case of squash! instead of fixup!, this means I could retain some
valuable text to be squashed into the original commit.

Thoughts on these two ideas?

Thanks
Brett

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-12-09 23:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09  2:23 A couple of rebase --autosquash proposals Brett Randall
2013-12-09  6:51 ` Johannes Sixt
2013-12-09  9:26   ` Chris Packham
2013-12-09  9:39     ` Philippe Vaucher
2013-12-09  9:52     ` Brett Randall
2013-12-09 20:20   ` Junio C Hamano
2013-12-09 23:20     ` Brett Randall

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).