From: Jeff King <peff@peff.net>
To: Peter Krefting <peter@softwolves.pp.se>
Cc: Phil Hord <phil.hord@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Fabian Ruch <bafain@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: Confusing error message in rebase when commit becomes empty
Date: Fri, 13 Jun 2014 03:31:13 -0400 [thread overview]
Message-ID: <20140613073113.GE7908@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.DEB.2.00.1406130823251.27436@ds9.cixit.se>
On Fri, Jun 13, 2014 at 08:25:43AM +0100, Peter Krefting wrote:
> >Yes, but empty commits are discouraged on some projects. If you want your
> >"change + revert = empty" commit to appear after the squash, I would
> >expect you would want to use --keep-empty on your inital rebase command.
> >But I'm not sure that will do what you expected either; it may only keep
> >previously-empty commits during the rebase.
>
> The thing is that I wasn't expecting it to come out empty, as I had another
> commit to squash into it. That the interim throw-away squashed commit was
> empty should have been an internal matter to rebase, IMHO.
That's a good point that I neglected in my other response. Maybe the
right solution is for "rebase --interactive" to always pass
"--allow-empty" when doing a squash. And then either:
1. Always keep such empty commits. A user who is surprised by them
being empty can then revisit them. Or drop them by doing another
rebase without --keep-empty.
2. Notice ourselves that the end-result of the whole squash is an
empty commit, and stop to let the user deal with it.
-Peff
next prev parent reply other threads:[~2014-06-13 7:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-11 12:49 Confusing error message in rebase when commit becomes empty Peter Krefting
2014-06-11 15:44 ` Phil Hord
2014-06-11 17:57 ` Peter Krefting
2014-06-11 19:04 ` Phil Hord
2014-06-13 7:25 ` Peter Krefting
2014-06-13 7:31 ` Jeff King [this message]
2014-06-13 7:27 ` Jeff King
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=20140613073113.GE7908@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=bafain@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peter@softwolves.pp.se \
--cc=phil.hord@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).