Re: [PATCH 1/3] git-bisect: war on "sed"
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Nov 15, 2007, 09:36 UTC
- Message-ID
- <995F69D5-4ABC-44E7-BA2B-5E276479EDA1@wincent.com>
- In-Reply-To
- <buozlxfeu0z.fsf@dhapc248.dev.necel.com>
El 15/11/2007, a las 10:29, Miles Bader escribió:
Show 6 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: >> We do not need to pipe "echo" to "sed" only to strip refs/heads/ >> from the beginning. We are assuming not-so-ancient shells these >> days. > > What's wrong with sed?
Nothing, but using it means forking a new process unnecessarily, and the shorter form without sed is arguably more readable:
- echo "$head" | sed 's#^refs/heads/##' >"$GIT_DIR/head-name" + echo "${head#refs/heads/}" >"$GIT_DIR/head-name"
Cheers, Wincent