git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] gitk: align the commit summary format to the documentation

From
Jeff King <peff@peff.net>
Date
Aug 29, 2016, 18:30 UTC
Message-ID
<20160829183015.2uqnfezekjfa3ott@sigill.intra.peff.net>
In-Reply-To
<xmqqpoorbftc.fsf@gitster.mtv.corp.google.com>
On Mon, Aug 29, 2016 at 11:17:19AM -0700, Junio C Hamano wrote:
Show 23 quoted lines
> > While it may be easier to read due to the extra mark-up, the resulting
> > text where such a quotation appears does not flow well, IMO. A commit
> > message text that references another commit reads more fluently
> > without the quotes around the summary line because the quoted text is
> > not so much a quotation that must be marked, but a parenthetical
> > statement.
> >
> > I absolutely welcome the proposed change to gitk, because I always
> > edit out the double-quotes.
> 
> I think that is highly subjective, and as you very well may know,
> I've been referring to commits without double-quote pair, and have
> an obvious bias for something I am used to ;-)
> 
> I do not see the "" as introducing a quotation.  I just view it as
> very similar to the "" in the following sentence:
> 
>     The commit whose title is "foo bar" did not consider there is
>     also need to consider baz.
> 
> The whole thing is inside () pair, so I agree that with or without
> "" pair, it is possible to see where the title ends.  So I do not
> have a strong opinion either way.

I have an alias which produces similar output, without the double-quotes (probably because I stole it from you originally).

I have noticed over the years that the output is occasionally ugly when the commit names have parentheses themselves. E.g.:

  $ git config alias.ll
  !git --no-pager log -1 --pretty='tformat:%h (%s, %ad)' --date=short
  $ git ll 7e97e10
  7e97e10 (die(_("BUG")): avoid translating bug messages, 2016-07-26)
  $ git ll fa90ab4
  fa90ab4 (t3404: fix a grammo (commands are ran -> commands are run), 2016-06-29)

Adding quotes can help with that. OTOH, I think it just introduces the same problem with a different character. E.g.:

  $ git ll be00b57
  be00b57 (provide an initializer for "struct object_info", 2016-08-11)
  $ git llq be00b57
  be00b57 ("provide an initializer for "struct object_info"", 2016-08-11)

Perhaps one could write a script to find a custom pretty non-conflicting delimiter for each case, but I don't know if it's worth the effort. :)

-Peff
Previous: Junio C Hamano
Message 12 of 12 in “gitk: align the commit summary format to the documentation”
  1. 1/2 gitk: align the commit summary format to the documentationBeat Bolli, Aug 26, 2016
  2. 2/2 SubmittingPatches: hint at gitk's "Copy commit summary" commandBeat Bolli, Aug 26, 2016
  3. Junio C HamanoAug 26, 2016
  4. Jacob KellerAug 27, 2016
  5. Junio C HamanoAug 26, 2016
  6. Stefan BellerAug 26, 2016
  7. Beat BolliAug 26, 2016
  8. Junio C HamanoAug 26, 2016
  9. Stefan BellerAug 26, 2016
  10. Johannes SixtAug 27, 2016
  11. Junio C HamanoAug 29, 2016
  12. Jeff KingAug 29, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.