From: Stephan Beyer <s-beyer@gmx.net>
To: Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
Cc: git@vger.kernel.org
Subject: Re: git-rebase eats empty commits
Date: Sun, 13 Jul 2008 00:12:07 +0200 [thread overview]
Message-ID: <20080712221207.GB22323@leksak.fem-net> (raw)
In-Reply-To: <g4vrrm$g35$1@ger.gmane.org>
Hi,
Michael J Gruber wrote:
> "git commit" allows empty commits with the "--allow-empty" option, i.e.
> commits which introduce no change at all. This is sometimes useful for
> keeping a log of untracked work related to tracked content.
>
> "git rebase" removes empty commits, for the good reason that rebasing
> may make certain commits obsolete; but I don't want that in the case
> mentioned above. Is there any way to specify "--preserve-empty" or
> similar?
First I can speak for git-sequencer: there is no such thing as a
"preserve empty" option, but currently, when you are picking a commit
that has already been applied so that no changes occur, it will pause.
(It will not pause if it is a fast-forward.)
Yet, I was unsure if this is a "correct" behavior, but it seemed to be
useful, because you can inspect the situation.
In my mind, the same should happen with an empty commit, so I tested it:
1. It pauses.
2. In that pause I only need to run "git commit --allow-empty" and I have
the picked empty patch with that commit message.
So if this behavior is kept, there is no such need for such an option.
Now I'm checking it with the old rebase-i (I'm always referring to
git-rebase--interactive as rebase-i) and exactly the same behavior
occurs.
But rebase is not rebase-i.
So I've also checked both, pure rebase and rebase-m: then the empty commit
is lost.
To sum up, use rebase -i and when it's pausing, do "git commit --allow-empty"
and then "git rebase --continue" and you have what you want.
Regards,
Stephan
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
next prev parent reply other threads:[~2008-07-12 22:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 13:59 git-rebase eats empty commits Michael J Gruber
2008-07-12 22:12 ` Stephan Beyer [this message]
2008-07-14 15:01 ` Michael J Gruber
2008-07-15 20:19 ` Stephan Beyer
2008-07-16 9:24 ` Michael J Gruber
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=20080712221207.GB22323@leksak.fem-net \
--to=s-beyer@gmx.net \
--cc=git@vger.kernel.org \
--cc=michaeljgruber+gmane@fastmail.fm \
/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).