All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: "Michael J Gruber" <git@drmicha.warpmail.net>,
	"Torsten Bögershausen" <tboegi@web.de>,
	"Anders Kaseorg" <andersk@mit.edu>, "Jeff King" <peff@peff.net>
Subject: Re: [PATCH] rebase -p: avoid grep on potentailly non-ASCII data
Date: Tue, 08 Mar 2016 15:36:26 -0800	[thread overview]
Message-ID: <xmqqegbkk0ed.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqqio0wk151.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Tue, 08 Mar 2016 15:20:26 -0800")

Subject: rebase-i: clarify "is this commit relevant" test

While I was checking all the call sites of sane_grep and sane_egrep,
I noticed this one is somewhat strangely written.  The lines in the
file sane_grep works on all begin with 40-hex object name, so there
is no real risk of confusing "test $(...) = ''" by finding something
that begins with a dash, but using the status from sane_grep makes
it a lot clearer what is going on.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * By the way, if we are going to take that @@SANE_TEXT_GREP@@
   patch, we'd need to add $(SANE_TEXT_GREP) to SCRIPT_DEFINES
   in Makefile to force git-sh-setup to be regenerated when its
   setting changes.

 git-rebase--interactive.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index c0cfe88..4cde685 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -1233,7 +1233,8 @@ then
 	git rev-list $revisions |
 	while read rev
 	do
-		if test -f "$rewritten"/$rev && test "$(sane_grep "$rev" "$state_dir"/not-cherry-picks)" = ""
+		if test -f "$rewritten"/$rev &&
+		   ! sane_grep "$rev" "$state_dir"/not-cherry-picks >/dev/null
 		then
 			# Use -f2 because if rev-list is telling us this commit is
 			# not worthwhile, we don't want to track its multiple heads,

  reply	other threads:[~2016-03-08 23:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08  7:59 [PATCH] rebase -p: avoid grep on potentailly non-ASCII data Anders Kaseorg
2016-03-08 12:25 ` Torsten Bögershausen
2016-03-08 13:45   ` Michael J Gruber
2016-03-08 14:35     ` Jeff King
2016-03-08 23:20       ` Junio C Hamano
2016-03-08 23:36         ` Junio C Hamano [this message]
2016-03-09  0:11           ` Jeff King
2016-03-09  0:10         ` Jeff King
2016-03-09  2:31         ` Anders Kaseorg
2016-03-09 20:26           ` Junio C Hamano
2016-03-10  7:42             ` Torsten Bögershausen
2016-03-10 17:22               ` Junio C Hamano

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=xmqqegbkk0ed.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=andersk@mit.edu \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=tboegi@web.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.