git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: "Vojtěch Knyttl" <vojtech@knyt.tl>
Cc: git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Elijah Newren <newren@gmail.com>
Subject: Re: What did you do before the bug happened? (Steps to reproduce your issue)
Date: Tue, 1 Dec 2020 01:19:18 +0100	[thread overview]
Message-ID: <20201201001918.GG8396@szeder.dev> (raw)
In-Reply-To: <CANVGpwZGbzYLMeMze64e_OU9p3bjyEgzC5thmNBr6LttBt+YGw@mail.gmail.com>


Thanks for your report!

On Mon, Nov 30, 2020 at 11:11:20PM +0100, Vojtěch Knyttl wrote:
> What did you do before the bug happened? (Steps to reproduce your issue)
> 
> 1. Create a commit with hash-issueId, eg. '#87 Fix wrong indent'

Note that to end up with an empty commit message after the fixup it's
important to have a single-line commit message starting with a '#'
character.

> 2. Create a second commit with any commit message.
> 3. Use interactive rebase and 'f'ixup the second commit to the first one.
> 
> What did you expect to happen? (Expected behavior)
> 
> I expect a single commit with message: '#87 Fix wrong indent'

I agree that this is indeed the desired behavior, because 'git rebase'
should not cleanup unmodified commit messages.

It used to work before 18633e1a22 (rebase -i: use the rebase--helper
builtin, 2017-02-09) (released in v2.13.0), but after that it errored
out with "Aborting commit due to empty commit message" [1].

The scripted interactive rebase created fixup commits with 'git commit
--amend --no-verify -F <file>', which uses the 'whitespace' cleanup
mode, and thus didn't remove comments.  The builtin interactive
rebase/sequencer, however, invoked 'git commit -n --amend -F <file>
--cleanup=strip', i.e. it explicitly specified that comments must be
removed.


[1] The current behavior (i.e. empty commit message instead of that
    error) is the result of b00bf1c9a8 (git-rebase: make
    --allow-empty-message the default, 2018-06-27) (released in
    v2.19.0).



> What happened instead? (Actual behavior)
> 
> There is a commit with empty commit message. This happens without any
> warning and one notices even too late.
> 
> What's different between what you expected and what actually happened?
> 
> The commit message disappeared as it was probably treated as a comment.
> 
> Anything else you want to add:
> 
> [System Info]
> git version:
> git version 2.28.0
> cpu: x86_64
> no commit associated with this build
> sizeof-long: 8
> sizeof-size_t: 8
> shell-path: /bin/sh
> uname: Darwin 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11
> PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64
> compiler info: clang: 11.0.3 (clang-1103.0.32.62)
> libc info: no libc information available
> $SHELL (typically, interactive shell): /usr/local/bin/bash
> 
> [Enabled Hooks]
> pre-commit

      reply	other threads:[~2020-12-01  0:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 22:11 What did you do before the bug happened? (Steps to reproduce your issue) Vojtěch Knyttl
2020-12-01  0:19 ` SZEDER Gábor [this message]

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=20201201001918.GG8396@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=vojtech@knyt.tl \
    /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).