git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary
@ 2019-12-09 18:25 Beat Bolli
  2019-12-09 18:25 ` [PATCH 2/2] gitk: rename "commit summary" to "commit reference" Beat Bolli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Beat Bolli @ 2019-12-09 18:25 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras, Beat Bolli

Git learned the "reference" pretty format in 1f0fc1db85 (pretty:
implement 'reference' format, 2019-11-19). Use it also in gitk instead
of duplicating the format string. This way, gitk always follows the
formatting convention defined by git.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
Junio, this goes on top of dl/pretty-reference, currently in pu.

Thanks!

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

diff --git a/gitk-git/gitk b/gitk-git/gitk
index a14d7a16b2..cc89fb25d2 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -9392,8 +9392,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.23.0.13.gecf2037ff6


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

* [PATCH 2/2] gitk: rename "commit summary" to "commit reference"
  2019-12-09 18:25 [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary Beat Bolli
@ 2019-12-09 18:25 ` Beat Bolli
  2019-12-09 19:33 ` [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary Denton Liu
  2019-12-10  1:46 ` Junio C Hamano
  2 siblings, 0 replies; 4+ messages in thread
From: Beat Bolli @ 2019-12-09 18:25 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras, Beat Bolli

Now that the commit reference format has a canonical name, let's use this
name in gitk's UI and implementation.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
This commit is optional IMO, but I think it makes sense to use the same
words for the same things.

 gitk-git/gitk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index cc89fb25d2..72c7feec9a 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2640,7 +2640,7 @@ proc makewindow {} {
 	{mc "Diff selected -> this" command {diffvssel 1}}
 	{mc "Make patch" command mkpatch}
 	{mc "Create tag" command mktag}
-	{mc "Copy commit summary" command copysummary}
+	{mc "Copy commit reference" command copyreference}
 	{mc "Write commit to file" command writecommit}
 	{mc "Create new branch" command mkbranch}
 	{mc "Cherry-pick this commit" command cherrypick}
@@ -9389,17 +9389,17 @@ proc mktaggo {} {
     mktagcan
 }
 
-proc copysummary {} {
+proc copyreference {} {
     global rowmenuid autosellen
 
     set cmd [list git show -s --pretty=reference]
     if {$autosellen < 40} {
         lappend cmd --abbrev=$autosellen
     }
-    set summary [eval exec $cmd $rowmenuid]
+    set reference [eval exec $cmd $rowmenuid]
 
     clipboard clear
-    clipboard append $summary
+    clipboard append $reference
 }
 
 proc writecommit {} {
-- 
2.23.0.13.gecf2037ff6


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

* Re: [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary
  2019-12-09 18:25 [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary Beat Bolli
  2019-12-09 18:25 ` [PATCH 2/2] gitk: rename "commit summary" to "commit reference" Beat Bolli
@ 2019-12-09 19:33 ` Denton Liu
  2019-12-10  1:46 ` Junio C Hamano
  2 siblings, 0 replies; 4+ messages in thread
From: Denton Liu @ 2019-12-09 19:33 UTC (permalink / raw)
  To: Beat Bolli; +Cc: git, Paul Mackerras

Hi Beat,

On Mon, Dec 09, 2019 at 07:25:33PM +0100, Beat Bolli wrote:
> Git learned the "reference" pretty format in 1f0fc1db85 (pretty:
> implement 'reference' format, 2019-11-19). Use it also in gitk instead
> of duplicating the format string. This way, gitk always follows the
> formatting convention defined by git.
> 
> Signed-off-by: Beat Bolli <dev+git@drbeat.li>

Heh, I had the exact same patch queued up and ready to be sent[1].
However, I was waiting until the feature actually got merged into master
before pulling the trigger on sending it out because according to
howto/maintain-git.txt:

	* Being in the 'next' branch is not a guarantee for a topic to
	  be included in the next feature release.  Being in the
	  'master' branch typically is.

Feel free to steal parts (or all of) my commit message since I think it
goes into a bit more detail if you think it works better. Or if you
don't want to deal with the burden of fixing this patch, I'll send out
mine at a later time (whenever 'dl/pretty-reference' gets merged to
'master').

> ---
> Junio, this goes on top of dl/pretty-reference, currently in pu.

Since this is a patch for gitk, it should be sent to Paul Mackerras, who
is the maintanier of gitk.

> 
> Thanks!
> 
>  gitk-git/gitk | 3 +--

Also, It should be based on his subtree, i.e. the file change should say
gitk, not gitk-git/gitk. You can find the tip of his tree by fetching
git://ozlabs.org/~paulus/gitk.

Thanks,

Denton

[1]: https://github.com/Denton-L/git/commit/da9321b1bd56aafd16c8dcb99d5d628b79e2244e

>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index a14d7a16b2..cc89fb25d2 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -9392,8 +9392,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.23.0.13.gecf2037ff6
> 

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

* Re: [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary
  2019-12-09 18:25 [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary Beat Bolli
  2019-12-09 18:25 ` [PATCH 2/2] gitk: rename "commit summary" to "commit reference" Beat Bolli
  2019-12-09 19:33 ` [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary Denton Liu
@ 2019-12-10  1:46 ` Junio C Hamano
  2 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2019-12-10  1:46 UTC (permalink / raw)
  To: Beat Bolli; +Cc: git, Paul Mackerras

Beat Bolli <dev+git@drbeat.li> writes:

> Git learned the "reference" pretty format in 1f0fc1db85 (pretty:
> implement 'reference' format, 2019-11-19). Use it also in gitk instead
> of duplicating the format string. This way, gitk always follows the
> formatting convention defined by git.
>
> Signed-off-by: Beat Bolli <dev+git@drbeat.li>
> ---
> Junio, this goes on top of dl/pretty-reference, currently in pu.

Sorry, but it will not X-< for at least two reasons.

1. gitk is maintained as a separate project, so any patch to it will
   have to come via Paul's gitk tree where it has this script the
   patch touches at the root level of the working tree.  It will not
   build on top of any of the topic branches I keep track of.

2. In order to use "--pretty=ref" in gitk, of course, it must be
   used with version of Git that has dl/pretty-reference included,
   but gitk program is meant to be compatible with any reasonably
   recent version of Git (to put it differently, it is not a
   requirement to have git version X in order to use gitk version Y
   where Y <= X), so it means that this patch has to wait for a few
   releases after the version of Git that has the pretty-reference
   stuff ships.

I personally suspect that it no longer makes much sense to still
require gitk to be usable with older version of Git these days, even
though I do understand that the discipline to depend only on more
stable features that appeared in older releases probably was a good
one in earlier days.  But gitk is not my project, so until Paul
declares that gitk versions will go hand-in-hand with git, 2. above
holds.

Thanks.

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

end of thread, other threads:[~2019-12-10  1:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 18:25 [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary Beat Bolli
2019-12-09 18:25 ` [PATCH 2/2] gitk: rename "commit summary" to "commit reference" Beat Bolli
2019-12-09 19:33 ` [PATCH 1/2] gitk: use --pretty=reference to generate the commit summary Denton Liu
2019-12-10  1:46 ` 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).