Subject: Re: [PATCH v4] contrib git-resurrect: find traces of a branch name and resurrect it

From: Junio C Hamano <[email-masked]>
Date: Thu, 05 Feb 2009 00:38:13 -0800

Thomas Rast <[email-masked]> writes:

> Junio C Hamano wrote:
>> Do you mean something like this?
>> 
>> 	sed -n -e "/^$_x40 $_x40 \($_x40\) Merge .*/ {
>> 		s//\1/p
>>                 q
>>         }"
>
> Yep, precisely.  Thanks!  This indeed gives it a nice speed boost if
> all you want is a topic "resurrection" from pu.
> ...
> +search_merges () {
> +        git rev-list --all --grep="Merge branch '$1'" \
> +                --pretty=tformat:"%P %s" |
> +        sed -ne "/^$_x40 \($_x40\) Merge .*/ {s//\1/p;$early_exit}"
> +}

Will apply, but just to let you know, I wrote my example on separate lines
(and with separate -n and -e options for that matter) for a reason.  I
recall some implementation of sed (perhaps older BSDs, but don't quote me
on that) did not understanding semicolon with close brace on the same
line.  It may not be a problem in practice these days, but I do not have
access to many different platforms to check as I used to.