threads / patch / 17258

patchcommit: more compact summary and without extra quotes

Subject: [PATCH] commit: more compact summary and without extra quotes

## tl;dr

8 messages between Jan 19, 2009 and Jan 20, 2009. Diffs are folded; open one to read it.

replies: 7people: 4as markdown or json

Santi Béjar· Jan 19, 2009, 22:45 UTC · lore

Original: [master]: created d9a5491: "foo:bar"

While with the patch it becomes: [master d9a5491] foo:bar

As discussed in the git mailing list:
http://marc.info/?l=git&m=122765031208922&w=2
Signed-off-by: Santi Béjar <santi@agolina.net>
---
 builtin-commit.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Show changes to builtin-commit.c +2 −2
diff --git a/builtin-commit.c b/builtin-commit.c
index 2f0b00a..b159af2 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -883,7 +883,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
 {
 	struct rev_info rev;
 	struct commit *commit;
-	static const char *format = "format:%h: \"%s\"";
+	static const char *format = "format:%h] %s";
 	unsigned char junk_sha1[20];
 	const char *head = resolve_ref("HEAD", junk_sha1, 0, NULL);
 
@@ -910,7 +910,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
 	rev.diffopt.break_opt = 0;
 	diff_setup_done(&rev.diffopt);
 
-	printf("[%s%s]: created ",
+	printf("[%s%s ",
 		!prefixcmp(head, "refs/heads/") ?
 			head + 11 :
 			!strcmp(head, "HEAD") ?
-- 
1.6.1.258.g7ff14
Johannes Schindelin· Jan 19, 2009, 23:46 UTC · re: Santi Béjar · lore

Re: [PATCH] commit: more compact summary and without extra quotes

Hi,
On Mon, 19 Jan 2009, Santi Béjar wrote:
Show 5 quoted lines
> Original:
> [master]: created d9a5491: "foo:bar"
> 
> While with the patch it becomes:
> [master d9a5491] foo:bar

Maybe you want to mention that it saves screen estate. After all, the commit message is _the_ place to relate your motivation to the gentle reader.

Show 6 quoted lines
> As discussed in the git mailing list:
> 
> http://marc.info/?l=git&m=122765031208922&w=2
> 
> Signed-off-by: Santi Béjar <santi@agolina.net>
> ---

You really want to move the link after the ---. I often read commit messages off-line, and let me tell you: I am not really happy reading links then. Not at all.

Ciao, Dscho

Santi Béjar· Jan 20, 2009, 00:00 UTC · re: Johannes Schindelin · lore

Re: [PATCH] commit: more compact summary and without extra quotes

2009/1/20 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
Show 13 quoted lines
> Hi,
>
> On Mon, 19 Jan 2009, Santi Béjar wrote:
>
>> Original:
>> [master]: created d9a5491: "foo:bar"
>>
>> While with the patch it becomes:
>> [master d9a5491] foo:bar
>
> Maybe you want to mention that it saves screen estate.  After all, the
> commit message is _the_ place to relate your motivation to the gentle
> reader.
I thought it was enough with the "more compact" in the title line.
Show 11 quoted lines
>
>> As discussed in the git mailing list:
>>
>> http://marc.info/?l=git&m=122765031208922&w=2
>>
>> Signed-off-by: Santi Béjar <santi@agolina.net>
>> ---
>
> You really want to move the link after the ---.  I often read commit
> messages off-line, and let me tell you: I am not really happy reading
> links then.  Not at all.
OK, less work for me :-)
Santi
Junio C Hamano· Jan 20, 2009, 03:49 UTC · re: Santi Béjar · lore

Re: [PATCH] commit: more compact summary and without extra quotes

Santi Béjar <santi@agolina.net> writes:
Show 12 quoted lines
>>> As discussed in the git mailing list:
>>>
>>> http://marc.info/?l=git&m=122765031208922&w=2
>>>
>>> Signed-off-by: Santi Béjar <santi@agolina.net>
>>> ---
>>
>> You really want to move the link after the ---.  I often read commit
>> messages off-line, and let me tell you: I am not really happy reading
>> links then.  Not at all.
>
> OK, less work for me :-)

I do not mind URL in the commit log; it would help me or other forgetful people three months from now if we need to go back to the original discussion.

I however agree with Dscho that it is irritating when somebody uses URL to avoid summarizing the issue himself. If somebody cares enough and understands the issues discussed at URL to come up with a patch that is worth applying, he surely should be able to summarize the primary idea and issues involved in a few paragraphs.

A summary of discussion in addition to URL would save everybody's time.
Johannes Schindelin· Jan 20, 2009, 10:10 UTC · re: Junio C Hamano · lore

Re: [PATCH] commit: more compact summary and without extra quotes

Hi,
On Mon, 19 Jan 2009, Junio C Hamano wrote:
Show 5 quoted lines
> Santi Béjar <santi@agolina.net> writes:
> 
> > OK, less work for me :-)
> 
> A summary of discussion in addition to URL would save everybody's time.

As Santi pointed out, not his time. And I almost feared that he was comfortable with the overall time-balance weighing dramatically in his favor.

Ciao, Dscho

Santi Béjar· Jan 20, 2009, 10:29 UTC · re: Johannes Schindelin · lore

Re: [PATCH] commit: more compact summary and without extra quotes

2009/1/20 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
Show 13 quoted lines
> Hi,
>
> On Mon, 19 Jan 2009, Junio C Hamano wrote:
>
>> Santi Béjar <santi@agolina.net> writes:
>>
>> > OK, less work for me :-)
>>
>> A summary of discussion in addition to URL would save everybody's time.
>
> As Santi pointed out, not his time.  And I almost feared that he was
> comfortable with the overall time-balance weighing dramatically in his
> favor.

No, I'm not comfortable. I don't like wasting other's time. It was an unfortunate comment from my part (I thought you were saying just remove or put it after the ---).

Santi
Jeff King· Jan 20, 2009, 04:14 UTC · re: Santi Béjar · lore

Re: [PATCH] commit: more compact summary and without extra quotes

On Mon, Jan 19, 2009 at 11:45:16PM +0100, Santi Béjar wrote:
Show 9 quoted lines
> Original:
> [master]: created d9a5491: "foo:bar"
> 
> While with the patch it becomes:
> [master d9a5491] foo:bar
> 
> As discussed in the git mailing list:
> 
> http://marc.info/?l=git&m=122765031208922&w=2

I agree with Junio that the URL is fine, but it should not _replace_ a summary of the issue. But as for the patch itself, I think it is sensible (and I remember wondering at some point what had become of your proposal, since everybody seemed to like it).

-Peff
Junio C Hamano· Jan 20, 2009, 07:04 UTC · re: Santi Béjar · lore

Re: [PATCH] commit: more compact summary and without extra quotes

I've updated the log message, so there is no need to resend. I suspect that documentation/tutorial needs updating after this one.

Will apply to 'master'.  Thanks.

← back to recent threads