git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Christoph Anton Mitterer <calestyo@scientia.net>
Subject: Re: [PATCH] sequencer: preserve commit messages
Date: Thu, 26 Feb 2015 11:49:18 -0800	[thread overview]
Message-ID: <xmqq61aomp1d.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54EEFDF7.8090306@drmicha.warpmail.net> (Michael J. Gruber's message of "Thu, 26 Feb 2015 12:05:27 +0100")

Michael J Gruber <git@drmicha.warpmail.net> writes:

> Hmm. With "--edit", current config being in effect should be expected,
> right? So how about:
>
> In case of no conflict: force cleanup=verbatim unless --edit is used?

Perhaps something like that.

Stepping back a bit and imagine a world where the sole purpose of
cherry-pick were to recreate the original commit as faithfully as
possible.  The commit log message would not be cleaned up in such
a case by default, and the users need cherrypick.cleanup setting
if they do not like that default.

The implementation of cherry-pick that does not spawn the editor
in that world would look like this:

    - read the cleanup mode from cherrypick.cleanup config; if there
      is none, read the cleanup mode from commit.cleanup config; if
      neither is defined, then use 'verbatim' as the default;

    - invoke "commit --cleanup=" + that mode from the command line
      to force the mode chosen by the above.

Thanks to the falling back to commit.cleanup, the above logic would
be usable even before we invent cherrypick.cleanup configuration,
i.e. in today's world.  If there is no commit.cleanup defined by the
user, the above logic would still use 'verbatim' as the default for
'cherry-pick', while using the 'default' for 'commit'.

When cherry-pick invokes the editor, then the first part would be
different.  So my conclusion would be something like:

    #if IN_THE_FUTURE
        if (config_exists(cherrypick.cleanup))
            mode = config_value(cherrypick.cleanup);
        else
    #endif
        if (config_exists(commit.cleanup))
            mode = config_value(commit.cleanup);
        else
            mode = editing ? 'verbatim' : 'default';

        invoke "commit --cleanup=" + mode;

perhaps?

  reply	other threads:[~2015-02-26 19:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-21 17:48 [BUG] git mangles up commit messages on rebase Christoph Anton Mitterer
2015-02-23 13:23 ` [PATCH] sequencer: preserve commit messages Michael J Gruber
2015-02-23 18:54   ` Junio C Hamano
2015-02-24 15:29     ` Michael J Gruber
2015-02-24 18:29       ` Junio C Hamano
2015-02-25  9:50         ` Michael J Gruber
2015-02-25 18:22           ` Junio C Hamano
2015-02-26 11:05             ` Michael J Gruber
2015-02-26 19:49               ` Junio C Hamano [this message]
2015-02-27 15:31                 ` Michael J Gruber
2015-02-27 18:31                   ` Junio C Hamano
2015-03-06 13:55                     ` [PATCHv2] " Michael J Gruber
2015-03-06 18:59                       ` Junio C Hamano
2015-02-25 13:44         ` [PATCH] " Christoph Anton Mitterer

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq61aomp1d.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=calestyo@scientia.net \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).