{"thread":{"id":"26922","subject":"[PATCH] parse-remote: replace unnecessary sed invocation","startedAt":"2011-03-30T08:48:40Z","lastAt":"2011-03-31T02:31:48Z","messageCount":4,"participants":["Stephen Boyd","Michael Schubert","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"164671","messageId":"1301474920-6718-1-git-send-email-bebarino@gmail.com","threadId":"26922","inReplyTo":null,"subject":"[PATCH] parse-remote: replace unnecessary sed invocation","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2011-03-30T08:48:40Z","receivedAt":"2011-03-30T08:48:40Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Just use parameter expansion instead.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n\nCleaning out the attic.\n\n git-parse-remote.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex e7013f7..9168879 100644\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -5,7 +5,8 @@\n GIT_DIR=$(git rev-parse -q --git-dir) || :;\n \n get_default_remote () {\n-\tcurr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')\n+\tcurr_branch=$(git symbolic-ref -q HEAD)\n+\tcurr_branch=\"${cur_branch#refs/heads/}\"\n \torigin=$(git config --get \"branch.$curr_branch.remote\")\n \techo ${origin:-origin}\n }\n-- \n1.7.4.2.422.g537d99\n"},{"id":"164702","messageId":"AANLkTikBD4T3hdyT2h=2dzw-QO1BnBp3eT=WGj5s5dC3@mail.gmail.com","threadId":"26922","inReplyTo":"1301474920-6718-1-git-send-email-bebarino@gmail.com","subject":"Re: [PATCH] parse-remote: replace unnecessary sed invocation","fromName":"Michael Schubert","fromEmail":"mschub@elegosoft.com","sentAt":"2011-03-30T18:31:08Z","receivedAt":"2011-03-30T18:31:08Z","isPatch":true,"sender":{"key":"mschub@elegosoft.com","avatar":null},"body":"> +       curr_branch=$(git symbolic-ref -q HEAD)\n> +       curr_branch=\"${cur_branch#refs/heads/}\"\n                                           ^^^\n\n\n\n-- \nms\n"},{"id":"164738","messageId":"AANLkTin3R8ApTZ97Cw67dN7_s_ycX8sQThypMq2N6eJi@mail.gmail.com","threadId":"26922","inReplyTo":"AANLkTikBD4T3hdyT2h=2dzw-QO1BnBp3eT=WGj5s5dC3@mail.gmail.com","subject":"Re: [PATCH] parse-remote: replace unnecessary sed invocation","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2011-03-31T01:02:08Z","receivedAt":"2011-03-31T01:02:08Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Wed, Mar 30, 2011 at 11:31 AM, Michael Schubert <mschub@elegosoft.com> wrote:\n>> +       curr_branch=$(git symbolic-ref -q HEAD)\n>> +       curr_branch=\"${cur_branch#refs/heads/}\"\n>                                           ^^^\n\nAh! How did this pass the test suite... Anyway, looks like Junio\napplied this patch to maint already :-( Sorry.\n\nJunio, please apply this (probably word wrapped since this is gmail\ninterface) and drop your trust level of me by a few points.\n\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 9168879..ea093d2 100644\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -6,7 +6,7 @@ GIT_DIR=$(git rev-parse -q --git-dir) || :;\n\n get_default_remote () {\n        curr_branch=$(git symbolic-ref -q HEAD)\n-       curr_branch=\"${cur_branch#refs/heads/}\"\n+       curr_branch=\"${curr_branch#refs/heads/}\"\n        origin=$(git config --get \"branch.$curr_branch.remote\")\n        echo ${origin:-origin}\n }\n"},{"id":"164754","messageId":"7vlizwkokr.fsf@alter.siamese.dyndns.org","threadId":"26922","inReplyTo":"AANLkTin3R8ApTZ97Cw67dN7_s_ycX8sQThypMq2N6eJi@mail.gmail.com","subject":"Re: [PATCH] parse-remote: replace unnecessary sed invocation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-03-31T02:31:48Z","receivedAt":"2011-03-31T02:31:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> On Wed, Mar 30, 2011 at 11:31 AM, Michael Schubert <mschub@elegosoft.com> wrote:\n>>> +       curr_branch=$(git symbolic-ref -q HEAD)\n>>> +       curr_branch=\"${cur_branch#refs/heads/}\"\n>>                                           ^^^\n>\n> Ah! How did this pass the test suite... Anyway, looks like Junio\n> applied this patch to maint already :-( Sorry.\n\nHeh, I was wondering what those three carets under ads in \"#refs/heads/\"\nwas pointing at, and didn't see you had only one R in the variable name.\n\nThanks for a correction, and Michael, please be a bit more specific (and\npoint the correct part with your carret) when you send your messages.\n\n> Junio, please apply this (probably word wrapped since this is gmail\n> interface) and drop your trust level of me by a few points.\n>\n> diff --git a/git-parse-remote.sh b/git-parse-remote.sh\n> index 9168879..ea093d2 100644\n> --- a/git-parse-remote.sh\n> +++ b/git-parse-remote.sh\n> @@ -6,7 +6,7 @@ GIT_DIR=$(git rev-parse -q --git-dir) || :;\n>\n>  get_default_remote () {\n>         curr_branch=$(git symbolic-ref -q HEAD)\n> -       curr_branch=\"${cur_branch#refs/heads/}\"\n> +       curr_branch=\"${curr_branch#refs/heads/}\"\n>         origin=$(git config --get \"branch.$curr_branch.remote\")\n>         echo ${origin:-origin}\n>  }\n"}]}