git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Ralf Thielow <ralf.thielow@gmail.com>,
	Taufiq Hoven <taufiq.hoven@gmail.com>
Subject: Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto
Date: Tue, 22 Nov 2016 17:31:43 +0700	[thread overview]
Message-ID: <CACsJy8D0uDs8vZgOZ0HkJS7wOuc7TPU9xcB8BTWNsa11At04Ug@mail.gmail.com> (raw)
In-Reply-To: <9ef529a4fbb60990a91d7bbfdd49c6d20d49e442.1479737858.git.johannes.schindelin@gmx.de>

On Mon, Nov 21, 2016 at 9:18 PM, Johannes Schindelin
<johannes.schindelin@gmx.de> wrote:
> When 84c9dc2 (commit: allow core.commentChar=auto for character auto
> selection, 2014-05-17) extended the core.commentChar functionality to
> allow for the value 'auto', it forgot that rebase -i was already taught to
> handle core.commentChar,

I think this is 180bad3 (rebase -i: respect core.commentchar -
2013-02-11) and a couple followup fixes. My bad.

> and in turn forgot to let rebase -i handle that
> new value gracefully.
>
> Reported by Taufiq Hoven.

Another report in the same area: a merge conflict always writes the
"Conflicts:" section in the commit message with '#' as comment char
when core.commentChar is auto. I've known this for a while, but it has
not bitten me hard enough to do something about it,

>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  git-rebase--interactive.sh    | 13 +++++++++++--
>  t/t3404-rebase-interactive.sh |  2 +-
>  2 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index ca994c5..6bb740c 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -93,8 +93,17 @@ eval '
>  GIT_CHERRY_PICK_HELP="$resolvemsg"
>  export GIT_CHERRY_PICK_HELP
>
> -comment_char=$(git config --get core.commentchar 2>/dev/null | cut -c1)
> -: ${comment_char:=#}
> +comment_char=$(git config --get core.commentchar 2>/dev/null)
> +case "$comment_char" in
> +''|auto)
> +       comment_char=#

My first thought was "this kinda defeats the purpose of auto, doesn't
it". But 'auto' here is irrelevant because we control the leading
character of all lines in the todo file. 'auto' makes little sense in
this context, falling back to any comment char would do.

So, ack (after you fix the $(comment_char other people have mentioned,
of course).
-- 
Duy

  parent reply	other threads:[~2016-11-22 10:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 14:18 [PATCH 0/3] Fix problems with rebase -i when core.commentchar is defined Johannes Schindelin
2016-11-21 14:18 ` [PATCH 1/3] rebase -i: identify problems with core.commentchar Johannes Schindelin
2016-11-21 18:15   ` Junio C Hamano
2016-11-21 18:24     ` Junio C Hamano
2016-11-21 19:05       ` [PATCH 1/3] rebase -i: highlight " Junio C Hamano
2016-11-21 19:05         ` [PATCH 2/3] stripspace: respect repository config Junio C Hamano
2016-11-21 20:28           ` Junio C Hamano
2016-11-22 16:11           ` Johannes Schindelin
2016-11-21 19:05         ` [PATCH 3/3] rebase -i: handle core.commentChar=auto Junio C Hamano
2016-11-21 20:29           ` Junio C Hamano
2016-11-21 20:25         ` [PATCH 1/3] rebase -i: highlight problems with core.commentchar Junio C Hamano
2016-11-22 16:09         ` Johannes Schindelin
2016-11-22 17:05           ` Junio C Hamano
2016-11-23 11:05             ` Johannes Schindelin
2016-11-21 18:49     ` [PATCH 1/3] rebase -i: identify " Jeff King
2016-11-21 19:12       ` Junio C Hamano
2016-11-21 23:38         ` Jeff King
2016-11-22 16:09     ` Johannes Schindelin
2016-11-21 14:18 ` [PATCH 2/3] stripspace: respect repository config Johannes Schindelin
2016-11-22 10:10   ` Duy Nguyen
2016-11-22 16:13     ` Johannes Schindelin
2016-11-22 17:10       ` Junio C Hamano
2016-11-22 19:10         ` Junio C Hamano
2016-11-22 19:50           ` Jeff King
2016-11-22 20:24             ` Junio C Hamano
2016-11-22 21:19               ` Jeff King
2016-11-22 21:22                 ` Junio C Hamano
2016-11-22 21:43                   ` Jeff King
2016-11-22 21:55                     ` Junio C Hamano
2016-11-23  0:12                       ` Jeff King
2016-11-22 21:24                 ` Jeff King
2016-11-21 14:18 ` [PATCH 3/3] rebase -i: handle core.commentChar=auto Johannes Schindelin
2016-11-21 18:26   ` Johannes Sixt
2016-11-21 18:40     ` Junio C Hamano
2016-11-21 18:58       ` Johannes Sixt
2016-11-21 19:07         ` Junio C Hamano
2016-11-21 19:14           ` Johannes Sixt
2016-11-22 16:04     ` Johannes Schindelin
2016-11-22 10:31   ` Duy Nguyen [this message]
2016-11-21 16:58 ` [PATCH 0/3] Fix problems with rebase -i when core.commentchar is defined Jacob Keller

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=CACsJy8D0uDs8vZgOZ0HkJS7wOuc7TPU9xcB8BTWNsa11At04Ug@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=ralf.thielow@gmail.com \
    --cc=taufiq.hoven@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).