{"thread":{"id":"10742","subject":"[PATCH 0/3] some shell portability fixes, v2","startedAt":"2007-11-08T21:46:25Z","lastAt":"2007-11-08T22:15:32Z","messageCount":5,"participants":["Ralf Wildenhues","Benoit Sigoure"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"58939","messageId":"20071108214624.GF31439@ins.uni-bonn.de","threadId":"10742","inReplyTo":null,"subject":"[PATCH 0/3] some shell portability fixes, v2","fromName":"Ralf Wildenhues","fromEmail":"ralf.wildenhues@gmx.de","sentAt":"2007-11-08T21:46:25Z","receivedAt":"2007-11-08T21:46:25Z","isPatch":true,"sender":{"key":"ralf.wildenhues@gmx.de","avatar":null},"body":"Thanks for all the helpful feedback.  Here's a new series that drops the\n$(()) and test -a/-o patches, and otherwise hopefully incorporates all\nnits.\n\nCheers,\nRalf\n"},{"id":"58940","messageId":"20071108214736.GG31439@ins.uni-bonn.de","threadId":"10742","inReplyTo":"20071108214624.GF31439@ins.uni-bonn.de","subject":"[PATCH 1/3] Avoid a few unportable, needlessly nested \"...`...\".","fromName":"Ralf Wildenhues","fromEmail":"ralf.wildenhues@gmx.de","sentAt":"2007-11-08T21:47:36Z","receivedAt":"2007-11-08T21:47:36Z","isPatch":true,"sender":{"key":"ralf.wildenhues@gmx.de","avatar":null},"body":"\nSigned-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>\n---\n git-rebase--interactive.sh |    2 +-\n git-request-pull.sh        |    6 +++---\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 6d14092..66c80d4 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -392,7 +392,7 @@ do\n \t-s|--strategy)\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n-\t\t\tSTRATEGY=\"-s `expr \"z$1\" : 'z-[^=]*=\\(.*\\)'`\" ;;\n+\t\t\tSTRATEGY=\"-s \"$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)') ;;\n \t\t1,*)\n \t\t\tusage ;;\n \t\t*)\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex 90d969c..068f5e0 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -25,13 +25,13 @@ headrev=`git rev-parse --verify \"$head\"^0` || exit\n merge_base=`git merge-base $baserev $headrev` ||\n die \"fatal: No commits in common between $base and $head\"\n \n-url=\"`get_remote_url \"$url\"`\"\n-branch=`git peek-remote \"$url\" \\\n+url=$(get_remote_url \"$url\")\n+branch=$(git peek-remote \"$url\" \\\n \t| sed -n -e \"/^$headrev\trefs.heads./{\n \t\ts/^.*\trefs.heads.//\n \t\tp\n \t\tq\n-\t}\"`\n+\t}\")\n if [ -z \"$branch\" ]; then\n \techo \"warn: No branch of $url is at:\" >&2\n \tgit log --max-count=1 --pretty='format:warn:   %h: %s' $headrev >&2\n-- \n1.5.3.5.561.g140d\n"},{"id":"58941","messageId":"20071108214824.GH31439@ins.uni-bonn.de","threadId":"10742","inReplyTo":"20071108214624.GF31439@ins.uni-bonn.de","subject":"[PATCH 2/3] Fix sed script to work with AIX and BSD sed.","fromName":"Ralf Wildenhues","fromEmail":"ralf.wildenhues@gmx.de","sentAt":"2007-11-08T21:48:24Z","receivedAt":"2007-11-08T21:48:24Z","isPatch":true,"sender":{"key":"ralf.wildenhues@gmx.de","avatar":null},"body":"\\n is not portable in a s/// replacement string, only\nin the regex part.  backslash-newline helps.\n\nSigned-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>\n---\nI'm a bit unsure whether you would prefer to avoid breaking the\nindentation with something like\n  tr '|' '\\n'\n\nOTOH, \\n in a tr set is not universally portable either (for example\nSolaris /usr/ucb/tr mishandles it, and \\012 fails on EBCDIC), but\nI'm still on my way of finding out the level of portability you\nprefer.  ;-)\n\nCheers,\nRalf\n\n git-bisect.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex c18bd32..3aac816 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -276,7 +276,8 @@ exit_if_skipped_commits () {\n \tif expr \"$_tried\" : \".*[|].*\" > /dev/null ; then\n \t\techo \"There are only 'skip'ped commit left to test.\"\n \t\techo \"The first bad commit could be any of:\"\n-\t\techo \"$_tried\" | sed -e 's/[|]/\\n/g'\n+\t\techo \"$_tried\" | sed -e 's/[|]/\\\n+/g'\n \t\techo \"We cannot bisect more!\"\n \t\texit 2\n \tfi\n-- \n1.5.3.5.561.g140d\n"},{"id":"58942","messageId":"20071108214849.GI31439@ins.uni-bonn.de","threadId":"10742","inReplyTo":"20071108214624.GF31439@ins.uni-bonn.de","subject":"[PATCH 3/3] Fix sed string regex escaping in module_name.","fromName":"Ralf Wildenhues","fromEmail":"ralf.wildenhues@gmx.de","sentAt":"2007-11-08T21:48:49Z","receivedAt":"2007-11-08T21:48:49Z","isPatch":true,"sender":{"key":"ralf.wildenhues@gmx.de","avatar":null},"body":"When escaping a string to be used as a sed regex, it is important\nto only escape active characters.  Escaping other characters is\nundefined according to POSIX, and in practice leads to issues with\nextensions such as GNU sed's \\+.\n\nSigned-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>\n---\n git-submodule.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 1c656be..82ac28f 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -74,7 +74,7 @@ resolve_relative_url ()\n module_name()\n {\n \t# Do we have \"submodule.<something>.path = $1\" defined in .gitmodules file?\n-\tre=$(printf '%s' \"$1\" | sed -e 's/\\([^a-zA-Z0-9_]\\)/\\\\\\1/g')\n+\tre=$(printf '%s' \"$1\" | sed -e 's/[].[^$\\\\*]/\\\\&/g')\n \tname=$( GIT_CONFIG=.gitmodules \\\n \t\tgit config --get-regexp '^submodule\\..*\\.path$' |\n \t\tsed -n -e 's|^submodule\\.\\(.*\\)\\.path '\"$re\"'$|\\1|p' )\n-- \n1.5.3.5.561.g140d\n"},{"id":"58946","messageId":"D42380BD-64A7-4686-9EC1-39F76D0C35D6@lrde.epita.fr","threadId":"10742","inReplyTo":"20071108214824.GH31439@ins.uni-bonn.de","subject":"Re: [PATCH 2/3] Fix sed script to work with AIX and BSD sed.","fromName":"Benoit Sigoure","fromEmail":"tsuna@lrde.epita.fr","sentAt":"2007-11-08T22:15:32Z","receivedAt":"2007-11-08T22:15:32Z","isPatch":true,"sender":{"key":"tsunanet@gmail.com","avatar":"https://avatars.githubusercontent.com/u/128281?v=4"},"body":"On Nov 8, 2007, at 10:48 PM, Ralf Wildenhues wrote:\n\n> diff --git a/git-bisect.sh b/git-bisect.sh\n> index c18bd32..3aac816 100755\n> --- a/git-bisect.sh\n> +++ b/git-bisect.sh\n> @@ -276,7 +276,8 @@ exit_if_skipped_commits () {\n>  \tif expr \"$_tried\" : \".*[|].*\" > /dev/null ; then\n>  \t\techo \"There are only 'skip'ped commit left to test.\"\n>  \t\techo \"The first bad commit could be any of:\"\n> -\t\techo \"$_tried\" | sed -e 's/[|]/\\n/g'\n> +\t\techo \"$_tried\" | sed -e 's/[|]/\\\n\nJust out of curiosity, is there any valid reason to use `[' and `]'  \nin this RE?  By default sed does not use extended RE (at least none  \nof the implementation I know of) so why not just use sed 's/|/...' ?\n\n> +/g'\n>  \t\techo \"We cannot bisect more!\"\n>  \t\texit 2\n>  \tfi\n\n-- \nBenoit Sigoure aka Tsuna\nEPITA Research and Development Laboratory\n\n\n"}]}