{"thread":{"id":"29150","subject":"[PATCH] gitk: fix the display of files when filtered by path","startedAt":"2011-12-13T16:50:50Z","lastAt":"2012-03-18T23:11:43Z","messageCount":12,"participants":["Pat Thoyts","David Aguilar","Johannes Schindelin","Martin von Zweigbergk","Junio C Hamano","Paul Mackerras","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"181050","messageId":"87hb14wg4l.fsf@fox.patthoyts.tk","threadId":"29150","inReplyTo":null,"subject":"[PATCH] gitk: fix the display of files when filtered by path","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-12-13T16:50:50Z","receivedAt":"2011-12-13T16:50:50Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Launching 'gitk -- .' or 'gitk -- ..\\t' restricts the display to files\nunder the given directory but the file list is left empty. This is because\nthe path_filter function fails to match the filenames which are relative\nto the working tree to the filter which is filessytem relative.\nThis solves the problem by making both names fully qualified filesystem\npaths before performing the comparison.\n\nSigned-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n---\n gitk-git/gitk |   38 +++++++++++++++++++++++++++-----------\n 1 files changed, 27 insertions(+), 11 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 2a92e20..b728345 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -18,6 +18,26 @@ proc gitdir {} {\n     }\n }\n \n+proc gitworktree {} {\n+    variable _gitworktree\n+    if {[info exists _gitworktree]} {\n+\treturn $_gitworktree\n+    }\n+    # v1.7.0 introduced --show-toplevel to return the canonical work-tree\n+    if {[catch {set _gitworktree [exec git rev-parse --show-toplevel]}]} {\n+        # try to set work tree from environment, core.worktree or use\n+        # cdup to obtain a relative path to the top of the worktree. If\n+        # run from the top, the ./ prefix ensures normalize expands pwd.\n+        if {[catch { set _gitworktree $env(GIT_WORK_TREE) }]} {\n+\t    catch {set _gitworktree [exec git config --get core.worktree]}\n+\t    if {$_gitworktree eq \"\"} {\n+\t\tset _gitworktree [file normalize ./[exec git rev-parse --show-cdup]]\n+\t    }\n+        }\n+    }\n+    return $_gitworktree\n+}\n+\n # A simple scheduler for compute-intensive stuff.\n # The aim is to make sure that event handlers for GUI actions can\n # run at least every 50-100 ms.  Unfortunately fileevent handlers are\n@@ -7376,19 +7396,15 @@ proc startdiff {ids} {\n     }\n }\n \n+# If the filename (name) is under any of the passed filter paths\n+# then return true to include the file in the listing.\n proc path_filter {filter name} {\n+    set worktree [gitworktree]\n     foreach p $filter {\n-\tset l [string length $p]\n-\tif {[string index $p end] eq \"/\"} {\n-\t    if {[string compare -length $l $p $name] == 0} {\n-\t\treturn 1\n-\t    }\n-\t} else {\n-\t    if {[string compare -length $l $p $name] == 0 &&\n-\t\t([string length $name] == $l ||\n-\t\t [string index $name $l] eq \"/\")} {\n-\t\treturn 1\n-\t    }\n+\tset fq_p [file normalize $p]\n+\tset fq_n [file normalize [file join $worktree $name]]\n+\tif {[string match [file normalize $fq_p]* $fq_n]} {\n+\t    return 1\n \t}\n     }\n     return 0\n-- \n1.7.8.msysgit.0\n"},{"id":"181206","messageId":"CAJDDKr6rVaX_=SZZeEAs950yuNDvi8sOkzrUK7LnCrK6MYfscg@mail.gmail.com","threadId":"29150","inReplyTo":"87hb14wg4l.fsf@fox.patthoyts.tk","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2011-12-15T04:18:40Z","receivedAt":"2011-12-15T04:18:40Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Tue, Dec 13, 2011 at 8:50 AM, Pat Thoyts\n<patthoyts@users.sourceforge.net> wrote:\n> Launching 'gitk -- .' or 'gitk -- ..\\t' restricts the display to files\n> under the given directory but the file list is left empty. This is because\n> the path_filter function fails to match the filenames which are relative\n> to the working tree to the filter which is filessytem relative.\n> This solves the problem by making both names fully qualified filesystem\n> paths before performing the comparison.\n>\n> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n\nWonderful!\n\nI've run into this problem a number of times (as have some co-workers)\nbut I never bothered to report it since I felt guilty for never having\nworked up a patch.\n\nI tested this and it worked.\n\nFWIW,\n\nTested-by: David Aguilar <davvid@gmail.com>\n\n\nThank you Pat!\n-- \n            David\n"},{"id":"181219","messageId":"alpine.DEB.1.00.1112151023280.2615@bonsai2","threadId":"29150","inReplyTo":"CAJDDKr6rVaX_=SZZeEAs950yuNDvi8sOkzrUK7LnCrK6MYfscg@mail.gmail.com","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2011-12-15T09:24:24Z","receivedAt":"2011-12-15T09:24:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 14 Dec 2011, David Aguilar wrote:\n\n> On Tue, Dec 13, 2011 at 8:50 AM, Pat Thoyts\n> <patthoyts@users.sourceforge.net> wrote:\n> > Launching 'gitk -- .' or 'gitk -- ..\\t' restricts the display to files\n> > under the given directory but the file list is left empty. This is because\n> > the path_filter function fails to match the filenames which are relative\n> > to the working tree to the filter which is filessytem relative.\n> > This solves the problem by making both names fully qualified filesystem\n> > paths before performing the comparison.\n> >\n> > Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n> \n> Wonderful!\n\nThanks for reminding me that I did not yet apply and push. Did so now.\n\nThanks, Pat, for fixing this bug!\nDscho\n"},{"id":"181243","messageId":"CAOeW2eHD7Xutf+pHDyMOo=uZC9PSFZi+aMq1Rx80iTKPFApr8A@mail.gmail.com","threadId":"29150","inReplyTo":"alpine.DEB.1.00.1112151023280.2615@bonsai2","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Martin von Zweigbergk","fromEmail":"martin.von.zweigbergk@gmail.com","sentAt":"2011-12-15T19:42:38Z","receivedAt":"2011-12-15T19:42:38Z","isPatch":true,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"Hi,\n\nOn Thu, Dec 15, 2011 at 1:24 AM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Wed, 14 Dec 2011, David Aguilar wrote:\n>\n>> On Tue, Dec 13, 2011 at 8:50 AM, Pat Thoyts\n>> <patthoyts@users.sourceforge.net> wrote:\n>> > Launching 'gitk -- .' or 'gitk -- ..\\t' restricts the display to files\n>> > under the given directory but the file list is left empty. This is because\n>> > the path_filter function fails to match the filenames which are relative\n>> > to the working tree to the filter which is filessytem relative.\n>> > This solves the problem by making both names fully qualified filesystem\n>> > paths before performing the comparison.\n\nHow is this related to my patches from April? See\nhttp://thread.gmane.org/gmane.comp.version-control.git/170853. It's\nclearly not the same problem, but will the patches conflict? Will some\nof mine be unnecessary?\n\n> Thanks for reminding me that I did not yet apply and push. Did so now.\n\nWhat do you mean by this? Push to where?\ngit://git.kernel.org/pub/scm/gitk/gitk.git is still down.\n\nPaul and Junio, the patches I sent in April are still not in git.git,\nare they? Can we use another repo until the kernel.org one is up? More\nthan eight months to get a patch (or eight) merged is way too long,\nIMO.\n\nMartin\n"},{"id":"181244","messageId":"7v1us5obqa.fsf@alter.siamese.dyndns.org","threadId":"29150","inReplyTo":"CAOeW2eHD7Xutf+pHDyMOo=uZC9PSFZi+aMq1Rx80iTKPFApr8A@mail.gmail.com","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-15T19:50:53Z","receivedAt":"2011-12-15T19:50:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:\n\n> Paul and Junio, the patches I sent in April are still not in git.git,\n> are they? Can we use another repo until the kernel.org one is up? More\n> than eight months to get a patch (or eight) merged is way too long,\n> IMO.\n\nI tend to agree.\n\nI have this slight suspicion that Paul would appreciate if somebody who\ncares about gitk who is capable and willing steps forward and takes over\nthe maintainership of gitk, as he is busy in his other projects.\n"},{"id":"181257","messageId":"877h1xzfjm.fsf@fox.patthoyts.tk","threadId":"29150","inReplyTo":"CAOeW2eHD7Xutf+pHDyMOo=uZC9PSFZi+aMq1Rx80iTKPFApr8A@mail.gmail.com","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-12-15T21:33:01Z","receivedAt":"2011-12-15T21:33:01Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:\n\n[resending as my earlier post got bounced from vger]\n\n>Hi,\n>\n>On Thu, Dec 15, 2011 at 1:24 AM, Johannes Schindelin\n><Johannes.Schindelin@gmx.de> wrote:\n>> Hi,\n>>\n>> On Wed, 14 Dec 2011, David Aguilar wrote:\n>>\n>>> On Tue, Dec 13, 2011 at 8:50 AM, Pat Thoyts\n>>> <patthoyts@users.sourceforge.net> wrote:\n>>> > Launching 'gitk -- .' or 'gitk -- ..\\t' restricts the display to files\n>>> > under the given directory but the file list is left empty. This is because\n>>> > the path_filter function fails to match the filenames which are relative\n>>> > to the working tree to the filter which is filessytem relative.\n>>> > This solves the problem by making both names fully qualified filesystem\n>>> > paths before performing the comparison.\n>\n>How is this related to my patches from April? See\n>http://thread.gmane.org/gmane.comp.version-control.git/170853. It's\n>clearly not the same problem, but will the patches conflict? Will some\n>of mine be unnecessary?\n>\n>> Thanks for reminding me that I did not yet apply and push. Did so now.\n>\n>What do you mean by this? Push to where?\n>git://git.kernel.org/pub/scm/gitk/gitk.git is still down.\n>\n\nThis is for msysGit.\n\n>Paul and Junio, the patches I sent in April are still not in git.git,\n>are they? Can we use another repo until the kernel.org one is up? More\n>than eight months to get a patch (or eight) merged is way too long,\n>IMO.\n\nI'm not sure how this might relate to your patches. I've got a version\nmerged on top of the last version of the gitk report that I have which\nincludes those and it seems fine. As stated I did this work against\ngit-core as the gitk repository continues to be unavailable. However as\nI have a pretty current snapshot  I have pushed this to github to provide\nsome visibility of things I know are not present within git-core. See\nhttp://github.com/patthoyts/gitk.git\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"181265","messageId":"8739clzdzw.fsf@fox.patthoyts.tk","threadId":"29150","inReplyTo":"7v1us5obqa.fsf@alter.siamese.dyndns.org","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-12-15T22:06:27Z","receivedAt":"2011-12-15T22:06:27Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:\n>\n>> Paul and Junio, the patches I sent in April are still not in git.git,\n>> are they? Can we use another repo until the kernel.org one is up? More\n>> than eight months to get a patch (or eight) merged is way too long,\n>> IMO.\n>\n>I tend to agree.\n>\n>I have this slight suspicion that Paul would appreciate if somebody who\n>cares about gitk who is capable and willing steps forward and takes over\n>the maintainership of gitk, as he is busy in his other projects.\n\nI can do this one along with git-gui if this is the case.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"181273","messageId":"20111215225945.GG20629@bloggs.ozlabs.ibm.com","threadId":"29150","inReplyTo":"CAOeW2eHD7Xutf+pHDyMOo=uZC9PSFZi+aMq1Rx80iTKPFApr8A@mail.gmail.com","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2011-12-15T22:59:45Z","receivedAt":"2011-12-15T22:59:45Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Thu, Dec 15, 2011 at 11:42:38AM -0800, Martin von Zweigbergk wrote:\n\n> git://git.kernel.org/pub/scm/gitk/gitk.git is still down.\n\nI have just created a repository on ozlabs.org for gitk, since I don't\nhave kernel.org access at this point.  The repository is:\n\ngit://ozlabs.org/~paulus/gitk.git\n\n> Paul and Junio, the patches I sent in April are still not in git.git,\n> are they? Can we use another repo until the kernel.org one is up? More\n> than eight months to get a patch (or eight) merged is way too long,\n> IMO.\n\nYour patches are in the master branch.  I applied them back in July\nbut then kernel.org went down.\n\nPaul.\n"},{"id":"181272","messageId":"20111215230124.GH20629@bloggs.ozlabs.ibm.com","threadId":"29150","inReplyTo":"7v1us5obqa.fsf@alter.siamese.dyndns.org","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2011-12-15T23:01:24Z","receivedAt":"2011-12-15T23:01:24Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Thu, Dec 15, 2011 at 11:50:53AM -0800, Junio C Hamano wrote:\n> Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:\n> \n> > Paul and Junio, the patches I sent in April are still not in git.git,\n> > are they? Can we use another repo until the kernel.org one is up? More\n> > than eight months to get a patch (or eight) merged is way too long,\n> > IMO.\n> \n> I tend to agree.\n> \n> I have this slight suspicion that Paul would appreciate if somebody who\n> cares about gitk who is capable and willing steps forward and takes over\n> the maintainership of gitk, as he is busy in his other projects.\n\nIndeed.  For now I have put up a repository on ozlabs.org:\n\ngit://ozlabs.org/~paulus/gitk.git\n\nbut if someone wants to take on the gitk maintainership, please let me\nknow.\n\nPaul.\n"},{"id":"181344","messageId":"m3y5ucf8zd.fsf@localhost.localdomain","threadId":"29150","inReplyTo":"8739clzdzw.fsf@fox.patthoyts.tk","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-12-16T22:27:23Z","receivedAt":"2011-12-16T22:27:23Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Pat Thoyts <patthoyts@users.sourceforge.net> writes:\n> Junio C Hamano <gitster@pobox.com> writes:\n\n>> I have this slight suspicion that Paul would appreciate if somebody who\n>> cares about gitk who is capable and willing steps forward and takes over\n>> the maintainership of gitk, as he is busy in his other projects.\n> \n> I can do this one along with git-gui if this is the case.\n\nI wonder if having common maintainer for both gitk and git-gui would\nlead to first, splitting gitk into smaller files like git-gui was, and\nsecond sharing common Tcl/Tk bindings / wrappers between gitk and\ngit-gui...\n\n-- \nJakub Narębski\n"},{"id":"181368","messageId":"7vy5ubemk9.fsf@alter.siamese.dyndns.org","threadId":"29150","inReplyTo":"20111215225945.GG20629@bloggs.ozlabs.ibm.com","subject":"Re: [msysGit] [PATCH] gitk: fix the display of files when filtered by path","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-17T06:31:34Z","receivedAt":"2011-12-17T06:31:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Paul Mackerras <paulus@samba.org> writes:\n\n> On Thu, Dec 15, 2011 at 11:42:38AM -0800, Martin von Zweigbergk wrote:\n>\n>> git://git.kernel.org/pub/scm/gitk/gitk.git is still down.\n>\n> I have just created a repository on ozlabs.org for gitk, since I don't\n> have kernel.org access at this point.  The repository is:\n>\n> git://ozlabs.org/~paulus/gitk.git\n> ...\n> Your patches are in the master branch.  I applied them back in July\n> but then kernel.org went down.\n\nThanks.\n\nAll pulled and resulted in one liner update to the draft Release Notes for\nthe next release.\n\ndiff --git a/Documentation/RelNotes/1.7.9.txt b/Documentation/RelNotes/1.7.9.txt\nindex cd3c256..f476667 100644\n--- a/Documentation/RelNotes/1.7.9.txt\n+++ b/Documentation/RelNotes/1.7.9.txt\n@@ -4,6 +4,8 @@ Git v1.7.9 Release Notes (draft)\n Updates since v1.7.8\n --------------------\n \n+ * Accumulated gitk updates since early this year.\n+\n  * git-gui updated to 0.16.0.\n \n  * git-p4 (in contrib/) updates.\n"},{"id":"187223","messageId":"20120318231143.GD26977@bloggs.ozlabs.ibm.com","threadId":"29150","inReplyTo":"87hb14wg4l.fsf@fox.patthoyts.tk","subject":"Re: [PATCH] gitk: fix the display of files when filtered by path","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2012-03-18T23:11:43Z","receivedAt":"2012-03-18T23:11:43Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Tue, Dec 13, 2011 at 04:50:50PM +0000, Pat Thoyts wrote:\n> Launching 'gitk -- .' or 'gitk -- ..\\t' restricts the display to files\n> under the given directory but the file list is left empty. This is because\n> the path_filter function fails to match the filenames which are relative\n> to the working tree to the filter which is filessytem relative.\n> This solves the problem by making both names fully qualified filesystem\n> paths before performing the comparison.\n> \n> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n\nThanks, applied.\n\nPaul.\n"}]}