git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH v2] add -p: fix 2.17.0-rc* regression due to moved code
Date: Sat, 31 Mar 2018 22:00:26 -0700	[thread overview]
Message-ID: <xmqqbmf31pxx.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180331125058.4506-1-avarab@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Sat, 31 Mar 2018 12:50:58 +0000")

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
> index d190469cd8..c1f52e457f 100755
> --- a/git-add--interactive.perl
> +++ b/git-add--interactive.perl
> @@ -1561,13 +1561,13 @@ sub patch_update_file {
>  			elsif ($line =~ m|^/(.*)|) {
>  				my $regex = $1;
>  				unless ($other =~ m|/|) {
>  					error_msg __("No other hunks to search\n");
>  					next;
>  				}
> -				if ($1 eq "") {
> +				if ($regex eq "") {
>  					print colored $prompt_color, __("search for regex? ");

Ah.  That "unless ... { }" thing is what was inserted recently, and
the patch is an obvious fix once the problem is pointed out.  Thanks
for a careful reading.

It makes me wonder what the original author, who already captured $1
in $regex, was thinking when he wrote the comparison with $1 there,
but that is OK---ithappend long time ago in early 2009.

Will apply.  Thanks.

>  					$regex = <STDIN>;
>  					if (defined $regex) {
>  						chomp $regex;
>  					}
>  				}

  parent reply	other threads:[~2018-04-01  5:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 10:32 [PATCH 0/3] add -p: improve help messages Phillip Wood
2018-02-13 10:32 ` [PATCH 1/3] add -p: only display help for active keys Phillip Wood
2018-02-13 10:32 ` [PATCH 2/3] add -p: Only bind search key if there's more than one hunk Phillip Wood
2018-03-31 12:36   ` [PATCH] add -p: fix 2.17.0-rc* regression due to moved code Ævar Arnfjörð Bjarmason
2018-03-31 12:50     ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2018-03-31 16:26       ` Phillip Wood
2018-03-31 17:13         ` Ævar Arnfjörð Bjarmason
2018-04-01  5:00       ` Junio C Hamano [this message]
2018-02-13 10:32 ` [PATCH 3/3] add -p: improve error messages Phillip Wood

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqbmf31pxx.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@dunelm.org.uk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).