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

[PATCH] pull: replace unnecessary sed invocation

From
Stephen Boyd <bebarino@gmail.com>
Date
Mar 18, 2010, 05:10 UTC
Message-ID
<1268889045-21751-1-git-send-email-bebarino@gmail.com>

Getting the shortened branch name is as easy as using the shell's parameter expansion.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
Saw this while reading the code.
 git-pull.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh
index 38331a8..246a3a4 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -41,7 +41,7 @@ strategy_args= diffstat= no_commit= squash= no_ff= ff_only=
 log_arg= verbosity=
 merge_args=
 curr_branch=$(git symbolic-ref -q HEAD)
-curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
+curr_branch_short="${curr_branch#refs/heads/}"
 rebase=$(git config --bool branch.$curr_branch_short.rebase)
 while :
 do
-- 
1.7.0.2.276.g60daf
Next: Gabriel Filion
Message 1 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.