From patchwork Wed Dec 11 21:39:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11286493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F636138D for ; Wed, 11 Dec 2019 21:38:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E89920409 for ; Wed, 11 Dec 2019 21:38:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qeVyGhkV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbfLKViu (ORCPT ); Wed, 11 Dec 2019 16:38:50 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39872 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbfLKViu (ORCPT ); Wed, 11 Dec 2019 16:38:50 -0500 Received: by mail-pl1-f194.google.com with SMTP id o9so102751plk.6 for ; Wed, 11 Dec 2019 13:38:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=VsxbzYLhDZRSZ+Fo3WOQrsR4CSpk1RxBNFeG9cLOFB0=; b=qeVyGhkVeV2rE5uB4h5i94NANdzOYucqaFoeT0ztBRdzdqWRxIRT7KxzOr21NlaBt1 u0phw2DNPjXdd0i3PlSihDDy5Vzcdyl0VoPiRE3pqoc9PohB88oxNbdH/5/FFLhakZxi mjEZM/wGXMuCiwW/WJiqTHUE7vYLOZsLcN5zjWSWtyt0v5qi5YmENp5U5qOrrsFKbk6K E4nzDrSuVcumT5nNVKaM0ozRzlWFL24rkruS6MECOWyTryt7pB53KiI90h7ufkoXANJ8 1f5eVk/Db3anUMT0Syc94aiI65JqrFYgcJKhjt+ZNtCs1hnn4xb1nZbzS4r75PyYz+n/ 7eeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=VsxbzYLhDZRSZ+Fo3WOQrsR4CSpk1RxBNFeG9cLOFB0=; b=KzokeR9gFNUSLR9AzWUXkDRizfmuKKnlNFNdGbg3uN18tswnoP/mpY2NdYLes0VAX1 FagNt7wbPj8qyrsyeJlZ47YAJUoaoBayWvu+qiDOMWMdn5f3Q6z1PyFRgBFl8/kaC1nd vslMPZikwSWp/OfhDQovfIFzxfLqRaIl9Iwr6xdKx9IyJYp8IrbUv3337O6x317rFqNS F6R+E+ngjKi5jf0flj30M2+OtNp3wXlEZAgxW1l3wCRXN4s5W/8td4S0UWzZCuQpditF mWvJgUDHP8R/U4Hw7lJRLBDIKmb+5lgg/mmRKs08dhoJkyWcR5b13wdosg3NoKT3v5Cg HqGw== X-Gm-Message-State: APjAAAXpKRH0UFQdytLN1KAVc+yKNLetZaEMhviEr8UxzUxdQNDqXcOk lvLdYUvGRMnM9scPwvqQP+geLebK X-Google-Smtp-Source: APXvYqyHfTbMKsTpX9Ps5dpjUSkYt2E3okCJSbI2T8+YpUJ30PAuSCTIiCsI0G81XR+c/nDwh433iA== X-Received: by 2002:a17:902:d883:: with SMTP id b3mr5369497plz.231.1576100328842; Wed, 11 Dec 2019 13:38:48 -0800 (PST) Received: from generichostname ([204.14.239.53]) by smtp.gmail.com with ESMTPSA id o184sm3815024pgo.62.2019.12.11.13.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 13:38:47 -0800 (PST) Date: Wed, 11 Dec 2019 13:39:50 -0800 From: Denton Liu To: Git Mailing List , Paul Mackerras Subject: [PATCH] gitk: use --pretty=reference for copysummary Message-ID: MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.2 (2019-09-21) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 --- 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 } From patchwork Fri Dec 13 00:44:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11289647 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F27031593 for ; Fri, 13 Dec 2019 00:45:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFA5A227BF for ; Fri, 13 Dec 2019 00:45:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AQxs3xe0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731569AbfLMApF (ORCPT ); Thu, 12 Dec 2019 19:45:05 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:43682 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731461AbfLMApE (ORCPT ); Thu, 12 Dec 2019 19:45:04 -0500 Received: by mail-pl1-f194.google.com with SMTP id p27so444536pli.10 for ; Thu, 12 Dec 2019 16:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4z0GR/yASPvwbcxKex1C2iPKXZBBoD7dtW055fp7Ry0=; b=AQxs3xe0+UUKyWsPIIpptDPhCktlEjqPeB4/2cHuHJRMg+/v5iM+kw2eEpQBXNvh4P Cd3X2fhJ4fG5Cqab8uE9ruyob/HiPBjPg4J9NV2uVACJILKdZKnWM8w9tHmqO/943hOf tVu5aVmWu1OvxubiN7kS2rumSFBjPmGmDrXjiH1+f8To5xZepIvT3BJiJNY32iNRSazR Hco55SkWaJkpEPve/fMFBkAMpKpY1r+MlaPe/8bWVPm6gAIo9QCt4WAAshs7telAjsGT UXIWQPLi5SVpC/F/rmt+1XO7PYMbazHlUN4quJZxO94zbSABHMT6ZeV/SAYEmgHEIZ7k 3MRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4z0GR/yASPvwbcxKex1C2iPKXZBBoD7dtW055fp7Ry0=; b=cQgv2atz09L92aHuuwvOgGziBvuitZdaCwI/EpZsqL6RtTXaThbL2ncvUxSv14W8UH QlFWJ43XX/VYFfrrY1lHjBRJxj+KOqyQ3H91XtUSdlvRial0oviuZ9qXHLAoaa6B4V8T i3XUdOPnNTMzsVALlqRdLKZXTjT+zURV1XB/cp4x+wY8kUXm/eVxjhZ/K05AyDnZtcEz ErFlu1lnww/276xhobO3/LvOGYIcSW276CwlYdNFjkSr6gZYbJv1xxSJe19xg6C5adzT Yui1vhEnM4+gfQ+ygr0Nm0On8Bh0Kc7xC8lsMzBnEe85curw8HMiyUS2PgYtHlWwIygM gC3Q== X-Gm-Message-State: APjAAAWFIcDdtn0BTMEgd9MMSuMojrbDnE8sdevDJwyD61bbL8HJXbRr 0EPYnVBhC1eK3gAVPzKVLwleHbPe X-Google-Smtp-Source: APXvYqxUcsAybN3meoZTQIlMlfmE2llbkYV9Vi0yYu2hVaBatQtpkgyhmrsRbUXg0bji3rWJH471hg== X-Received: by 2002:a17:90a:a416:: with SMTP id y22mr13480733pjp.114.1576197903687; Thu, 12 Dec 2019 16:45:03 -0800 (PST) Received: from dentonliu-ltm.internal.salesforce.com ([204.14.239.53]) by smtp.gmail.com with ESMTPSA id g17sm8995626pfb.180.2019.12.12.16.45.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 16:45:03 -0800 (PST) From: Denton Liu To: Git Mailing List , Paul Mackerras Cc: Denton Liu , Beat Bolli Subject: [PATCH v2 2/2] gitk: rename "commit summary" to "commit reference" Date: Thu, 12 Dec 2019 16:44:50 -0800 Message-Id: <8691ed2b84f7ee6b7c12d04d57a541bf22660333.1576197846.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.1.664.g198078bb5a In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: 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 [dl: based the patch on gitk's tree] Signed-off-by: Denton Liu --- gitk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gitk b/gitk index d07e3302de..17346b4c5c 100755 --- a/gitk +++ b/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} @@ -9426,7 +9426,7 @@ proc mktaggo {} { mktagcan } -proc copysummary {} { +proc copyreference {} { global rowmenuid autosellen set format "%h (%s, %ad)" @@ -9434,10 +9434,10 @@ proc copysummary {} { 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 {} {