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

Re: [PATCH 2/2] gitk: add an option to run gitk on an item in the file list

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
May 8, 2018, 13:17 UTC
Message-ID
<CAKPyHN3YMU3oZaW-wR2ZMV6aMwoeFGMmiJBQXtvipVvkWPLZVQ@mail.gmail.com>
In-Reply-To
<20180508122256.nyv6ddcoifygfpk4@pflmari>

On Tue, May 8, 2018 at 2:22 PM, Alex Riesen <alexander.riesen@cetitec.com> wrote:

Show 30 quoted lines
> From: Alex Riesen <raa.lkml@gmail.com>
>
> Similar to a git gui feature which visualizes history in a submodule,
> the submodules cause the gitk be started inside the submodule.
>
> Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
> ---
>  gitk | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/gitk b/gitk
> index d34833f..1ec545e 100755
> --- a/gitk
> +++ b/gitk
> @@ -2682,6 +2682,7 @@ proc makewindow {} {
>         {mc "External diff" command {external_diff}}
>         {mc "Blame parent commit" command {external_blame 1}}
>         {mc "Copy path" command {clipboard clear; clipboard append $flist_menu_file}}
> +       {mc "Run gitk on this" command {flist_gitk}}
>      }
>      $flist_menu configure -tearoff 0
>
> @@ -3555,6 +3556,17 @@ proc flist_hl {only} {
>      set gdttype [mc "touching paths:"]
>  }
>
> +proc flist_gitk {} {
> +    global flist_menu_file findstring gdttype
> +
> +    set x [shellquote $flist_menu_file]

this needs to handle cdup, i.e., if gitk is run from a subdirectory, all paths needs to be prefixed with $cdup, like: [file join $cdup $flist_menu_file]

Bert
Show 10 quoted lines
> +    if {[file isdirectory $flist_menu_file]} {
> +       exec sh -c "cd $x&&gitk" &
> +    } else {
> +       exec gitk -- $x &
> +    }
> +}
> +
>  proc gitknewtmpdir {} {
>      global diffnum gitktmpdir gitdir env
>
Previous: Alex RiesenNext: Alex Riesen
Message 6 of 15 in “gitk: improve handling of submodules in the file list panel”
  1. 0/2 gitk: improve handling of submodules in the file list panelAlex Riesen, May 8, 2018
  2. 1/2 gitk: show part of submodule log instead of empty pane when listing treesAlex Riesen, May 8, 2018
  3. Stefan BellerMay 8, 2018
  4. Alex RiesenMay 9, 2018
  5. 2/2 gitk: add an option to run gitk on an item in the file listAlex Riesen, May 8, 2018
  6. Bert WesargMay 8, 2018
  7. Alex RiesenMay 8, 2018
  8. Bert WesargMay 9, 2018
  9. gitk: do not limit tree mode listing in the file list panel to current sub-directoryAlex Riesen, May 9, 2018
  10. Bert WesargMay 9, 2018
  11. Alex RiesenMay 9, 2018
  12. 0/2 gitk: improve handling of submodules in the file list panelAlex Riesen, May 9, 2018
  13. 2/2 gitk: add an option to run gitk on an item in the file listAlex Riesen, May 9, 2018
  14. 1/2 gitk: show part of submodule log instead of empty pane when listing treesAlex Riesen, May 9, 2018
  15. Stefan BellerMay 9, 2018

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.