git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trailer: load config to handle core.commentChar
@ 2016-04-27 19:24 Rafal Klys
  2016-04-27 20:13 ` Christian Couder
  0 siblings, 1 reply; 4+ messages in thread
From: Rafal Klys @ 2016-04-27 19:24 UTC (permalink / raw)
  To: git; +Cc: Christian Couder, Rafal Klys

Add call to git_config(git_default_config, NULL) to update the
comment_char_line from default '#' to possible different value set in
core.commentChar.

Signed-off-by: Rafal Klys <rafalklys@wp.pl>
---
 trailer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/trailer.c b/trailer.c
index 8e48a5c..a3700b4 100644
--- a/trailer.c
+++ b/trailer.c
@@ -888,6 +888,9 @@ void process_trailers(const char *file, int in_place, int trim_empty, struct str
 	git_config(git_trailer_default_config, NULL);
 	git_config(git_trailer_config, NULL);
 
+	/* for core.commentChar */
+	git_config(git_default_config, NULL);
+
 	lines = read_input_file(file);
 
 	if (in_place)
-- 
2.8.1.68.g625efa9.dirty

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] trailer: load config to handle core.commentChar
  2016-04-27 19:24 [PATCH] trailer: load config to handle core.commentChar Rafal Klys
@ 2016-04-27 20:13 ` Christian Couder
  2016-04-27 20:31   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Couder @ 2016-04-27 20:13 UTC (permalink / raw)
  To: Rafal Klys; +Cc: git, Christian Couder

On Wed, Apr 27, 2016 at 9:24 PM, Rafal Klys <rafalklys@wp.pl> wrote:
> Add call to git_config(git_default_config, NULL) to update the
> comment_char_line from default '#' to possible different value set in
> core.commentChar.

It is "comment_line_char" not "comment_char_line", but otherwise you
can add "Reviewed-by: Christian Couder <chriscool@tuxfamily.org>".

Thanks!

> Signed-off-by: Rafal Klys <rafalklys@wp.pl>
> ---
>  trailer.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/trailer.c b/trailer.c
> index 8e48a5c..a3700b4 100644
> --- a/trailer.c
> +++ b/trailer.c
> @@ -888,6 +888,9 @@ void process_trailers(const char *file, int in_place, int trim_empty, struct str
>         git_config(git_trailer_default_config, NULL);
>         git_config(git_trailer_config, NULL);
>
> +       /* for core.commentChar */
> +       git_config(git_default_config, NULL);
> +
>         lines = read_input_file(file);
>
>         if (in_place)
> --
> 2.8.1.68.g625efa9.dirty
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] trailer: load config to handle core.commentChar
  2016-04-27 20:13 ` Christian Couder
@ 2016-04-27 20:31   ` Junio C Hamano
  2016-04-27 20:33     ` Eric Sunshine
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2016-04-27 20:31 UTC (permalink / raw)
  To: Christian Couder; +Cc: Rafal Klys, git, Christian Couder

Christian Couder <christian.couder@gmail.com> writes:

> On Wed, Apr 27, 2016 at 9:24 PM, Rafal Klys <rafalklys@wp.pl> wrote:
>> Add call to git_config(git_default_config, NULL) to update the
>> comment_char_line from default '#' to possible different value set in
>> core.commentChar.
>
> It is "comment_line_char" not "comment_char_line", but otherwise you
> can add "Reviewed-by: Christian Couder <chriscool@tuxfamily.org>".
>
> Thanks!
>
>> Signed-off-by: Rafal Klys <rafalklys@wp.pl>
>> ---
>>  trailer.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/trailer.c b/trailer.c
>> index 8e48a5c..a3700b4 100644
>> --- a/trailer.c
>> +++ b/trailer.c
>> @@ -888,6 +888,9 @@ void process_trailers(const char *file, int in_place, int trim_empty, struct str
>>         git_config(git_trailer_default_config, NULL);
>>         git_config(git_trailer_config, NULL);
>>
>> +       /* for core.commentChar */
>> +       git_config(git_default_config, NULL);
>> +

I can sort-of see why the original (logically) reads the
configuration files twice by making two separate calls to
git_config(), but I do not think we should add a third round like
this patch does.  Shouldn't git-trailer-default-config have a
fallthru call to git-default-config instead?

>>         lines = read_input_file(file);
>>
>>         if (in_place)
>> --
>> 2.8.1.68.g625efa9.dirty
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] trailer: load config to handle core.commentChar
  2016-04-27 20:31   ` Junio C Hamano
@ 2016-04-27 20:33     ` Eric Sunshine
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Sunshine @ 2016-04-27 20:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Christian Couder, Rafal Klys, git, Christian Couder

On Wed, Apr 27, 2016 at 4:31 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> On Wed, Apr 27, 2016 at 9:24 PM, Rafal Klys <rafalklys@wp.pl> wrote:
>>> Add call to git_config(git_default_config, NULL) to update the
>>> comment_char_line from default '#' to possible different value set in
>>> core.commentChar.
>>
>>> Signed-off-by: Rafal Klys <rafalklys@wp.pl>
>>> ---
>>>  trailer.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/trailer.c b/trailer.c
>>> index 8e48a5c..a3700b4 100644
>>> --- a/trailer.c
>>> +++ b/trailer.c
>>> @@ -888,6 +888,9 @@ void process_trailers(const char *file, int in_place, int trim_empty, struct str
>>>         git_config(git_trailer_default_config, NULL);
>>>         git_config(git_trailer_config, NULL);
>>>
>>> +       /* for core.commentChar */
>>> +       git_config(git_default_config, NULL);
>>> +
>
> I can sort-of see why the original (logically) reads the
> configuration files twice by making two separate calls to
> git_config(), but I do not think we should add a third round like
> this patch does.  Shouldn't git-trailer-default-config have a
> fallthru call to git-default-config instead?

Thanks, I was going to say the same thing.

Also, would it be possible to add a test?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-27 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-27 19:24 [PATCH] trailer: load config to handle core.commentChar Rafal Klys
2016-04-27 20:13 ` Christian Couder
2016-04-27 20:31   ` Junio C Hamano
2016-04-27 20:33     ` Eric Sunshine

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).