git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Daniel Harding <dharding@living180.net>
Cc: Aaron Schrab <aaron@schrab.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v3] sequencer: use configured comment character
Date: Tue, 17 Jul 2018 18:46:03 +0200 (DST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1807171844040.71@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <66ce6f94-49ae-618e-bf6c-43a0f15bb752@living180.net>

Hi Daniel,

On Mon, 16 Jul 2018, Daniel Harding wrote:

> On Mon, 16 Jul 2018 at 18:59:03 +0300, Johannes Schindelin wrote:
> > 
> > On Mon, 16 Jul 2018, Aaron Schrab wrote:
> > >
> > > Looking into that a bit further, it does seem like my explanation above
> > > was incorrect.  Here's another attempt to explain why setting
> > > core.commentChar=auto isn't a problem for this change.
> > >
> > > 8< -----
> > >
> > > Use the configured comment character when generating comments about
> > > branches in a todo list.  Failure to honor this configuration causes a
> > > failure to parse the resulting todo list.
> > >
> > > Setting core.commentChar to "auto" will not be honored here, and the
> > > previously configured or default value will be used instead. But, since
> > > the todo list will consist of only generated content, there should not
> > > be any non-comment lines beginning with that character.
> > 
> > How about this instead?
> > 
> >  If core.commentChar is set to "auto", the intention is to
> >  determine the comment line character from whatever content is there
> >  already.
> > 
> >  As the code path in question is the one *generating* the todo list
> >  from scratch, it will automatically use whatever core.commentChar
> >  has been configured before the "auto" (and fall back to "#" if none
> >  has been configured explicitly), which is consistent with users'
> >  expectations.
> 
> Honestly, the above still doesn't read clearly to me.  I've take a stab at it
> myself - let me know what you think:
> 
>     If core.commentChar is set to "auto", the comment_line_char global
>     variable will be initialized to '#'.  The only time
>     comment_line_char gets changed to an automatic value is when the
>     prepare_to_commit() function (in commit.c) calls
>     adjust_comment_line_char().  This does not happen when generating
>     the todo list, so '#' will be used as the comment character in the
>     todo list if core.commentChar is set to "auto".

There is a concocted way to have core.commentChar = auto *and* to override
the comment char: if you use `git config --add core.commentChar auto`, or
if you have it set in $HOME/.gitconfig and in .git/config.

I tried to cover that in my suggestion, but that was probably trying to be
too precise, rather than being useful...

Ciao,
Johannes

      reply	other threads:[~2018-07-17 16:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-08 18:41 [PATCH 0/2] Fix --rebase-merges with custom commentChar Daniel Harding
2018-07-08 18:41 ` [PATCH 1/2] sequencer: fix " Daniel Harding
2018-07-08 18:41 ` [PATCH 2/2] t3430: update to test " Daniel Harding
2018-07-08 21:02   ` brian m. carlson
2018-07-09  7:52     ` Johannes Schindelin
2018-07-09 16:46       ` Junio C Hamano
2018-07-09 18:22       ` Daniel Harding
2018-07-09 19:09         ` Johannes Schindelin
2018-07-09 20:05         ` Junio C Hamano
2018-07-09 18:48     ` Daniel Harding
2018-07-09 19:14       ` Johannes Schindelin
2018-07-10 12:29         ` Daniel Harding
2018-07-10 13:08           ` Johannes Schindelin
2018-07-10 13:49             ` Daniel Harding
2018-10-02 14:38               ` Johannes Schindelin
2018-07-09 23:41       ` brian m. carlson
2018-07-09  7:53 ` [PATCH 0/2] Fix --rebase-merges " Johannes Schindelin
2018-07-10 13:24   ` Daniel Harding
2018-07-12  3:02     ` Aaron Schrab
2018-07-12 17:15       ` Junio C Hamano
2018-07-16  4:59         ` [PATCH v3] sequencer: use configured comment character Aaron Schrab
2018-07-16 15:59           ` Johannes Schindelin
2018-07-16 18:49             ` Daniel Harding
2018-07-17 16:46               ` Johannes Schindelin [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

  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=nycvar.QRO.7.76.6.1807171844040.71@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=aaron@schrab.com \
    --cc=dharding@living180.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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).