{"thread":{"id":"25815","subject":"[PATCH] git-gui: fix browser with initial path","startedAt":"2010-11-23T07:37:50Z","lastAt":"2011-01-28T11:04:10Z","messageCount":4,"participants":["Bert Wesarg","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"156351","messageId":"1290497870-28673-1-git-send-email-bert.wesarg@googlemail.com","threadId":"25815","inReplyTo":null,"subject":"[PATCH] git-gui: fix browser with initial path","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-11-23T07:37:50Z","receivedAt":"2010-11-23T07:37:50Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"The path given to the browser does not end in a slash, which results in bad\npath given to blame and broke [Up To Parent]. Also the path was not\nescaped before displaying.\n\nSigned-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n\n---\n git-gui/lib/browser.tcl |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl\nindex c241572..a88a68b 100644\n--- a/git-gui/lib/browser.tcl\n+++ b/git-gui/lib/browser.tcl\n@@ -26,8 +26,14 @@ constructor new {commit {path {}}} {\n \twm withdraw $top\n \twm title $top [append \"[appname] ([reponame]): \" [mc \"File Browser\"]]\n \n+\tif {$path ne {}} {\n+\t\tif {[string index $path end] ne {/}} {\n+\t\t\tappend path /\n+\t\t}\n+\t}\n+\n \tset browser_commit $commit\n-\tset browser_path $browser_commit:$path\n+\tset browser_path \"$browser_commit:[escape_path $path]\"\n \n \t${NS}::label $w.path \\\n \t\t-textvariable @browser_path \\\n-- \ntg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)\n"},{"id":"157800","messageId":"AANLkTim8BhN9czr6Jx5J28iNop4XdFDcNKbbjxddW9-i@mail.gmail.com","threadId":"25815","inReplyTo":"1290497870-28673-1-git-send-email-bert.wesarg@googlemail.com","subject":"Re: [PATCH] git-gui: fix browser with initial path","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-12-10T08:48:43Z","receivedAt":"2010-12-10T08:48:43Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"Ping.\n\nOn Tue, Nov 23, 2010 at 08:37, Bert Wesarg <bert.wesarg@googlemail.com> wrote:\n> The path given to the browser does not end in a slash, which results in bad\n> path given to blame and broke [Up To Parent]. Also the path was not\n> escaped before displaying.\n>\n> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>\n> ---\n>  git-gui/lib/browser.tcl |    8 +++++++-\n>  1 files changed, 7 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl\n> index c241572..a88a68b 100644\n> --- a/git-gui/lib/browser.tcl\n> +++ b/git-gui/lib/browser.tcl\n> @@ -26,8 +26,14 @@ constructor new {commit {path {}}} {\n>        wm withdraw $top\n>        wm title $top [append \"[appname] ([reponame]): \" [mc \"File Browser\"]]\n>\n> +       if {$path ne {}} {\n> +               if {[string index $path end] ne {/}} {\n> +                       append path /\n> +               }\n> +       }\n> +\n>        set browser_commit $commit\n> -       set browser_path $browser_commit:$path\n> +       set browser_path \"$browser_commit:[escape_path $path]\"\n>\n>        ${NS}::label $w.path \\\n>                -textvariable @browser_path \\\n> --\n> tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)\n>\n"},{"id":"159975","messageId":"87sjwdmhrs.fsf@fox.patthoyts.tk","threadId":"25815","inReplyTo":"AANLkTim8BhN9czr6Jx5J28iNop4XdFDcNKbbjxddW9-i@mail.gmail.com","subject":"Re: [PATCH] git-gui: fix browser with initial path","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-01-28T10:42:15Z","receivedAt":"2011-01-28T10:42:15Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Bert Wesarg <bert.wesarg@googlemail.com> writes:\n\n>Ping.\n>\n>On Tue, Nov 23, 2010 at 08:37, Bert Wesarg <bert.wesarg@googlemail.com> wrote:\n>> The path given to the browser does not end in a slash, which results in bad\n>> path given to blame and broke [Up To Parent]. Also the path was not\n>> escaped before displaying.\n>>\n>> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>>\n>> ---\n>>  git-gui/lib/browser.tcl |    8 +++++++-\n>>  1 files changed, 7 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl\n>> index c241572..a88a68b 100644\n>> --- a/git-gui/lib/browser.tcl\n>> +++ b/git-gui/lib/browser.tcl\n>> @@ -26,8 +26,14 @@ constructor new {commit {path {}}} {\n>>        wm withdraw $top\n>>        wm title $top [append \"[appname] ([reponame]): \" [mc \"File Browser\"]]\n>>\n>> +       if {$path ne {}} {\n>> +               if {[string index $path end] ne {/}} {\n>> +                       append path /\n>> +               }\n>> +       }\n>> +\n>>        set browser_commit $commit\n>> -       set browser_path $browser_commit:$path\n>> +       set browser_path \"$browser_commit:[escape_path $path]\"\n>>\n>>        ${NS}::label $w.path \\\n>>                -textvariable @browser_path \\\n>> --\n>> tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)\n>>\n>\nThe commit comment for this doesn't really reflect whats being\ndone. Commit 1ab8628 fixed the [Up To Parent] problem and this just\nfixes the display on the browser title.\n\nSo I plan to take this with the commit comment as:\n\n git-gui: fix display of path in browser title\n\n Ensure the browser path is shown on the title with a / suffix and escape\n any backslashes or newlines in path elements before display.\n\n Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\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":"159976","messageId":"AANLkTi=9vwg9mvvyWax0jr1OmAr+JUn7TNt98=9MxR6G@mail.gmail.com","threadId":"25815","inReplyTo":"87sjwdmhrs.fsf@fox.patthoyts.tk","subject":"Re: [PATCH] git-gui: fix browser with initial path","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-01-28T11:04:10Z","receivedAt":"2011-01-28T11:04:10Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Fri, Jan 28, 2011 at 11:42, Pat Thoyts\n<patthoyts@users.sourceforge.net> wrote:\n> The commit comment for this doesn't really reflect whats being\n> done. Commit 1ab8628 fixed the [Up To Parent] problem and this just\n> fixes the display on the browser title.\n>\n> So I plan to take this with the commit comment as:\n>\n>  git-gui: fix display of path in browser title\n>\n>  Ensure the browser path is shown on the title with a / suffix and escape\n>  any backslashes or newlines in path elements before display.\n\nNo, the main problem is, that the path does not end in a slash, but\nthe browser code expect this, ie. it build sub pathes by just\nconcatenating '$path' and '$file', or with '$dir/', without a slash\ninbetween. Its not only the visual part. Try this without the patch\n(int git.git):\n\ngit gui browse git-gui/\n\nIn the path line there should be now 'master:git-gui'. Than go into\n'lib'. You have 'master:git-guilib/'. And than double click about.tcl,\nThe blame view will get the 'git-guilib/about.tcl'.\n\nBecause the browser is itself consistent in this behavior, the only\nproblem was when the browser was a path given to start with. And this\npath needs have a trailing slash. And this patch ensures this.\n\nBert\n\n>\n>  Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>\n> --\n> Pat Thoyts                            http://www.patthoyts.tk/\n> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n>\n>\n"}]}