* [PATCH] git-gui: fix browser with initial path
@ 2010-11-23 7:37 Bert Wesarg
2010-12-10 8:48 ` Bert Wesarg
0 siblings, 1 reply; 4+ messages in thread
From: Bert Wesarg @ 2010-11-23 7:37 UTC (permalink / raw)
To: Pat Thoyts; +Cc: Bert Wesarg, Shawn O. Pearce, git
The path given to the browser does not end in a slash, which results in bad
path given to blame and broke [Up To Parent]. Also the path was not
escaped before displaying.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
git-gui/lib/browser.tcl | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
index c241572..a88a68b 100644
--- a/git-gui/lib/browser.tcl
+++ b/git-gui/lib/browser.tcl
@@ -26,8 +26,14 @@ constructor new {commit {path {}}} {
wm withdraw $top
wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
+ if {$path ne {}} {
+ if {[string index $path end] ne {/}} {
+ append path /
+ }
+ }
+
set browser_commit $commit
- set browser_path $browser_commit:$path
+ set browser_path "$browser_commit:[escape_path $path]"
${NS}::label $w.path \
-textvariable @browser_path \
--
tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] git-gui: fix browser with initial path
2010-11-23 7:37 [PATCH] git-gui: fix browser with initial path Bert Wesarg
@ 2010-12-10 8:48 ` Bert Wesarg
2011-01-28 10:42 ` Pat Thoyts
0 siblings, 1 reply; 4+ messages in thread
From: Bert Wesarg @ 2010-12-10 8:48 UTC (permalink / raw)
To: Pat Thoyts; +Cc: Bert Wesarg, Shawn O. Pearce, git
Ping.
On Tue, Nov 23, 2010 at 08:37, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> The path given to the browser does not end in a slash, which results in bad
> path given to blame and broke [Up To Parent]. Also the path was not
> escaped before displaying.
>
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>
> ---
> git-gui/lib/browser.tcl | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
> index c241572..a88a68b 100644
> --- a/git-gui/lib/browser.tcl
> +++ b/git-gui/lib/browser.tcl
> @@ -26,8 +26,14 @@ constructor new {commit {path {}}} {
> wm withdraw $top
> wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
>
> + if {$path ne {}} {
> + if {[string index $path end] ne {/}} {
> + append path /
> + }
> + }
> +
> set browser_commit $commit
> - set browser_path $browser_commit:$path
> + set browser_path "$browser_commit:[escape_path $path]"
>
> ${NS}::label $w.path \
> -textvariable @browser_path \
> --
> tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] git-gui: fix browser with initial path
2010-12-10 8:48 ` Bert Wesarg
@ 2011-01-28 10:42 ` Pat Thoyts
2011-01-28 11:04 ` Bert Wesarg
0 siblings, 1 reply; 4+ messages in thread
From: Pat Thoyts @ 2011-01-28 10:42 UTC (permalink / raw)
To: Bert Wesarg; +Cc: Shawn O. Pearce, git
Bert Wesarg <bert.wesarg@googlemail.com> writes:
>Ping.
>
>On Tue, Nov 23, 2010 at 08:37, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> The path given to the browser does not end in a slash, which results in bad
>> path given to blame and broke [Up To Parent]. Also the path was not
>> escaped before displaying.
>>
>> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>
>> ---
>> git-gui/lib/browser.tcl | 8 +++++++-
>> 1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
>> index c241572..a88a68b 100644
>> --- a/git-gui/lib/browser.tcl
>> +++ b/git-gui/lib/browser.tcl
>> @@ -26,8 +26,14 @@ constructor new {commit {path {}}} {
>> wm withdraw $top
>> wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
>>
>> + if {$path ne {}} {
>> + if {[string index $path end] ne {/}} {
>> + append path /
>> + }
>> + }
>> +
>> set browser_commit $commit
>> - set browser_path $browser_commit:$path
>> + set browser_path "$browser_commit:[escape_path $path]"
>>
>> ${NS}::label $w.path \
>> -textvariable @browser_path \
>> --
>> tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)
>>
>
The commit comment for this doesn't really reflect whats being
done. Commit 1ab8628 fixed the [Up To Parent] problem and this just
fixes the display on the browser title.
So I plan to take this with the commit comment as:
git-gui: fix display of path in browser title
Ensure the browser path is shown on the title with a / suffix and escape
any backslashes or newlines in path elements before display.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] git-gui: fix browser with initial path
2011-01-28 10:42 ` Pat Thoyts
@ 2011-01-28 11:04 ` Bert Wesarg
0 siblings, 0 replies; 4+ messages in thread
From: Bert Wesarg @ 2011-01-28 11:04 UTC (permalink / raw)
To: Pat Thoyts; +Cc: Shawn O. Pearce, git
On Fri, Jan 28, 2011 at 11:42, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
> The commit comment for this doesn't really reflect whats being
> done. Commit 1ab8628 fixed the [Up To Parent] problem and this just
> fixes the display on the browser title.
>
> So I plan to take this with the commit comment as:
>
> git-gui: fix display of path in browser title
>
> Ensure the browser path is shown on the title with a / suffix and escape
> any backslashes or newlines in path elements before display.
No, the main problem is, that the path does not end in a slash, but
the browser code expect this, ie. it build sub pathes by just
concatenating '$path' and '$file', or with '$dir/', without a slash
inbetween. Its not only the visual part. Try this without the patch
(int git.git):
git gui browse git-gui/
In the path line there should be now 'master:git-gui'. Than go into
'lib'. You have 'master:git-guilib/'. And than double click about.tcl,
The blame view will get the 'git-guilib/about.tcl'.
Because the browser is itself consistent in this behavior, the only
problem was when the browser was a path given to start with. And this
path needs have a trailing slash. And this patch ensures this.
Bert
>
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>
> --
> Pat Thoyts http://www.patthoyts.tk/
> PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-28 11:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-23 7:37 [PATCH] git-gui: fix browser with initial path Bert Wesarg
2010-12-10 8:48 ` Bert Wesarg
2011-01-28 10:42 ` Pat Thoyts
2011-01-28 11:04 ` Bert Wesarg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.