git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Wesley <wesleys@opperschaap.net>
Cc: git@vger.kernel.org
Subject: Re: [[PATCH v2]] Fix bug when more than one readline instance is used
Date: Thu, 10 Aug 2023 22:30:17 -0700	[thread overview]
Message-ID: <xmqqwmy2no2e.fsf@gitster.g> (raw)
In-Reply-To: <8d683835-31d4-41f0-9d4e-90c95acbea28@opperschaap.net> (Wesley's message of "Thu, 10 Aug 2023 21:09:52 -0400")

Wesley <wesleys@opperschaap.net> writes:

> On 8/10/23 21:01, Junio C Hamano wrote:
>> Wesley Schwengle <wesleys@opperschaap.net> writes:
>> This line with "};" on it should not be added, I think.
>> cf. https://github.com/git/git/actions/runs/5827208598/job/15802787783#step:5:74
>> 
>>> +		return $term;
>>>   	}
>>>   }
>>   git-svn.perl | 1 -
>>   1 file changed, 1 deletion(-)
>> diff --git a/git-svn.perl b/git-svn.perl
>> index 93f6538d61..e919c3f172 100755
>> --- a/git-svn.perl
>> +++ b/git-svn.perl
>> @@ -307,7 +307,6 @@ package main;
>>   		$term = $ENV{"GIT_SVN_NOTTY"}
>>   				? new Term::ReadLine 'git-svn', \*STDIN, \*STDOUT
>>   				: new Term::ReadLine 'git-svn';
>> -		};
>>   		return $term;
>>   	}
>>   }
>
> You are 100% correct.

And embarrassingly, the above is not sufficient, as the way $term is
used in git-send-email and git-svn are subtly different.

I think we further need something like this on top, but my Perl is
rusty.

diff --git a/git-svn.perl b/git-svn.perl
index e919c3f172..6033b97a0c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -427,7 +427,7 @@ sub ask {
 	my $default = $arg{default};
 	my $resp;
 	my $i = 0;
-	term_init() unless $term;
+	my $term = term_init();
 
 	if ( !( defined($term->IN)
             && defined( fileno($term->IN) )
-- 
2.42.0-rc1


  reply	other threads:[~2023-08-11  5:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  0:39 [PATCH] Fix bug when more than one readline instance is used Wesley Schwengle
2023-08-10  0:49 ` Jeff King
2023-08-10  1:18   ` [[PATCH v2]] " Wesley Schwengle
2023-08-10 14:31     ` Junio C Hamano
2023-08-10 15:14       ` Wesley
2023-08-11  1:01     ` Junio C Hamano
2023-08-11  1:09       ` Wesley
2023-08-11  5:30         ` Junio C Hamano [this message]
2023-08-11 14:51           ` Jeff King
2023-08-11 16:05             ` Junio C Hamano
2023-08-30 22:32               ` [PATCH] git-svn: drop FakeTerm hack Junio C Hamano
2023-08-31  0:13                 ` Jeff King
2023-08-31  0:28                   ` Junio C Hamano
2023-08-10  1:05 ` [PATCH] Fix bug when more than one readline instance is used 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=xmqqwmy2no2e.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=wesleys@opperschaap.net \
    /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).