From: Will Palmer <wmpalmer@gmail.com>
To: Joshua Juran <jjuran@gmail.com>
Cc: Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
Alex Riesen <raa.lkml@gmail.com>,
Lynn Lin <lynn.xin.lin@gmail.com>,
git@vger.kernel.org
Subject: Re: how to squash two commits into only one
Date: Tue, 29 Mar 2011 16:02:19 +0100 [thread overview]
Message-ID: <1301410939.3012.12.camel@wpalmer.simply-domain> (raw)
In-Reply-To: <04C85603-1737-42BC-A037-2C45D5315435@gmail.com>
On Tue, 2011-03-29 at 06:12 -0700, Joshua Juran wrote:
> On Mar 29, 2011, at 5:49 AM, Nguyen Thai Ngoc Duy wrote:
>
> > On Tue, Mar 29, 2011 at 7:44 PM, Joshua Juran <jjuran@gmail.com>
> > wrote:
> >> On Mar 29, 2011, at 3:58 AM, Alex Riesen wrote:
> >>
> >>> On Tue, Mar 29, 2011 at 12:10, Lynn Lin <lynn.xin.lin@gmail.com>
> >>> wrote:
> >>>
> >>>> only have two commits
> >>>
> >>> Than yes, "git reset HEAD^; git commit --amend" seems the best
> >>> solution.
> >>
> >> Actually, that should be: `git reset --soft HEAD^; git commit --
> >> amend`.
> >
> > "git rebase --root" does not seem a bad idea though. I need to amend
> > initial commit a few times and end up using "git reset" without
> > --soft.
>
> Or perhaps have `git commit --amend` issue a warning if doesn't
> actually amend anything. ............................................
I like this idea. It's been in my notes for a while, but seems like it
has a lot of potential to make existing scripts noisy for no reason.
I do agree with the change, however.
The only constructive thing I'd add, as it's sitting in my notes right
next to "Warn if "git commit --amend" introduces no changes":
- Add "git commit --reword", like --amend, but without the above
warning
This would fit in with the existing names from "git rebase -i".
--fixup (for "like --amend but do not ask for a message") seems like a
sensible addition to those to, also following the lead of rebase -i, but
--fixup=<commit> already means something different (though related), so
it is probably a bad idea to overload --fixup with no =<commit>.
> ........................ Sometimes you just want to change the commit
> message, so you wouldn't want a warning in that case. But other times
> you're adding changes and updating the commit message at the same
> time, so you'd want a warning if you forgot to git-add or use --soft.
> A new --fix option to commit could work like --amend, but fail with an
> error if no changes are staged. Another option is for --amend to list
> the staged changes in the edit buffer, or a warning when nothing has
> changed.
>
> Josh
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-03-29 15:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-29 5:42 how to squash two commits into only one Lynn Lin
[not found] ` <AANLkTi=PZY2d+NhNnnOyXMX70N31vRg3qS5er+hECy8A@mail.gmail.com>
2011-03-29 6:04 ` Lynn Lin
2011-03-29 6:15 ` Tor Arntsen
2011-03-29 8:24 ` Lynn Lin
2011-03-29 8:50 ` Tor Arntsen
2011-03-29 9:38 ` Alex Riesen
2011-03-29 10:10 ` Lynn Lin
2011-03-29 10:58 ` Alex Riesen
2011-03-29 12:44 ` Joshua Juran
2011-03-29 12:49 ` Nguyen Thai Ngoc Duy
2011-03-29 13:12 ` Joshua Juran
2011-03-29 15:02 ` Will Palmer [this message]
2011-03-29 18:28 ` Junio C Hamano
2011-03-30 19:22 ` Dirk Süsserott
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=1301410939.3012.12.camel@wpalmer.simply-domain \
--to=wmpalmer@gmail.com \
--cc=git@vger.kernel.org \
--cc=jjuran@gmail.com \
--cc=lynn.xin.lin@gmail.com \
--cc=pclouds@gmail.com \
--cc=raa.lkml@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).