Re: [PATCH v4] contrib git-resurrect: find traces of a branch name and resurrect it
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 5, 2009, 08:38 UTC
- Message-ID
- <7vtz79ffd6.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1233741858-13099-1-git-send-email-trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
Show 16 quoted lines
> 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.