From: Michael Haggerty <mhagger@alum•mit.edu>
To: George Spelvin <linux@horizon•com>
Cc: git@vger•kernel.org
Subject: Re: Git feature request: --amend older commit
Date: Fri, 17 Aug 2012 18:33:31 +0200 [thread overview]
Message-ID: <502E725B.2040906@alum.mit.edu> (raw)
In-Reply-To: <20120817154749.11762.qmail@science.horizon.com>
On 08/17/2012 05:47 PM, George Spelvin wrote:
> 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". [...]
Have you tried "git rebase --autosquash"? It does part of what you are
asking for and additionally allows multiple fixup commits to be queued
up and processed in a single rebase.
Michael
--
Michael Haggerty
mhagger@alum•mit.edu
http://softwareswirl.blogspot.com/
next prev parent reply other threads:[~2012-08-17 16:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-17 15:47 Git feature request: --amend older commit George Spelvin
2012-08-17 16:33 ` Michael Haggerty [this message]
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
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=502E725B.2040906@alum.mit.edu \
--to=mhagger@alum$(echo .)mit.edu \
--cc=git@vger$(echo .)kernel.org \
--cc=linux@horizon$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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