git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <bebarino@gmail.com>
To: git@vger.kernel.org
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] pull: replace unnecessary sed invocation
Date: Wed, 17 Mar 2010 22:10:45 -0700	[thread overview]
Message-ID: <1268889045-21751-1-git-send-email-bebarino@gmail.com> (raw)

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


             reply	other threads:[~2010-03-18  5:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18  5:10 Stephen Boyd [this message]
2010-03-18 13:30 ` [PATCH] pull: replace unnecessary sed invocation Gabriel Filion
2010-03-18 14:46   ` Brandon Casey
2010-03-18 14:48   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268889045-21751-1-git-send-email-bebarino@gmail.com \
    --to=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).