git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] parse-remote: replace unnecessary sed invocation

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2011, 02:31 UTC
Message-ID
<7vlizwkokr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTin3R8ApTZ97Cw67dN7_s_ycX8sQThypMq2N6eJi@mail.gmail.com>
Stephen Boyd <bebarino@gmail.com> writes:
Show 7 quoted lines
> On Wed, Mar 30, 2011 at 11:31 AM, Michael Schubert <mschub@elegosoft.com> wrote:
>>> +       curr_branch=$(git symbolic-ref -q HEAD)
>>> +       curr_branch="${cur_branch#refs/heads/}"
>>                                           ^^^
>
> Ah! How did this pass the test suite... Anyway, looks like Junio
> applied this patch to maint already :-( Sorry.

Heh, I was wondering what those three carets under ads in "#refs/heads/" was pointing at, and didn't see you had only one R in the variable name.

Thanks for a correction, and Michael, please be a bit more specific (and point the correct part with your carret) when you send your messages.

Show 16 quoted lines
> Junio, please apply this (probably word wrapped since this is gmail
> interface) and drop your trust level of me by a few points.
>
> diff --git a/git-parse-remote.sh b/git-parse-remote.sh
> index 9168879..ea093d2 100644
> --- a/git-parse-remote.sh
> +++ b/git-parse-remote.sh
> @@ -6,7 +6,7 @@ GIT_DIR=$(git rev-parse -q --git-dir) || :;
>
>  get_default_remote () {
>         curr_branch=$(git symbolic-ref -q HEAD)
> -       curr_branch="${cur_branch#refs/heads/}"
> +       curr_branch="${curr_branch#refs/heads/}"
>         origin=$(git config --get "branch.$curr_branch.remote")
>         echo ${origin:-origin}
>  }
Previous: Stephen Boyd
Message 4 of 4 in “parse-remote: replace unnecessary sed invocation”
  1. parse-remote: replace unnecessary sed invocationStephen Boyd, Mar 30, 2011
  2. Michael SchubertMar 30, 2011
  3. Stephen BoydMar 31, 2011
  4. Junio C HamanoMar 31, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.