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

Re: [PATCH] pull: replace unnecessary sed invocation

From
Gabriel Filion <lelutin@gmail.com>
Date
Mar 18, 2010, 13:30 UTC
Message-ID
<4BA22AEE.8000606@gmail.com>
In-Reply-To
<1268889045-21751-1-git-send-email-bebarino@gmail.com>
On 2010-03-18 01:10, Stephen Boyd wrote:
Show 6 quoted lines
> Getting the shortened branch name is as easy as using the shell's
> parameter expansion.
> 
>  curr_branch=$(git symbolic-ref -q HEAD)
> -curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
> +curr_branch_short="${curr_branch#refs/heads/}"

This modification is a bashism. This syntax is not compatible with other shells.

-- 
Gabriel Filion
Previous: Stephen BoydNext: Brandon Casey
Message 2 of 4 in “pull: replace unnecessary sed invocation”
  1. pull: replace unnecessary sed invocationStephen Boyd, Mar 18, 2010
  2. Gabriel FilionMar 18, 2010
  3. Brandon CaseyMar 18, 2010
  4. Junio C HamanoMar 18, 2010

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.