git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <johannes.sixt@telecom.at>
Cc: git@vger.kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH] rebase--interactive: do not use one-or-more (\+) in sed.
Date: Sat, 01 Sep 2007 02:05:22 -0700	[thread overview]
Message-ID: <7vejhiu565.fsf_-_@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vmyw6u5ca.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sat, 01 Sep 2007 02:01:41 -0700")

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" \
 			< "$SQUASH_MSG" | tail -n 1)+1))
 		echo "# This is a combination of $COUNT commits."
 		sed -n "2,\$p" < "$SQUASH_MSG"

  reply	other threads:[~2007-09-01  9:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-01  7:25 [PATCH] rebase -m: Fix incorrect short-logs of already applied commits Johannes Sixt
2007-09-01  9:01 ` Junio C Hamano
2007-09-01  9:05   ` Junio C Hamano [this message]
2007-09-01 22:24     ` [PATCH] rebase--interactive: do not use one-or-more (\+) in sed Johannes Schindelin
2007-09-02  6:53     ` David Kastrup
2007-09-02  7:02       ` Junio C Hamano
2007-09-02  7:20         ` David Kastrup
2007-09-02 13:39         ` Simon 'corecode' Schubert
2007-09-02 14:20           ` Johannes Schindelin
2007-09-02 17:07       ` Nix
2007-09-05 17:54         ` Benoit SIGOURE
2007-09-05 18:06           ` Nix
2007-09-01  9:20   ` [PATCH] rebase -m: Fix incorrect short-logs of already applied commits David Kastrup
2007-09-01 12:06   ` Johannes Sixt
2007-09-01 12:11 ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vejhiu565.fsf_-_@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=johannes.sixt@telecom.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).