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

Re: [GITK PATCH 2/3] gitk: support path filters even in subdirectories

From
KKirill <kirillathome@gmail.com>
Date
Feb 23, 2010, 19:37 UTC
Message-ID
<f579dd581002231137t71bb034fl429fd03a2c0d681c@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.1002231810020.3980@intel-tinevez-2-302>
Hi,

Dscho, at first, thank you so much for working on the issue! In general the series work. At least, it passes my limited testing from the original message. However...

On Tue, Feb 23, 2010 at 12:10 PM, Johannes Schindelin wrote:
Show 31 quoted lines
>
> Even when running inside a subdirectory, "gitk HEAD -- ." should work.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  gitk-git/gitk |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index 553922f..bad9ebc 100644
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -7340,9 +7340,12 @@ proc startdiff {ids} {
>  }
>
>  proc path_filter {filter name} {
> +    global pathprefix
>     foreach p $filter {
>        if {$p == "."} {
> -               return 1
> +               set p $pathprefix
> +       } else {
> +               set p $pathprefix$p
>        }
>        set l [string length $p]
>        if {[string index $p end] eq "/"} {
> @@ -11585,6 +11588,7 @@ readrefs
>
>  if {$cmdline_files ne {} || $revtreeargs ne {} || $revtreeargscmd ne {}} {
>     # create a view for the files/dirs specified on the command line
> +    set pathprefix [exec git rev-parse --show-prefix]

I believe the fact that pathprefix is set only under several conditions, the invocation without arguments is broken.

My .02

-- Kirill.

Previous: KirillNext: Johannes Schindelin
Message 7 of 10 in “gitk: support "gitk <tracheophyte> -- ."”
  1. gitk: support "gitk <tracheophyte> -- ."Johannes Schindelin, Feb 23, 2010
  2. 2/3 gitk: support path filters even in subdirectoriesJohannes Schindelin, Feb 23, 2010
  3. 3/3 gitk: strip prefix from filenames in subdirectoriesJohannes Schindelin, Feb 23, 2010
  4. KirillFeb 23, 2010
  5. Johannes SchindelinFeb 23, 2010
  6. KirillFeb 23, 2010
  7. KirillFeb 23, 2010
  8. Johannes SchindelinFeb 23, 2010
  9. Pat ThoytsFeb 25, 2010
  10. Johannes SchindelinFeb 25, 2010

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.