{"thread":{"id":"11905","subject":"[PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks","startedAt":"2008-02-05T22:08:06Z","lastAt":"2008-02-06T09:23:06Z","messageCount":7,"participants":["Jari Aalto","Johannes Schindelin","Junio C Hamano","Ralf Wildenhues"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"67563","messageId":"lk5zxdix.fsf@blue.sea.net","threadId":"11905","inReplyTo":null,"subject":"[PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks","fromName":"Jari Aalto","fromEmail":"jari.aalto@cante.net","sentAt":"2008-02-05T22:08:06Z","receivedAt":"2008-02-05T22:08:06Z","isPatch":true,"sender":{"key":"jari.aalto@cante.net","avatar":"https://avatars.githubusercontent.com/u/34601?v=4"},"body":"Use redable $(<command>) syntax instead of backtics in code.  See The\nOpen Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition\n\nSigned-off-by: Jari Aalto <jari.aalto AT cante.net>\n---\n See http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03\n\n git-rebase.sh |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex bdcea0e..d2b329f 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -60,7 +60,7 @@ continue_merge () {\n \t\tdie \"$RESOLVEMSG\"\n \tfi\n \n-\tcmt=`cat \"$dotest/current\"`\n+\tcmt=$(cat \"$dotest/current\")\n \tif ! git diff-index --quiet HEAD --\n \tthen\n \t\tif ! git-commit -C \"$cmt\"\n@@ -75,7 +75,7 @@ continue_merge () {\n \tfi\n \tgit rev-list --pretty=oneline -1 \"$cmt\" | sed -e 's/^[^ ]* //'\n \n-\tprev_head=`git rev-parse HEAD^0`\n+\tprev_head=$(git rev-parse HEAD^0)\n \t# save the resulting commit so we can read-tree on it later\n \techo \"$prev_head\" > \"$dotest/prev_head\"\n \n@@ -233,7 +233,7 @@ do\n \t-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n-\t\t\tstrategy=`expr \"z$1\" : 'z-[^=]*=\\(.*\\)'` ;;\n+\t\t\tstrategy=$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)') ;;\n \t\t1,*)\n \t\t\tusage ;;\n \t\t*)\n@@ -295,7 +295,7 @@ esac\n \n # The upstream head must be given.  Make sure it is valid.\n upstream_name=\"$1\"\n-upstream=`git rev-parse --verify \"${upstream_name}^0\"` ||\n+upstream=$(git rev-parse --verify \"${upstream_name}^0\") ||\n     die \"invalid upstream $upstream_name\"\n \n # Make sure the branch to rebase onto is valid.\n@@ -318,9 +318,9 @@ case \"$#\" in\n \tgit-checkout \"$2\" || usage\n \t;;\n *)\n-\tif branch_name=`git symbolic-ref -q HEAD`\n+\tif branch_name=$(git symbolic-ref -q HEAD)\n \tthen\n-\t\tbranch_name=`expr \"z$branch_name\" : 'zrefs/heads/\\(.*\\)'`\n+\t\tbranch_name=$(expr \"z$branch_name\" : 'zrefs/heads/\\(.*\\)')\n \telse\n \t\tbranch_name=HEAD ;# detached\n \tfi\n@@ -399,7 +399,7 @@ echo \"$orig_head\" > \"$dotest/orig-head\"\n echo \"$head_name\" > \"$dotest/head-name\"\n \n msgnum=0\n-for cmt in `git rev-list --reverse --no-merges \"$upstream\"..ORIG_HEAD`\n+for cmt in $(git rev-list --reverse --no-merges \"$upstream\"..ORIG_HEAD)\n do\n \tmsgnum=$(($msgnum + 1))\n \techo \"$cmt\" > \"$dotest/cmt.$msgnum\"\n-- \n1.5.4-rc5.GIT-dirty\n\n\n-- \nWelcome to FOSS revolution: we fix and modify until it shines\n"},{"id":"67567","messageId":"alpine.LSU.1.00.0802052226340.8543@racer.site","threadId":"11905","inReplyTo":"lk5zxdix.fsf@blue.sea.net","subject":"Re: [PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-05T22:27:45Z","receivedAt":"2008-02-05T22:27:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Feb 2008, Jari Aalto wrote:\n\n> Use redable $(<command>) syntax instead of backtics in code.  See The \n> Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition\n\nSorry, I am not quite sure if this patch is worth it: either you want to \nclean this up in _all_ of our shell scripts, or you leave it.  Or you fix \nit in those parts that you touch anyway, but again leave the rest as-are.\n\nCiao,\nDscho\n"},{"id":"67575","messageId":"abmfxbg3.fsf@blue.sea.net","threadId":"11905","inReplyTo":"alpine.LSU.1.00.0802052226340.8543@racer.site","subject":"Re: [PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks","fromName":"Jari Aalto","fromEmail":"jari.aalto@cante.net","sentAt":"2008-02-05T22:53:00Z","receivedAt":"2008-02-05T22:53:00Z","isPatch":true,"sender":{"key":"jari.aalto@cante.net","avatar":"https://avatars.githubusercontent.com/u/34601?v=4"},"body":"* Tue 2008-02-05 Johannes Schindelin <Johannes.Schindelin@gmx.de>\n* Message-Id: alpine.LSU.1.00.0802052226340.8543@racer.site\n> Hi,\n>\n> On Wed, 6 Feb 2008, Jari Aalto wrote:\n>\n>> Use redable $(<command>) syntax instead of backtics in code.  See The \n>> Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition\n>\n> Sorry, I am not quite sure if this patch is worth it: either you want to \n> clean this up in _all_ of our shell scripts, or you leave it.  \n\nYes, that's the plan. This is just a start.\n\nJari\n\n-- \nWelcome to FOSS revolution: we fix and modify until it shines\n"},{"id":"67577","messageId":"alpine.LSU.1.00.0802052305080.8543@racer.site","threadId":"11905","inReplyTo":"abmfxbg3.fsf@blue.sea.net","subject":"Re: [PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-05T23:06:48Z","receivedAt":"2008-02-05T23:06:48Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Feb 2008, Jari Aalto wrote:\n\n> * Tue 2008-02-05 Johannes Schindelin <Johannes.Schindelin@gmx.de>\n> * Message-Id: alpine.LSU.1.00.0802052226340.8543@racer.site\n>\n> > On Wed, 6 Feb 2008, Jari Aalto wrote:\n> >\n> >> Use redable $(<command>) syntax instead of backtics in code.  See The \n> >> Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition\n> >\n> > Sorry, I am not quite sure if this patch is worth it: either you want \n> > to clean this up in _all_ of our shell scripts, or you leave it.\n> \n> Yes, that's the plan. This is just a start.\n\nAgain, you failed to address me.  FYI my email address is \njohannes.schindelin@gmx.de.  Thank you very much.\n\n\"This is just a start\" is not good enough.  First, you have to defend why \nthis is a good change.  It does not really fix anything.\n\nAnd then you have to do it for all scripts in one go.  Mind you, it is not \nreally complicated: just one call to perl.\n\nHth,\nDscho\n"},{"id":"67594","messageId":"7vhcgm7vdx.fsf@gitster.siamese.dyndns.org","threadId":"11905","inReplyTo":"alpine.LSU.1.00.0802052305080.8543@racer.site","subject":"Re: [PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-06T00:59:06Z","receivedAt":"2008-02-06T00:59:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> And then you have to do it for all scripts in one go.  Mind you, it is not \n> really complicated: just one call to perl.\n\nPlease do not do this.  If other people have pending changes,\n\"cleanup for clean-up's sake\" would create conflicts for no good\nreason.\n\nThere are only two cases such a clean-up patch is good:\n\n (1) When the maintainer is not yet accepting any patches after\n     a release-freeze and there is no pending patches from the\n     community, and/or if you can convince people with pending\n     patches to rebase on top of the clean-up because the\n     current codebase is so unmaintainably bad, then a\n     whole-tree clean-up patch should go in before anything\n     else, forcing everybody to rebase on top of it;\n\n (2) If you will be working on the code in an area, you may want\n     to have the first one in the series a \"pure clean-up and\n     nothing else\" of the whole area, and then build your real\n     changes on top.  You still need to coordinate with people\n     whose patches may get hit by your clean-ups, but you have\n     to do this anyway because you will have conflicts from your\n     \"real changes\".\n\nAny other \"clean-up patch\" would result in a not-so-appreciated\ncode churn.  Please don't encourage it.\n"},{"id":"67603","messageId":"7vve526dts.fsf@gitster.siamese.dyndns.org","threadId":"11905","inReplyTo":"7vhcgm7vdx.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-06T02:03:43Z","receivedAt":"2008-02-06T02:03:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>> And then you have to do it for all scripts in one go.  Mind you, it is not \n>> really complicated: just one call to perl.\n>\n> Please do not do this.  If other people have pending changes,\n> \"cleanup for clean-up's sake\" would create conflicts for no good\n> reason.\n>\n> There are only two cases such a clean-up patch is good:\n>\n>  (1) When the maintainer is not yet accepting any patches after\n>      a release-freeze and there is no pending patches from the\n>      community, and/or if you can convince people with pending\n>      patches to rebase on top of the clean-up because the\n>      current codebase is so unmaintainably bad, then a\n>      whole-tree clean-up patch should go in before anything\n>      else, forcing everybody to rebase on top of it;\n>\n>  (2) If you will be working on the code in an area, you may want\n>      to have the first one in the series a \"pure clean-up and\n>      nothing else\" of the whole area, and then build your real\n>      changes on top.  You still need to coordinate with people\n>      whose patches may get hit by your clean-ups, but you have\n>      to do this anyway because you will have conflicts from your\n>      \"real changes\".\n>\n> Any other \"clean-up patch\" would result in a not-so-appreciated\n> code churn.  Please don't encourage it.\n\nJust to make sure Jari does not get a wrong idea,\n\nMy \"Please don't\" is meant against Johannes's \"Do it all if you\ndo it\".\n\nIf Jari did the patch as the first step of making real changes\nto \"git rebase\" (making -i not forcing -m, perhaps), it is the\nright thing to have a clean-up patch as a preparatory step,\nbefore starting the real work in later patches in the series.\nAnd such a clean-up patch should not inflict useless code churn\non other commands.\n\nSo a single patch only to git-rebase is acceptable if that is\nwhat Jari is planning to do: preparatory clean-up before\nbringing a real improvement in.\n"},{"id":"67636","messageId":"loom.20080206T092136-104@post.gmane.org","threadId":"11905","inReplyTo":"alpine.LSU.1.00.0802052305080.8543@racer.site","subject":"Re: [PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks","fromName":"Ralf Wildenhues","fromEmail":"ralf.wildenhues@gmx.de","sentAt":"2008-02-06T09:23:06Z","receivedAt":"2008-02-06T09:23:06Z","isPatch":true,"sender":{"key":"ralf.wildenhues@gmx.de","avatar":null},"body":"Johannes Schindelin <Johannes.Schindelin <at> gmx.de> writes:\n> > > On Wed, 6 Feb 2008, Jari Aalto wrote:\n> > >\n> > >> Use redable $(<command>) syntax instead of backtics in code.  See The \n> > >> Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition\n\n> And then you have to do it for all scripts in one go.  Mind you, it is not \n> really complicated: just one call to perl.\n\nYou still have to check all backslashes within the changed command; some you\nmay now have to remove.\n\nCheers,\nRalf\n"}]}