Re: [PATCH 1/3] git-bisect: war on "sed"

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/3] git-bisect: war on "sed"

From: Miles Bader <hidden>
Date: 2016-06-15 22:43:51

Junio C Hamano [off-list ref] 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?

-Miles

-- 
[|nurgle|]  ddt- demonic? so quake will have an evil kinda setting? one that
            will  make every christian in the world foamm at the mouth?
[iddt]      nurg, that's the goal

Re: [PATCH 1/3] git-bisect: war on "sed"

From: Wincent Colaiuta <hidden>
Date: 2016-06-15 22:43:51

El 15/11/2007, a las 10:29, Miles Bader escribió:
Junio C Hamano [off-list ref] writes:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help