Re: [PATCH] Fixing path quoting issues

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Fixing path quoting issues

From: David Kastrup <hidden>
Date: 2016-06-15 22:43:40

Johannes Sixt [off-list ref] writes:
Jonathan del Strother schrieb:
quoted
+	cmt=`cat "$dotest/current"`
This is ok, but...
quoted
+			prev_head="`cat \"$dotest/prev_head\"`"
... there are shells out there in the wild that will get badly
confused by this sort of quoting and escaping. Butter use

	prev_head=$(cat "$dotest/prev_head")

quoted
-VISUAL="$(pwd)/fake-editor.sh"
+VISUAL="'$(pwd)/fake-editor.sh'"
Huh? This looks very wrong.
It is correct, modulo breaking when there are single quotes in the
current path name.
What are the extra quotes needed for?
Spaces in the current path name.
If they are really needed, isn't this a bug in
git-rebase--interactive.sh?
No.
I question the usefulness of this patch. Why only fix breakage due
to spaces in the path? What about single-quotes, double-quotes?
Double quotes would work.  Single quotes wouldn't.  You can do
something like

visualpath="$(pwd)"
export visualpath
VISUAL='"$visualpath/fake-editor.sh"'

and this should work in all circumstances where VISUAL is interpreted
as intended (which at the current point of time does not include git's
C callers).
IMHO, it's not too much of a burden for developers to require "sane"
build directory paths.
For a normal user, the only writable directories might be of the
"C:\Programs and Data\User settings\Karl"
variety.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

Re: [PATCH] Fixing path quoting issues

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:43:40

David Kastrup schrieb:
Johannes Sixt [off-list ref] writes:
quoted
IMHO, it's not too much of a burden for developers to require "sane"
build directory paths.
For a normal user, the only writable directories might be of the
"C:\Programs and Data\User settings\Karl"
variety.
I whole-heartedly agree about the part of the patch that fixes 
git-rebase.sh. This should be a separate patch.

But the reset of the patch is about running the test suite, and it is much 
more difficult to fix because of the 'eval' that is going on. And, yes, I do 
think that we can expect that contributors, including this handful of people 
on Windows, have a "sane" build directory.

-- Hannes

Re: [PATCH] Fixing path quoting issues

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:43:40

Jonathan del Strother schrieb:
How are you going to test that git works on paths with spaces if the 
test suite doesn't run there?
By writing a specific test?

-- Hannes

Re: [PATCH] Fixing path quoting issues

From: Jonathan del Strother <hidden>
Date: 2016-06-15 22:43:40

On 11 Oct 2007, at 08:10, Johannes Sixt wrote:
David Kastrup schrieb:
quoted
Johannes Sixt [off-list ref] writes:
quoted
IMHO, it's not too much of a burden for developers to require "sane"
build directory paths.
For a normal user, the only writable directories might be of the
"C:\Programs and Data\User settings\Karl"
variety.
I whole-heartedly agree about the part of the patch that fixes git- 
rebase.sh. This should be a separate patch.

But the reset of the patch is about running the test suite, and it  
is much more difficult to fix because of the 'eval' that is going  
on. And, yes, I do think that we can expect that contributors,  
including this handful of people on Windows, have a "sane" build  
directory.
How are you going to test that git works on paths with spaces if the  
test suite doesn't run there?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help