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

Re: [PATCH v2 1/2] gitk: drop quotes in copysummary format

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2019, 17:12 UTC
Message-ID
<xmqqfthom9p7.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<75dc131f0575cbe5d885af8897cbde054f7c07cf.1576197846.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 11 quoted lines
> In an earlier commit[1], git learned the 'reference' pretty format. This
> format was very similar to the format that copysummary used but it omits
> the quotes surrounding the commit's subject. Remove the quotes from the
> format in copysummary in order to match the 'reference' pretty format.
>
> It seems the consensus is that the unquoted form is used more often
> anyway[2] so this change should be acceptable.
>
> [These commits are in git.git.]
> [1]: 1f0fc1db85 (pretty: implement 'reference' format, 2019-11-19)
> [2]: fb2ffa77a6 (SubmittingPatches: remove dq from commit reference, 2019-11-19)
This change to gitk actually can easily be controversial.

The "used more often" census IIUC was done on _this_ project, and SubmittingPatches is merely a guideline to contribute to _this_ project, but the audience of gitk that wants to use the copysummary format is a lot wider than that.

This patch alone may not be worth sinking the time on for that reason.

Having said that, if we teach --pretty=reference to optionally use a custom format via a configuration variable, it would make quite a lot of sense to do an update _like_ this patch does to gitk. It would probably allow the code to read from the same configuration variable, instead of replacing a hardcoded format string with another hardcoded format string, though.

Thanks.
Show 18 quoted lines
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  gitk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gitk b/gitk
> index abe4805ade..d07e3302de 100755
> --- a/gitk
> +++ b/gitk
> @@ -9429,7 +9429,7 @@ proc mktaggo {} {
>  proc copysummary {} {
>      global rowmenuid autosellen
>  
> -    set format "%h (\"%s\", %ad)"
> +    set format "%h (%s, %ad)"
>      set cmd [list git show -s --pretty=format:$format --date=short]
>      if {$autosellen < 40} {
>          lappend cmd --abbrev=$autosellen
Previous: Denton LiuNext: Paul Mackerras
Message 6 of 11 in “gitk: use --pretty=reference for copysummary”
  1. gitk: use --pretty=reference for copysummaryDenton Liu, Dec 11, 2019
  2. Paul MackerrasDec 11, 2019
  3. Junio C HamanoDec 11, 2019
  4. 0/2 gitk: match Git's 'reference' pretty formatDenton Liu, Dec 13, 2019
  5. 1/2 gitk: drop quotes in copysummary formatDenton Liu, Dec 13, 2019
  6. Junio C HamanoDec 13, 2019
  7. Paul MackerrasDec 15, 2019
  8. 2/2 gitk: rename "commit summary" to "commit reference"Denton Liu, Dec 13, 2019
  9. Junio C HamanoDec 13, 2019
  10. Paul MackerrasDec 15, 2019
  11. Junio C HamanoDec 13, 2019

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.