git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git feature request: --amend older commit
@ 2012-08-17 15:47 George Spelvin
  2012-08-17 16:33 ` Michael Haggerty
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: George Spelvin @ 2012-08-17 15:47 UTC (permalink / raw)
  To: git; +Cc: linux

With git's "commit frequently" style, I often find that I end up with a
commit that includes a typo in a comment or I forgot one call site when
updating functions or something.

And it's a few commits later before I notice the simple oops.

This is of course fixable by making a commit, rebase -i HEAD~4 (or whatever),
and marking the fixup for squashing into the previous commit.

But it would be really handy if there were a one-step command for doing this.

Something like "git commit --fixup HEAD~3", where "git commit --fixup HEAD"
would be equivalent to "git commit --amend".

It would be fine if it were implemented using rebase -i and you had to
use "git rebase --continue" to recover from a conflict.  And history had
to be linear from the fixup point to HEAD.

The only thing I'd wish for, that rebase -i doesn't support, is a commit
with a dirty tree.  (Because often the typo is noticed in the middle of further
development.)  But if I have to manually stash & pop, that would be good enough.


Talking with some friends, they all say "yeah, I would really use that
feature".  So I figured I'd mention it here.

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

end of thread, other threads:[~2012-08-18 21:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17 15:47 Git feature request: --amend older commit George Spelvin
2012-08-17 16:33 ` Michael Haggerty
2012-08-17 17:00   ` George Spelvin
2012-08-17 16:37 ` Thomas Rast
2012-08-18  1:41 ` Jared Hance
2012-08-18 21:57   ` Junio C Hamano

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