git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-svn: drop FakeTerm hack

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2023, 22:32 UTC
Message-ID
<xmqqa5u888lz.fsf_-_@gitster.g>
In-Reply-To
<xmqqjzu1o97n.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
> Jeff King <peff@peff.net> writes:
> ...
>> It could still benefit from cleaning up FakeTerm, since we lazily init
>> the object since 30d45f798d (git-svn: delay term initialization,
>> 2014-09-14). But I don't think there's a visible bug here with the new
>> version of Term::ReadLine::Gnu.
>
> True.  Let me drop the patch from the 'next down to master
> fast-track' candidate status.

We did the above but then everybody seems to have forgotten about it. Let's resurrect the topic. Here is my attempt.

---- >8 ----
From: Wesley Schwengle <wesleys@opperschaap.net>
Subject: [PATCH] git-svn: drop FakeTerm hack

Drop the FakeTerm hack, just like dfd46bae (send-email: drop FakeTerm hack, 2023-08-08) did, for exactly the same reason.

Signed-off-by: Wesley Schwengle <wesleys@opperschaap.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git-svn.perl | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
diff --git c/git-svn.perl w/git-svn.perl
index be987e316f..4e8878f035 100755
--- c/git-svn.perl
+++ w/git-svn.perl
@@ -297,28 +297,12 @@ sub _req_svn {
 		{} ],
 );
 
-package FakeTerm;
-sub new {
-	my ($class, $reason) = @_;
-	return bless \$reason, shift;
-}
-sub readline {
-	my $self = shift;
-	die "Cannot use readline on FakeTerm: $$self";
-}
-package main;
-
 my $term;
 sub term_init {
-	$term = eval {
-		require Term::ReadLine;
-		$ENV{"GIT_SVN_NOTTY"}
+	require Term::ReadLine;
+	$term = $ENV{"GIT_SVN_NOTTY"}
 			? new Term::ReadLine 'git-svn', \*STDIN, \*STDOUT
 			: new Term::ReadLine 'git-svn';
-	};
-	if ($@) {
-		$term = new FakeTerm "$@: going non-interactive";
-	}
 }
 
 my $cmd;
Previous: Junio C HamanoNext: Jeff King
Message 11 of 14 in “Fix bug when more than one readline instance is used”
  1. Fix bug when more than one readline instance is usedWesley Schwengle, Aug 10, 2023
  2. Jeff KingAug 10, 2023
  3. ] Fix bug when more than one readline instance is usedWesley Schwengle, Aug 10, 2023
  4. Junio C HamanoAug 10, 2023
  5. WesleyAug 10, 2023
  6. Junio C HamanoAug 11, 2023
  7. WesleyAug 11, 2023
  8. Junio C HamanoAug 11, 2023
  9. Jeff KingAug 11, 2023
  10. Junio C HamanoAug 11, 2023
  11. git-svn: drop FakeTerm hackJunio C Hamano, Aug 30, 2023
  12. Jeff KingAug 31, 2023
  13. Junio C HamanoAug 31, 2023
  14. Junio C HamanoAug 10, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.