* [PATCH 1/2] tests: handle paths with whitespace
@ 2012-01-19 19:24 mailings
2012-01-19 19:24 ` [PATCH 2/2] tests: properly quote more variables mailings
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: mailings @ 2012-01-19 19:24 UTC (permalink / raw)
From: Ferry Huberts <ferry.huberts at pelagic.nl>
Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
tests/setup.sh | 4 ++--
tests/t0108-patch.sh | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/setup.sh b/tests/setup.sh
index b21908d..3b52de9 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -20,7 +20,7 @@ unset CDPATH
mkrepo() {
name=$1
count=$2
- dir=$PWD
+ dir="$PWD"
test -d "$name" && return
printf "Creating testrepo %s\n" $name
mkdir -p "$name"
@@ -41,7 +41,7 @@ mkrepo() {
git commit -m "add a+b"
git branch "1+2"
fi
- cd $dir
+ cd "$dir"
}
setup_repos()
diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh
index e608104..6ee70b3 100755
--- a/tests/t0108-patch.sh
+++ b/tests/t0108-patch.sh
@@ -25,7 +25,7 @@ run_test 'find `cgit` signature' '
'
run_test 'find initial commit' '
- root=$(git --git-dir=$PWD/trash/repos/foo/.git rev-list HEAD | tail -1)
+ root=$(git --git-dir="$PWD/trash/repos/foo/.git" rev-list HEAD | tail -1)
'
run_test 'generate patch for initial commit' '
--
1.7.7.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] tests: properly quote more variables
2012-01-19 19:24 [PATCH 1/2] tests: handle paths with whitespace mailings
@ 2012-01-19 19:24 ` mailings
2012-01-19 20:57 ` cgit
2012-01-19 20:54 ` [PATCH 1/2] tests: handle paths with whitespace cgit
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: mailings @ 2012-01-19 19:24 UTC (permalink / raw)
From: Ferry Huberts <ferry.huberts at pelagic.nl>
Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
tests/setup.sh | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/setup.sh b/tests/setup.sh
index 3b52de9..c54609c 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -18,11 +18,11 @@
unset CDPATH
mkrepo() {
- name=$1
+ name="$1"
count=$2
dir="$PWD"
test -d "$name" && return
- printf "Creating testrepo %s\n" $name
+ printf "Creating testrepo %s\n" "$name"
mkdir -p "$name"
cd "$name"
git init
@@ -114,8 +114,8 @@ run_test()
bug=1
shift
fi
- desc=$1
- script=$2
+ desc="$1"
+ script="$2"
test_count=$(expr $test_count + 1)
printf "\ntest %d: name='%s'\n" $test_count "$desc" >>test-output.log
printf "test %d: eval='%s'\n" $test_count "$2" >>test-output.log
--
1.7.7.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] tests: handle paths with whitespace
2012-01-19 19:24 [PATCH 1/2] tests: handle paths with whitespace mailings
2012-01-19 19:24 ` [PATCH 2/2] tests: properly quote more variables mailings
@ 2012-01-19 20:54 ` cgit
2012-01-29 15:29 ` [PATCH v2 " mailings
2012-03-06 22:26 ` [PATCH v2 1/2] tests: handle paths with whitespace mailings
3 siblings, 0 replies; 10+ messages in thread
From: cgit @ 2012-01-19 20:54 UTC (permalink / raw)
On Thu, Jan 19, 2012 at 08:24:14PM +0100, Ferry Huberts wrote:
> From: Ferry Huberts <ferry.huberts at pelagic.nl>
>
> Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
> ---
> tests/setup.sh | 4 ++--
> tests/t0108-patch.sh | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/setup.sh b/tests/setup.sh
> index b21908d..3b52de9 100755
> --- a/tests/setup.sh
> +++ b/tests/setup.sh
> @@ -20,7 +20,7 @@ unset CDPATH
> mkrepo() {
> name=$1
> count=$2
> - dir=$PWD
> + dir="$PWD"
You can skip the quotes in assignments. Variable assignments are
expanded for tilde expansion, parameter expansion, command substitution,
arithmetic expansion and quote removal - field splitting isn't
performed. If we add redundant quotes here, we should add them to all
assignments (I'm for omitting them, though).
Apart from that, I'm fine with this patch :)
> test -d "$name" && return
> printf "Creating testrepo %s\n" $name
> mkdir -p "$name"
> @@ -41,7 +41,7 @@ mkrepo() {
> git commit -m "add a+b"
> git branch "1+2"
> fi
> - cd $dir
> + cd "$dir"
> }
>
> setup_repos()
> diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh
> index e608104..6ee70b3 100755
> --- a/tests/t0108-patch.sh
> +++ b/tests/t0108-patch.sh
> @@ -25,7 +25,7 @@ run_test 'find `cgit` signature' '
> '
>
> run_test 'find initial commit' '
> - root=$(git --git-dir=$PWD/trash/repos/foo/.git rev-list HEAD | tail -1)
> + root=$(git --git-dir="$PWD/trash/repos/foo/.git" rev-list HEAD | tail -1)
> '
>
> run_test 'generate patch for initial commit' '
> --
> 1.7.7.5
>
>
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] tests: properly quote more variables
2012-01-19 19:24 ` [PATCH 2/2] tests: properly quote more variables mailings
@ 2012-01-19 20:57 ` cgit
2012-01-19 21:08 ` mailings
0 siblings, 1 reply; 10+ messages in thread
From: cgit @ 2012-01-19 20:57 UTC (permalink / raw)
On Thu, Jan 19, 2012 at 08:24:15PM +0100, Ferry Huberts wrote:
> From: Ferry Huberts <ferry.huberts at pelagic.nl>
>
> Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
> ---
> tests/setup.sh | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tests/setup.sh b/tests/setup.sh
> index 3b52de9..c54609c 100755
> --- a/tests/setup.sh
> +++ b/tests/setup.sh
> @@ -18,11 +18,11 @@
> unset CDPATH
>
> mkrepo() {
> - name=$1
> + name="$1"
> count=$2
> dir="$PWD"
> test -d "$name" && return
> - printf "Creating testrepo %s\n" $name
> + printf "Creating testrepo %s\n" "$name"
Only this +/-1 line patch is needed - we don't need to quote right-hand
side of assignments here (for details, read my reply to the other patch
in this series).
> mkdir -p "$name"
> cd "$name"
> git init
> @@ -114,8 +114,8 @@ run_test()
> bug=1
> shift
> fi
> - desc=$1
> - script=$2
> + desc="$1"
> + script="$2"
> test_count=$(expr $test_count + 1)
> printf "\ntest %d: name='%s'\n" $test_count "$desc" >>test-output.log
> printf "test %d: eval='%s'\n" $test_count "$2" >>test-output.log
> --
> 1.7.7.5
>
>
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] tests: properly quote more variables
2012-01-19 20:57 ` cgit
@ 2012-01-19 21:08 ` mailings
2012-01-21 20:39 ` cgit
0 siblings, 1 reply; 10+ messages in thread
From: mailings @ 2012-01-19 21:08 UTC (permalink / raw)
On 19-01-12 21:57, Lukas Fleischer wrote:
> On Thu, Jan 19, 2012 at 08:24:15PM +0100, Ferry Huberts wrote:
>> From: Ferry Huberts<ferry.huberts at pelagic.nl>
>>
>> Signed-off-by: Ferry Huberts<ferry.huberts at pelagic.nl>
>> ---
>> tests/setup.sh | 8 ++++----
>> 1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/setup.sh b/tests/setup.sh
>> index 3b52de9..c54609c 100755
>> --- a/tests/setup.sh
>> +++ b/tests/setup.sh
>> @@ -18,11 +18,11 @@
>> unset CDPATH
>>
>> mkrepo() {
>> - name=$1
>> + name="$1"
>> count=$2
>> dir="$PWD"
>> test -d "$name"&& return
>> - printf "Creating testrepo %s\n" $name
>> + printf "Creating testrepo %s\n" "$name"
>
> Only this +/-1 line patch is needed - we don't need to quote right-hand
> side of assignments here (for details, read my reply to the other patch
> in this series).
>
yeah, but it won't hurt either.
and is more consistent
>> mkdir -p "$name"
>> cd "$name"
>> git init
>> @@ -114,8 +114,8 @@ run_test()
>> bug=1
>> shift
>> fi
>> - desc=$1
>> - script=$2
>> + desc="$1"
>> + script="$2"
>> test_count=$(expr $test_count + 1)
>> printf "\ntest %d: name='%s'\n" $test_count "$desc">>test-output.log
>> printf "test %d: eval='%s'\n" $test_count "$2">>test-output.log
>> --
>> 1.7.7.5
>>
>>
>> _______________________________________________
>> cgit mailing list
>> cgit at hjemli.net
>> http://hjemli.net/mailman/listinfo/cgit
>
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit
--
Ferry Huberts
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] tests: properly quote more variables
2012-01-19 21:08 ` mailings
@ 2012-01-21 20:39 ` cgit
0 siblings, 0 replies; 10+ messages in thread
From: cgit @ 2012-01-21 20:39 UTC (permalink / raw)
On Thu, Jan 19, 2012 at 10:08:41PM +0100, Ferry Huberts wrote:
>
>
> On 19-01-12 21:57, Lukas Fleischer wrote:
> >On Thu, Jan 19, 2012 at 08:24:15PM +0100, Ferry Huberts wrote:
> >>From: Ferry Huberts<ferry.huberts at pelagic.nl>
> >>
> >>Signed-off-by: Ferry Huberts<ferry.huberts at pelagic.nl>
> >>---
> >> tests/setup.sh | 8 ++++----
> >> 1 files changed, 4 insertions(+), 4 deletions(-)
> >>
> >>diff --git a/tests/setup.sh b/tests/setup.sh
> >>index 3b52de9..c54609c 100755
> >>--- a/tests/setup.sh
> >>+++ b/tests/setup.sh
> >>@@ -18,11 +18,11 @@
> >> unset CDPATH
> >>
> >> mkrepo() {
> >>- name=$1
> >>+ name="$1"
> >> count=$2
> >> dir="$PWD"
> >> test -d "$name"&& return
> >>- printf "Creating testrepo %s\n" $name
> >>+ printf "Creating testrepo %s\n" "$name"
> >
> >Only this +/-1 line patch is needed - we don't need to quote right-hand
> >side of assignments here (for details, read my reply to the other patch
> >in this series).
> >
>
> yeah, but it won't hurt either.
> and is more consistent
No, it doesn't break anything, of course. I just don't think we should
introduce no-op quotes in some assignments and keep unquoted variables
in others (like '$name="$1"' and 'count=$2' above). It's the opposite of
consistency, actually...
>
> >> mkdir -p "$name"
> >> cd "$name"
> >> git init
> >>@@ -114,8 +114,8 @@ run_test()
> >> bug=1
> >> shift
> >> fi
> >>- desc=$1
> >>- script=$2
> >>+ desc="$1"
> >>+ script="$2"
> >> test_count=$(expr $test_count + 1)
> >> printf "\ntest %d: name='%s'\n" $test_count "$desc">>test-output.log
> >> printf "test %d: eval='%s'\n" $test_count "$2">>test-output.log
> >>--
> >>1.7.7.5
> >>
> >>
> >>_______________________________________________
> >>cgit mailing list
> >>cgit at hjemli.net
> >>http://hjemli.net/mailman/listinfo/cgit
> >
> >_______________________________________________
> >cgit mailing list
> >cgit at hjemli.net
> >http://hjemli.net/mailman/listinfo/cgit
>
> --
> Ferry Huberts
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/2] tests: handle paths with whitespace
2012-01-19 19:24 [PATCH 1/2] tests: handle paths with whitespace mailings
2012-01-19 19:24 ` [PATCH 2/2] tests: properly quote more variables mailings
2012-01-19 20:54 ` [PATCH 1/2] tests: handle paths with whitespace cgit
@ 2012-01-29 15:29 ` mailings
2012-01-29 15:29 ` [PATCH v2 2/2] tests: properly quote arguments to printf mailings
2012-03-06 22:26 ` [PATCH v2 1/2] tests: handle paths with whitespace mailings
3 siblings, 1 reply; 10+ messages in thread
From: mailings @ 2012-01-29 15:29 UTC (permalink / raw)
From: Ferry Huberts <ferry.huberts at pelagic.nl>
v2: incorporate remarks of Lukas
Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
tests/setup.sh | 2 +-
tests/t0108-patch.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/setup.sh b/tests/setup.sh
index b21908d..18fae22 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -41,7 +41,7 @@ mkrepo() {
git commit -m "add a+b"
git branch "1+2"
fi
- cd $dir
+ cd "$dir"
}
setup_repos()
diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh
index e608104..6ee70b3 100755
--- a/tests/t0108-patch.sh
+++ b/tests/t0108-patch.sh
@@ -25,7 +25,7 @@ run_test 'find `cgit` signature' '
'
run_test 'find initial commit' '
- root=$(git --git-dir=$PWD/trash/repos/foo/.git rev-list HEAD | tail -1)
+ root=$(git --git-dir="$PWD/trash/repos/foo/.git" rev-list HEAD | tail -1)
'
run_test 'generate patch for initial commit' '
--
1.7.7.6
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 2/2] tests: properly quote arguments to printf
2012-01-29 15:29 ` [PATCH v2 " mailings
@ 2012-01-29 15:29 ` mailings
0 siblings, 0 replies; 10+ messages in thread
From: mailings @ 2012-01-29 15:29 UTC (permalink / raw)
From: Ferry Huberts <ferry.huberts at pelagic.nl>
v2: incorporate remarks of Lukas
Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
tests/setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/setup.sh b/tests/setup.sh
index 18fae22..e3c6c17 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -22,7 +22,7 @@ mkrepo() {
count=$2
dir=$PWD
test -d "$name" && return
- printf "Creating testrepo %s\n" $name
+ printf "Creating testrepo %s\n" "$name"
mkdir -p "$name"
cd "$name"
git init
--
1.7.7.6
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/2] tests: handle paths with whitespace
2012-01-19 19:24 [PATCH 1/2] tests: handle paths with whitespace mailings
` (2 preceding siblings ...)
2012-01-29 15:29 ` [PATCH v2 " mailings
@ 2012-03-06 22:26 ` mailings
2012-03-06 22:26 ` [PATCH v2 2/2] tests: properly quote arguments to printf mailings
3 siblings, 1 reply; 10+ messages in thread
From: mailings @ 2012-03-06 22:26 UTC (permalink / raw)
From: Ferry Huberts <ferry.huberts at pelagic.nl>
v2: incorporate remarks of Lukas
Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
tests/setup.sh | 2 +-
tests/t0108-patch.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/setup.sh b/tests/setup.sh
index b21908d..18fae22 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -41,7 +41,7 @@ mkrepo() {
git commit -m "add a+b"
git branch "1+2"
fi
- cd $dir
+ cd "$dir"
}
setup_repos()
diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh
index e608104..6ee70b3 100755
--- a/tests/t0108-patch.sh
+++ b/tests/t0108-patch.sh
@@ -25,7 +25,7 @@ run_test 'find `cgit` signature' '
'
run_test 'find initial commit' '
- root=$(git --git-dir=$PWD/trash/repos/foo/.git rev-list HEAD | tail -1)
+ root=$(git --git-dir="$PWD/trash/repos/foo/.git" rev-list HEAD | tail -1)
'
run_test 'generate patch for initial commit' '
--
1.7.7.6
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 2/2] tests: properly quote arguments to printf
2012-03-06 22:26 ` [PATCH v2 1/2] tests: handle paths with whitespace mailings
@ 2012-03-06 22:26 ` mailings
0 siblings, 0 replies; 10+ messages in thread
From: mailings @ 2012-03-06 22:26 UTC (permalink / raw)
From: Ferry Huberts <ferry.huberts at pelagic.nl>
v2: incorporate remarks of Lukas
Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
tests/setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/setup.sh b/tests/setup.sh
index 18fae22..e3c6c17 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -22,7 +22,7 @@ mkrepo() {
count=$2
dir=$PWD
test -d "$name" && return
- printf "Creating testrepo %s\n" $name
+ printf "Creating testrepo %s\n" "$name"
mkdir -p "$name"
cd "$name"
git init
--
1.7.7.6
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-03-06 22:26 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19 19:24 [PATCH 1/2] tests: handle paths with whitespace mailings
2012-01-19 19:24 ` [PATCH 2/2] tests: properly quote more variables mailings
2012-01-19 20:57 ` cgit
2012-01-19 21:08 ` mailings
2012-01-21 20:39 ` cgit
2012-01-19 20:54 ` [PATCH 1/2] tests: handle paths with whitespace cgit
2012-01-29 15:29 ` [PATCH v2 " mailings
2012-01-29 15:29 ` [PATCH v2 2/2] tests: properly quote arguments to printf mailings
2012-03-06 22:26 ` [PATCH v2 1/2] tests: handle paths with whitespace mailings
2012-03-06 22:26 ` [PATCH v2 2/2] tests: properly quote arguments to printf mailings
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).