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

7 messages from 2008-11-25 to 2008-11-26. Participants: Nanako Shiraishi, Junio C Hamano, Jeff King, Santi Béjar, Jakub Narebski, David Brown.
Thread: https://gitlist.dev/t/16467

## Nanako Shiraishi, 2008-11-25 21:49

Subject: Extra pair of double quotes in "git commit" output?
Message-ID: <20081126064906.6117@nanako3.lavabit.com>
URL: https://gitlist.dev/e/20081126064906.6117%40nanako3.lavabit.com

```
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, 2008-11-25 22:02

Subject: Re: Extra pair of double quotes in "git commit" output?
Message-ID: <7vej0zjwgm.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vej0zjwgm.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20081126064906.6117@nanako3.lavabit.com>

```
Nanako Shiraishi <nanako3@lavabit.com> writes:

> 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, 2008-11-25 23:25

Subject: Re: Extra pair of double quotes in "git commit" output?
Message-ID: <20081125232521.GC30942@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20081125232521.GC30942%40coredump.intra.peff.net
In-Reply-To: <20081126064906.6117@nanako3.lavabit.com>

```
On Wed, Nov 26, 2008 at 06:49:06AM +0900, Nanako Shiraishi wrote:

> 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, 2008-11-26 00:06

Subject: Re: Extra pair of double quotes in "git commit" output?
Message-ID: <adf1fd3d0811251606t7f49eb84y53075427859bd26a@mail.gmail.com>
URL: https://gitlist.dev/e/adf1fd3d0811251606t7f49eb84y53075427859bd26a%40mail.gmail.com
In-Reply-To: <20081125232521.GC30942@coredump.intra.peff.net>

```
On Wed, Nov 26, 2008 at 12:25 AM, Jeff King <peff@peff.net> wrote:

[...]

>
> 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, 2008-11-26 13:34

Subject: Re: Extra pair of double quotes in "git commit" output?
Message-ID: <20081126133422.GA1761@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20081126133422.GA1761%40coredump.intra.peff.net
In-Reply-To: <adf1fd3d0811251606t7f49eb84y53075427859bd26a@mail.gmail.com>

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

-Peff

```

## Jakub Narebski, 2008-11-26 15:07

Subject: Re: Extra pair of double quotes in "git commit" output?
Message-ID: <ggjolt$t7t$1@ger.gmane.org>
URL: https://gitlist.dev/e/ggjolt%24t7t%241%40ger.gmane.org
In-Reply-To: <20081126133422.GA1761@coredump.intra.peff.net>

```
Jeff King wrote:
> 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, 2008-11-26 17:15

Subject: Re: Extra pair of double quotes in "git commit" output?
Message-ID: <20081126171540.GA21540@linode.davidb.org>
URL: https://gitlist.dev/e/20081126171540.GA21540%40linode.davidb.org
In-Reply-To: <20081126133422.GA1761@coredump.intra.peff.net>

```
On Wed, Nov 26, 2008 at 08:34:23AM -0500, Jeff King wrote:

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

```
