{"thread":{"id":"21651","subject":"gitk does not show path file list","startedAt":"2009-11-17T12:09:14Z","lastAt":"2009-11-24T08:11:11Z","messageCount":5,"participants":["Mark Blakeney","Junio C Hamano","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"127761","messageId":"33e2b2760911170409q4cbdad8ay83ae5c941bc5ff95@mail.gmail.com","threadId":"21651","inReplyTo":null,"subject":"gitk does not show path file list","fromName":"Mark Blakeney","fromEmail":"markb@berlios.de","sentAt":"2009-11-17T12:09:14Z","receivedAt":"2009-11-17T12:09:14Z","isPatch":false,"sender":{"key":"markb@berlios.de","avatar":null},"body":"gitk takes a path to limit commits to those touching those files.\nHowever, doing \"gitk .\" does not list any files in the right window\nfile list when trying to view commits for the current dir (which would\nseem to be a common use-case, particularly for me at least). Why is\nthe affected [subset] of files not shown?\n\nJust seems to be a bug to this newbie, particularly when it does work\nas I expect if I do a \"cd ..\" and then \"gitk src\" where src was my\noriginal dir. I'm using version 1.6.5.3 now but this has existed since\nI started with git quite some time ago.\n"},{"id":"128229","messageId":"loom.20091124T060334-836@post.gmane.org","threadId":"21651","inReplyTo":"33e2b2760911170409q4cbdad8ay83ae5c941bc5ff95@mail.gmail.com","subject":"Re: gitk does not show path file list","fromName":"Mark Blakeney","fromEmail":"markb@berlios.de","sentAt":"2009-11-24T05:36:37Z","receivedAt":"2009-11-24T05:36:37Z","isPatch":false,"sender":{"key":"markb@berlios.de","avatar":null},"body":"This seems to me to be a straight out bug but given I've had no response here\nand  given this is such a simple issue then I guess it's not a bug and I'm just\nmissing something? Please somebody, why does gitk (usually) not show the subset\nlist of files affected when you give it a path?\n\nE.g. If I am in a src dir then \"gitk .\" does not list files. Neither does \"gitk\n$PWD\" nor \"gitk ../src\". However \"cd ..; git src\" does list files!?\n\nIs there a more appropriate forum/list for git newcomers?\n"},{"id":"128232","messageId":"7v3a44l752.fsf@alter.siamese.dyndns.org","threadId":"21651","inReplyTo":"loom.20091124T060334-836@post.gmane.org","subject":"Re: gitk does not show path file list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-24T07:22:01Z","receivedAt":"2009-11-24T07:22:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Blakeney <markb@berlios.de> writes:\n\n> ... why does gitk (usually) not show the subset list of files affected\n> when you give it a path?\n>\n> E.g. If I am in a src dir then \"gitk .\" does not list files. Neither does \"gitk\n> $PWD\" nor \"gitk ../src\". However \"cd ..; git src\" does list files!?\n\nPaul, I do not read Tcl very well, but it appears that path_filter\nprocedure is at fault.\n\nThe call chain involved in this seems to be:\n\n    gettreediffs\n     - arranges gettreediffline to be fed output from \"diff-tree $commit .\"\n\n ->\n\n    gettreediffline\n     - finds the path (note that diff output is _always_ relative to the\n       top of the work tree) from the patch;\n     - calls path_filter with $vfilelimit($curview) and each filename\n       In this case, the $vfilelimit($curview) is \".\" (dot)\n\n ->\n\n    path_filter\n     - compares strings in $filter and the $name; in this case, $filter is\n       a dot \".\" and $name begins with \"src/\"\n\nI see at least two problems in path_filter used this way:\n\n - A dot \".\" never would match anything from \"diff-tree\" (or any \"diff\"\n   variant) after stripping a/ and b/ prefix.  gitk should prefix the\n   current directory to each of the pathspec from command line (run\n   \"rev-parse --show-prefix\" to learn where you are).\n\n - There is another callsite to path_filter for filtering output from\n   \"ls-files -u\".  But the output from \"ls-files\" is relative to the cwd\n   by default.  gitk should probably run it with --full-name option, so\n   that it would get the same semantics as \"diff\" output.\n\nIt _might_ be the easiest to do an equivalent of (sorry, I do not talk Tcl\nso this is in shell):\n\n\tprefix=$(git rev-parse --show-prefix)\n\tif test -n \"$prefix\"\n        then\n        \tcd $(git rev-parse --show-cdup)\n\tfi\n\nand then prepend prefix to all the pathspecs you would use from the\ncommand line before doing anything else.  This \"prepending\" obviously need\nto be aware of the \".\", \"..\" and friends.\n"},{"id":"128237","messageId":"4B0B91DC.1020902@viscovery.net","threadId":"21651","inReplyTo":"loom.20091124T060334-836@post.gmane.org","subject":"Re: gitk does not show path file list","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-11-24T07:57:16Z","receivedAt":"2009-11-24T07:57:16Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Mark Blakeney schrieb:\n> This seems to me to be a straight out bug but given I've had no response here\n> and  given this is such a simple issue then I guess it's not a bug and I'm just\n> missing something? Please somebody, why does gitk (usually) not show the subset\n> list of files affected when you give it a path?\n> \n> E.g. If I am in a src dir then \"gitk .\" does not list files. Neither does \"gitk\n> $PWD\" nor \"gitk ../src\". However \"cd ..; git src\" does list files!?\n\ngitk doesn't list the files in your examples because the patterns you gave\nare not initial substrings of any files in the list.\n\n-- Hannes\n"},{"id":"128238","messageId":"7v1vjoibq8.fsf@alter.siamese.dyndns.org","threadId":"21651","inReplyTo":"4B0B91DC.1020902@viscovery.net","subject":"Re: gitk does not show path file list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-24T08:11:11Z","receivedAt":"2009-11-24T08:11:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Mark Blakeney schrieb:\n>> This seems to me to be a straight out bug but given I've had no response here\n>> and  given this is such a simple issue then I guess it's not a bug and I'm just\n>> missing something? Please somebody, why does gitk (usually) not show the subset\n>> list of files affected when you give it a path?\n>> \n>> E.g. If I am in a src dir then \"gitk .\" does not list files. Neither does \"gitk\n>> $PWD\" nor \"gitk ../src\". However \"cd ..; git src\" does list files!?\n>\n> gitk doesn't list the files in your examples because the patterns you gave\n> are not initial substrings of any files in the list.\n\nYes, but if you are in src/ and run \"gitk .\", then...\n\n - clicking on a commit runs \"diff-tree $commit .\", that lists\n   src/hello.c, src/goodbye.c, etc.\n\n - gitk tries to filter paths read from diff-tree with the \".\" given from\n   the command line as the filter---it removes paths that do not match.\n\nSo the only case that would produce any output would be for you to have:\n\n src/src/hello.c\n src/frotz.c\n\nand run\n\n cd src && gitk src\n\nwhose invocation of \"diff-tree src\" will show _only_ src/src/hello.c and\nthen the filter procedure will limit it to whatever begins with src/\n(which would be everything).\n\nThat does not sound very useful to me...\n\n   \n"}]}