From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id DD6911F5AE for ; Tue, 11 May 2021 03:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbhEKDjS (ORCPT ); Mon, 10 May 2021 23:39:18 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:61027 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbhEKDjR (ORCPT ); Mon, 10 May 2021 23:39:17 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 85400BF5FB; Mon, 10 May 2021 23:38:11 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=DOoXDXan7urFEWCBSS0upW8Z1U06uhA0SXu27c k/7Yo=; b=hYCpSONc4e5TBGTZpM9TJ2mE/ODmpEcgqUIqTkpZxRbA4TBwoQAQ2d xv16ax4obWggKEv+W8NsR1PYljZhfnSAM+iHKWUwZ2hZjE1uTDl+x/cUFYPFs5qD cPWRDeKVB1tW0AWdiKsFDbBapMaZBvUfYwMuwAossnmqU5WbujiNY= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 6BF0EBF5FA; Mon, 10 May 2021 23:38:11 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id D1918BF5F9; Mon, 10 May 2021 23:38:10 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: Firmin Martin , git@vger.kernel.org, Johannes Schindelin , Erik Faye-Lund , Denton Liu Subject: Re: [PATCH v1 1/8] compat/terminal: let prompt accept input from pipe References: <20210506165102.123739-1-firminmartin24@gmail.com> <20210506165102.123739-2-firminmartin24@gmail.com> <875yzrgr1f.fsf@Inspiron.i-did-not-set--mail-host-address--so-tickle-me> Date: Tue, 11 May 2021 12:38:10 +0900 In-Reply-To: (Jeff King's message of "Mon, 10 May 2021 17:32:13 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 4EF18EFA-B20A-11EB-8105-74DE23BA3BAF-77302942!pb-smtp2.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > On Mon, May 10, 2021 at 06:18:36AM +0200, Firmin Martin wrote: > >> > Looking at the second patch, the motivation here seems to be to use >> > git_prompt() for another run-of-the-mill prompt. But the right answer >> > is: don't do that. In fact, we recently-ish removed a similar case in >> > 97387c8bdd (am: read interactive input from stdin, 2019-05-20) that was >> > likewise causing problems with the test suite. >> >> I actually inspired myself from the two occurrences of git_prompt in >> builtin/bisect--helper.c introduced in 09535f056b (bisect--helper: >> reimplement `bisect_autostart` shell function in C, 2020-09-24). >> Not sure if they should also be converted to a simple fgets. > > Yes, I think they should be switched. OK, that is because in the context of a "bisect" session, we won't be feeding any real data from its standard input, unlike "git am" that may well be eating a patch stream from its standard input stream. If so, makes sense.