From: Johannes Schindelin Date: Sat, 01 Sep 2007 22:24:39 GMT Subject: Re: [PATCH] rebase--interactive: do not use one-or-more (\+) in sed. Message-ID: In-Reply-To: <7vejhiu565.fsf_-_@gitster.siamese.dyndns.org> Hi, On Sat, 1 Sep 2007, Junio C Hamano wrote: > This is a continuation of the other one to avoid one-or-more operator > in sed. At the same time, it actually tightens error checking, > because the numbers in the squash messages are not padded with > leading zero and cannot begin with 0. > > With this, I think we do not have any more use of one-or-more > (\+) in sed scripts. > > --- > > git-rebase--interactive.sh | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh > index ec798a1..abc2b1c 100755 > --- a/git-rebase--interactive.sh > +++ b/git-rebase--interactive.sh > @@ -190,7 +190,7 @@ nth_string () { > > make_squash_message () { > if test -f "$SQUASH_MSG"; then > - COUNT=$(($(sed -n "s/^# This is [^0-9]*\([0-9]\+\).*/\1/p" \ > + COUNT=$(($(sed -n "s/^# This is [^0-9]*\([1-9][0-9]*\).*/\1/p" \ Looks obviously correct to me... Ack. Ciao, Dscho