From: Junio C Hamano Date: Tue, 18 Oct 2011 19:12:45 GMT Subject: Re: [GUILT] handle branches with slashes in guilt-graph Message-ID: <7v39eqglle.fsf@alter.siamese.dyndns.org> In-Reply-To: Andreas Schwab writes: > Per Cederqvist writes: > >> Avoid sed errors when the branch name contains a slash. >> >> Signed-off-by: Per Cederqvist >> >> --- /usr/bin/guilt-graph~ 2011-01-25 20:15:50.000000000 +0100 >> +++ /usr/bin/guilt-graph 2011-10-18 12:30:31.000000000 +0200 >> @@ -37,9 +37,10 @@ disp "digraph G {" >> >> current="$top" >> >> +safebranch=`echo "$branch"|sed 's%/%\\\\/%g'` >> while [ "$current" != "$base" ]; do >> pname=`git show-ref | sed -n -e " >> -/^$current refs\/patches\/$branch/ { >> +/^$current refs\/patches\/$safebranch/ { > > Alternatively, you could change the delimiter to `,': > > \,^$current refs/patches/$branch, { Isn't a comma still valid character in a branch name? The vertical var | is available, though ;-)