git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] sequencer: use configured comment character
@ 2018-06-28  2:04 Aaron Schrab
  2018-06-28  9:57 ` Johannes Schindelin
  2018-06-28 20:38 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Aaron Schrab @ 2018-06-28  2:04 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Schindelin

Use configured comment character when generating comments about branches
in an instruction sheet.  Failure to honor this configuration causes a
failure to parse the resulting instruction sheet.

Signed-off-by: Aaron Schrab <aaron@schrab.com>
---
 sequencer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sequencer.c b/sequencer.c
index 4034c0461b..caf91af29d 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3991,7 +3991,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
 		entry = oidmap_get(&state.commit2label, &commit->object.oid);
 
 		if (entry)
-			fprintf(out, "\n# Branch %s\n", entry->string);
+			fprintf(out, "\n%c Branch %s\n", comment_line_char, entry->string);
 		else
 			fprintf(out, "\n");
 
-- 
2.18.0.419.gfe4b301394


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

* Re: [PATCH] sequencer: use configured comment character
  2018-06-28  2:04 [PATCH] sequencer: use configured comment character Aaron Schrab
@ 2018-06-28  9:57 ` Johannes Schindelin
  2018-06-28 20:38 ` Junio C Hamano
  1 sibling, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2018-06-28  9:57 UTC (permalink / raw)
  To: Aaron Schrab; +Cc: git, Junio C Hamano

Hi Aaron,

On Wed, 27 Jun 2018, Aaron Schrab wrote:

> Use configured comment character when generating comments about branches
> in an instruction sheet.  Failure to honor this configuration causes a
> failure to parse the resulting instruction sheet.

Good catch.

Now, if you can refer to the "todo list" as "todo list" (or "todo script"
if you must) instead of an "instruction sheet", you have my ACK.

Ciao,
Johannes

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

* Re: [PATCH] sequencer: use configured comment character
  2018-06-28  2:04 [PATCH] sequencer: use configured comment character Aaron Schrab
  2018-06-28  9:57 ` Johannes Schindelin
@ 2018-06-28 20:38 ` Junio C Hamano
  2018-06-29 14:12   ` Johannes Schindelin
  1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2018-06-28 20:38 UTC (permalink / raw)
  To: Aaron Schrab; +Cc: git, Johannes Schindelin

Aaron Schrab <aaron@schrab.com> writes:

> Use configured comment character when generating comments about branches
> in an instruction sheet.  Failure to honor this configuration causes a
> failure to parse the resulting instruction sheet.
>
> Signed-off-by: Aaron Schrab <aaron@schrab.com>
> ---
>  sequencer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index 4034c0461b..caf91af29d 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -3991,7 +3991,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
>  		entry = oidmap_get(&state.commit2label, &commit->object.oid);
>  
>  		if (entry)
> -			fprintf(out, "\n# Branch %s\n", entry->string);
> +			fprintf(out, "\n%c Branch %s\n", comment_line_char, entry->string);
>  		else
>  			fprintf(out, "\n");

Would this interact OK with core.commentchar set to "auto"?

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

* Re: [PATCH] sequencer: use configured comment character
  2018-06-28 20:38 ` Junio C Hamano
@ 2018-06-29 14:12   ` Johannes Schindelin
  2018-06-29 15:56     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2018-06-29 14:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Aaron Schrab, git

Hi Junio,

On Thu, 28 Jun 2018, Junio C Hamano wrote:

> Aaron Schrab <aaron@schrab.com> writes:
> 
> > Use configured comment character when generating comments about branches
> > in an instruction sheet.  Failure to honor this configuration causes a
> > failure to parse the resulting instruction sheet.
> >
> > Signed-off-by: Aaron Schrab <aaron@schrab.com>
> > ---
> >  sequencer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/sequencer.c b/sequencer.c
> > index 4034c0461b..caf91af29d 100644
> > --- a/sequencer.c
> > +++ b/sequencer.c
> > @@ -3991,7 +3991,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
> >  		entry = oidmap_get(&state.commit2label, &commit->object.oid);
> >  
> >  		if (entry)
> > -			fprintf(out, "\n# Branch %s\n", entry->string);
> > +			fprintf(out, "\n%c Branch %s\n", comment_line_char, entry->string);
> >  		else
> >  			fprintf(out, "\n");
> 
> Would this interact OK with core.commentchar set to "auto"?

The idea of "auto" is:

	If set to "auto", `git-commit` would select a character that is not
	the beginning character of any line in existing commit messages.

As there are no pre-existing lines in that script (apart from the ones we
are about to add with the todo_help), the setting "auto" is pretty moot
and we will fall back to the default comment char (or, if there was a
previous core.commentChar that was parsed, that one).

In short: the code is fine, but yes, I had to convince myself by looking
through the code. (Hinting at a possible improvement of the commit
message.)

Ciao,
Dscho

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

* Re: [PATCH] sequencer: use configured comment character
  2018-06-29 14:12   ` Johannes Schindelin
@ 2018-06-29 15:56     ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2018-06-29 15:56 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Aaron Schrab, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> In short: the code is fine, but yes, I had to convince myself by looking
> through the code. (Hinting at a possible improvement of the commit
> message.)

Yup, that exactly was what I was hoping readers to realize.

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

end of thread, other threads:[~2018-06-29 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28  2:04 [PATCH] sequencer: use configured comment character Aaron Schrab
2018-06-28  9:57 ` Johannes Schindelin
2018-06-28 20:38 ` Junio C Hamano
2018-06-29 14:12   ` Johannes Schindelin
2018-06-29 15:56     ` Junio C Hamano

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