threads / discuss / 16467

Extra pair of double quotes in "git commit" output?

Subject: Extra pair of double quotes in "git commit" output?

## tl;dr

7 messages between Nov 25, 2008 and Nov 26, 2008.

replies: 6people: 6as markdown or json

Nanako Shiraishi· Nov 25, 2008, 21:49 UTC · lore
While I think the way recent "git commit" displays the commit you just created is very helpful, I often find the double quotes around the message unnecessary and sometimes even confusing.  I just made a commit and saw this message:
    [master]: created d9a5491: "Show "standard deviation" column in table 3"
The colon after the shortened commit SHA1 is enough to signal that it will talk about a different piece of information on the rest of the line.  I think the extra double quotes can be dropped safely:
    [master]: created d9a5491: Show "standard deviation" column in table 3
and it will make the output shorter by two columns, more pretty, and does not lose the clarity.
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Junio C Hamano· Nov 25, 2008, 22:02 UTC · re: Nanako Shiraishi · lore

Re: Extra pair of double quotes in "git commit" output?

Nanako Shiraishi <nanako3@lavabit.com> writes:
Show 9 quoted lines
> While I think the way recent "git commit" displays the commit you just created is very helpful, I often find the double quotes around the message unnecessary and sometimes even confusing.  I just made a commit and saw this message:
>
>     [master]: created d9a5491: "Show "standard deviation" column in table 3"
>
> The colon after the shortened commit SHA1 is enough to signal that it will talk about a different piece of information on the rest of the line.  I think the extra double quotes can be dropped safely:
>
>     [master]: created d9a5491: Show "standard deviation" column in table 3
>
> and it will make the output shorter by two columns, more pretty, and does not lose the clarity.
[offtopic.  Please wrap your text at a reasonable width around 70 columns]
Like this?

It might break some existing tests (I didn't check), but I think that is a sensible thing to do.

 builtin-commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git c/builtin-commit.c w/builtin-commit.c
index 591d16b..654bfbe 100644
--- c/builtin-commit.c
+++ w/builtin-commit.c
@@ -881,7 +881,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);
 
Jeff King· Nov 25, 2008, 23:25 UTC · re: Nanako Shiraishi · lore

Re: Extra pair of double quotes in "git commit" output?

On Wed, Nov 26, 2008 at 06:49:06AM +0900, Nanako Shiraishi wrote:
Show 6 quoted lines
> While I think the way recent "git commit" displays the commit you just
> created is very helpful, I often find the double quotes around the
> message unnecessary and sometimes even confusing.  I just made a
> commit and saw this message:
> 
>     [master]: created d9a5491: "Show "standard deviation" column in table 3"

While I do think that typographically the embedded quotes look awful, I find that the quotes do help separate the commit subject from the other text when there are colons in the subject. IOW, I think that

  [master]: created d9a5491: foo: bar
is harder to read than
  [master]: created d9a5491: "foo: bar"

And 47% of commits in git.git have a colon (only 7% have a double quote).

So I sympathize with the desire to remove the quotes, as they look bad and are obviously not too rare. But I'd like to find a solution which maintains a better visual separation between the subject and the other text than simply removing them.

-Peff
Santi Béjar· Nov 26, 2008, 00:06 UTC · re: Jeff King · lore

Re: Extra pair of double quotes in "git commit" output?

On Wed, Nov 26, 2008 at 12:25 AM, Jeff King <peff@peff.net> wrote:
[...]
Show 5 quoted lines
>
> So I sympathize with the desire to remove the quotes, as they look bad
> and are obviously not too rare. But I'd like to find a solution which
> maintains a better visual separation between the subject and the other
> text than simply removing them.
Maybe just use the output of "git branch -v":
master d9a5491 foo: bar
or even literally:
* master d9a5491 [ahead 1] foo: bar
or to make the separation more evident:
[master d9a5491] foo: bar
Santi
Jeff King· Nov 26, 2008, 13:34 UTC · re: Santi Béjar · lore

Re: Extra pair of double quotes in "git commit" output?

On Wed, Nov 26, 2008 at 01:06:34AM +0100, Santi Béjar wrote:
Show 11 quoted lines
> Maybe just use the output of "git branch -v":
> 
> master d9a5491 foo: bar
> 
> or even literally:
> 
> * master d9a5491 [ahead 1] foo: bar
> 
> or to make the separation more evident:
> 
> [master d9a5491] foo: bar

Out of those suggestions, I find only the final one aesthetically acceptable. Nobody else has weighed in, so maybe they don't care. Or maybe they are just on vacation due to the (American) holiday.

-Peff
Jakub Narebski· Nov 26, 2008, 15:07 UTC · re: Jeff King · lore

Re: Extra pair of double quotes in "git commit" output?

Jeff King wrote:
Show 17 quoted lines
> On Wed, Nov 26, 2008 at 01:06:34AM +0100, Santi Béjar wrote:
> 
>> Maybe just use the output of "git branch -v":
>> 
>> master d9a5491 foo: bar
>> 
>> or even literally:
>> 
>> * master d9a5491 [ahead 1] foo: bar
>> 
>> or to make the separation more evident:
>> 
>> [master d9a5491] foo: bar
> 
> Out of those suggestions, I find only the final one aesthetically
> acceptable. Nobody else has weighed in, so maybe they don't care. Or
> maybe they are just on vacation due to the (American) holiday.
+1 for the last one.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
David Brown· Nov 26, 2008, 17:15 UTC · re: Jeff King · lore

Re: Extra pair of double quotes in "git commit" output?

On Wed, Nov 26, 2008 at 08:34:23AM -0500, Jeff King wrote:
Show 7 quoted lines
>> or to make the separation more evident:
>> 
>> [master d9a5491] foo: bar
>
>Out of those suggestions, I find only the final one aesthetically
>acceptable. Nobody else has weighed in, so maybe they don't care. Or
>maybe they are just on vacation due to the (American) holiday.

Color certainly works well in the cases where that is available. Otherwise, I prefer the above solution.

David

← back to recent threads