* [PATCH 0/3] some shell portability fixes, v2
@ 2007-11-08 21:46 Ralf Wildenhues
2007-11-08 21:47 ` [PATCH 1/3] Avoid a few unportable, needlessly nested "...`..." Ralf Wildenhues
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Ralf Wildenhues @ 2007-11-08 21:46 UTC (permalink / raw)
To: git
Thanks for all the helpful feedback. Here's a new series that drops the
$(()) and test -a/-o patches, and otherwise hopefully incorporates all
nits.
Cheers,
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] Avoid a few unportable, needlessly nested "...`...".
2007-11-08 21:46 [PATCH 0/3] some shell portability fixes, v2 Ralf Wildenhues
@ 2007-11-08 21:47 ` Ralf Wildenhues
2007-11-08 21:48 ` [PATCH 2/3] Fix sed script to work with AIX and BSD sed Ralf Wildenhues
2007-11-08 21:48 ` [PATCH 3/3] Fix sed string regex escaping in module_name Ralf Wildenhues
2 siblings, 0 replies; 5+ messages in thread
From: Ralf Wildenhues @ 2007-11-08 21:47 UTC (permalink / raw)
To: git
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
---
git-rebase--interactive.sh | 2 +-
git-request-pull.sh | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 6d14092..66c80d4 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -392,7 +392,7 @@ do
-s|--strategy)
case "$#,$1" in
*,*=*)
- STRATEGY="-s `expr "z$1" : 'z-[^=]*=\(.*\)'`" ;;
+ STRATEGY="-s "$(expr "z$1" : 'z-[^=]*=\(.*\)') ;;
1,*)
usage ;;
*)
diff --git a/git-request-pull.sh b/git-request-pull.sh
index 90d969c..068f5e0 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -25,13 +25,13 @@ headrev=`git rev-parse --verify "$head"^0` || exit
merge_base=`git merge-base $baserev $headrev` ||
die "fatal: No commits in common between $base and $head"
-url="`get_remote_url "$url"`"
-branch=`git peek-remote "$url" \
+url=$(get_remote_url "$url")
+branch=$(git peek-remote "$url" \
| sed -n -e "/^$headrev refs.heads./{
s/^.* refs.heads.//
p
q
- }"`
+ }")
if [ -z "$branch" ]; then
echo "warn: No branch of $url is at:" >&2
git log --max-count=1 --pretty='format:warn: %h: %s' $headrev >&2
--
1.5.3.5.561.g140d
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] Fix sed script to work with AIX and BSD sed.
2007-11-08 21:46 [PATCH 0/3] some shell portability fixes, v2 Ralf Wildenhues
2007-11-08 21:47 ` [PATCH 1/3] Avoid a few unportable, needlessly nested "...`..." Ralf Wildenhues
@ 2007-11-08 21:48 ` Ralf Wildenhues
2007-11-08 22:15 ` Benoit Sigoure
2007-11-08 21:48 ` [PATCH 3/3] Fix sed string regex escaping in module_name Ralf Wildenhues
2 siblings, 1 reply; 5+ messages in thread
From: Ralf Wildenhues @ 2007-11-08 21:48 UTC (permalink / raw)
To: git
\n is not portable in a s/// replacement string, only
in the regex part. backslash-newline helps.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
---
I'm a bit unsure whether you would prefer to avoid breaking the
indentation with something like
tr '|' '\n'
OTOH, \n in a tr set is not universally portable either (for example
Solaris /usr/ucb/tr mishandles it, and \012 fails on EBCDIC), but
I'm still on my way of finding out the level of portability you
prefer. ;-)
Cheers,
Ralf
git-bisect.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index c18bd32..3aac816 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -276,7 +276,8 @@ exit_if_skipped_commits () {
if expr "$_tried" : ".*[|].*" > /dev/null ; then
echo "There are only 'skip'ped commit left to test."
echo "The first bad commit could be any of:"
- echo "$_tried" | sed -e 's/[|]/\n/g'
+ echo "$_tried" | sed -e 's/[|]/\
+/g'
echo "We cannot bisect more!"
exit 2
fi
--
1.5.3.5.561.g140d
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] Fix sed string regex escaping in module_name.
2007-11-08 21:46 [PATCH 0/3] some shell portability fixes, v2 Ralf Wildenhues
2007-11-08 21:47 ` [PATCH 1/3] Avoid a few unportable, needlessly nested "...`..." Ralf Wildenhues
2007-11-08 21:48 ` [PATCH 2/3] Fix sed script to work with AIX and BSD sed Ralf Wildenhues
@ 2007-11-08 21:48 ` Ralf Wildenhues
2 siblings, 0 replies; 5+ messages in thread
From: Ralf Wildenhues @ 2007-11-08 21:48 UTC (permalink / raw)
To: git
When escaping a string to be used as a sed regex, it is important
to only escape active characters. Escaping other characters is
undefined according to POSIX, and in practice leads to issues with
extensions such as GNU sed's \+.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
---
git-submodule.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 1c656be..82ac28f 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -74,7 +74,7 @@ resolve_relative_url ()
module_name()
{
# Do we have "submodule.<something>.path = $1" defined in .gitmodules file?
- re=$(printf '%s' "$1" | sed -e 's/\([^a-zA-Z0-9_]\)/\\\1/g')
+ re=$(printf '%s' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
name=$( GIT_CONFIG=.gitmodules \
git config --get-regexp '^submodule\..*\.path$' |
sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
--
1.5.3.5.561.g140d
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-11-08 22:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08 21:46 [PATCH 0/3] some shell portability fixes, v2 Ralf Wildenhues
2007-11-08 21:47 ` [PATCH 1/3] Avoid a few unportable, needlessly nested "...`..." Ralf Wildenhues
2007-11-08 21:48 ` [PATCH 2/3] Fix sed script to work with AIX and BSD sed Ralf Wildenhues
2007-11-08 22:15 ` Benoit Sigoure
2007-11-08 21:48 ` [PATCH 3/3] Fix sed string regex escaping in module_name Ralf Wildenhues
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).