git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitk: use --pretty=reference for copysummary
@ 2019-12-11 21:39 Denton Liu
  2019-12-11 21:58 ` Paul Mackerras
  2019-12-13  0:44 ` [PATCH v2 0/2] gitk: match Git's 'reference' pretty format Denton Liu
  0 siblings, 2 replies; 11+ messages in thread
From: Denton Liu @ 2019-12-11 21:39 UTC (permalink / raw)
  To: Git Mailing List, Paul Mackerras

In an earlier commit[1], git learned the 'reference' pretty format.
Update copysummary to use this pretty format instead of manually
reimplementing it as a format string.

With this change, we lose the double-quotes surrounding the commit
subject but it seems the consensus is that the unquoted form is used
more often anyway[2] so this change should be acceptable.

Since gitk and git are usually packaged and distributed together, their
versions should be in sync so we should not have to worry a newer gitk
running on top of an older version of git that doesn't support the
'reference' pretty format.

[1]: 1f0fc1db85 (pretty: implement 'reference' format, 2019-11-19)
[2]: fb2ffa77a6 (SubmittingPatches: remove dq from commit reference, 2019-11-19)

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
Beat Bolli sent a series out earlier that did the exact same thing[3].
Since they haven't replied yet, I'll send out the version that I've been
cooking for a while now since I think the commit message looks a bit
better too and also it's based on top of Paul's tree.

[3]: https://lore.kernel.org/git/20191209182534.309884-1-dev+git@drbeat.li/

 gitk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gitk b/gitk
index abe4805ade..8bf198e338 100755
--- a/gitk
+++ b/gitk
@@ -9429,8 +9429,7 @@ proc mktaggo {} {
 proc copysummary {} {
     global rowmenuid autosellen
 
-    set format "%h (\"%s\", %ad)"
-    set cmd [list git show -s --pretty=format:$format --date=short]
+    set cmd [list git show -s --pretty=reference]
     if {$autosellen < 40} {
         lappend cmd --abbrev=$autosellen
     }
-- 
2.24.0.627.geba02921db


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-12-15  5:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 21:39 [PATCH] gitk: use --pretty=reference for copysummary Denton Liu
2019-12-11 21:58 ` Paul Mackerras
2019-12-11 22:05   ` Junio C Hamano
2019-12-13  0:44 ` [PATCH v2 0/2] gitk: match Git's 'reference' pretty format Denton Liu
2019-12-13  0:44   ` [PATCH v2 1/2] gitk: drop quotes in copysummary format Denton Liu
2019-12-13 17:12     ` Junio C Hamano
2019-12-15  4:19     ` Paul Mackerras
2019-12-13  0:44   ` [PATCH v2 2/2] gitk: rename "commit summary" to "commit reference" Denton Liu
2019-12-13 17:12     ` Junio C Hamano
2019-12-15  4:36     ` Paul Mackerras
2019-12-13 17:04   ` [PATCH v2 0/2] gitk: match Git's 'reference' pretty format Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).