git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: git@vger.kernel.org, masahiroy@kernel.org
Subject: Re: 'git interpret-trailers' is tripped by comment characters other than '#'
Date: Fri, 14 Jun 2019 11:07:58 -0400	[thread overview]
Message-ID: <20190614150758.GA22984@sigill.intra.peff.net> (raw)
In-Reply-To: <CAK7LNAR=KhTZRFFXTbcZwe-+65fGnVB7NbmVbQ7ymbmChDuhAg@mail.gmail.com>

On Fri, Jun 14, 2019 at 08:35:04PM +0900, Masahiro Yamada wrote:

> Perhaps, 'git interpret-trailers' should be changed
> to recognize core.commentChar ?

It looks like the trailer code does respect it, but the
interpret-trailers program never loads the config. Does the patch below
make your problem go away?

diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
index 8ae40dec47..f101d092b8 100644
--- a/builtin/interpret-trailers.c
+++ b/builtin/interpret-trailers.c
@@ -10,6 +10,7 @@
 #include "parse-options.h"
 #include "string-list.h"
 #include "trailer.h"
+#include "config.h"
 
 static const char * const git_interpret_trailers_usage[] = {
 	N_("git interpret-trailers [--in-place] [--trim-empty] [(--trailer <token>[(=|:)<value>])...] [<file>...]"),
@@ -112,6 +113,8 @@ int cmd_interpret_trailers(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 
+	git_config(git_default_config, NULL);
+
 	argc = parse_options(argc, argv, prefix, options,
 			     git_interpret_trailers_usage, 0);
 

I do wonder if the trailer code is correct to always respect it, though.
For example, in "git log" output we'd expect to see commit messages from
people with all sorts of config. I suppose the point is that their
comment characters wouldn't make it into the commit object at all, so
the right answer there is probably not to look for comment characters at
all.

-Peff

  reply	other threads:[~2019-06-14 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 11:35 'git interpret-trailers' is tripped by comment characters other than '#' Masahiro Yamada
2019-06-14 15:07 ` Jeff King [this message]
2019-06-15  8:41   ` Christian Couder
2019-06-17  4:32     ` Masahiro Yamada
2019-06-17  5:03       ` Christian Couder
2019-06-17 17:31         ` Junio C Hamano
2019-06-17 20:07           ` Christian Couder
2019-06-18  2:41             ` Masahiro Yamada
2019-06-19  3:37     ` [PATCH] interpret-trailers: load default config Jeff King
2019-06-19 14:24       ` Junio C Hamano
2019-06-19 17:47         ` Jeff King
2019-06-19 15:52       ` Masahiro Yamada
2019-06-17  4:32   ` 'git interpret-trailers' is tripped by comment characters other than '#' Masahiro Yamada

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=20190614150758.GA22984@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=yamada.masahiro@socionext.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).