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=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 C5DBE1F5AE for ; Tue, 11 May 2021 06:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbhEKGiS (ORCPT ); Tue, 11 May 2021 02:38:18 -0400 Received: from cloud.peff.net ([104.130.231.41]:50230 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbhEKGiP (ORCPT ); Tue, 11 May 2021 02:38:15 -0400 Received: (qmail 21418 invoked by uid 109); 11 May 2021 06:37:09 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 11 May 2021 06:37:09 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 20741 invoked by uid 111); 11 May 2021 06:37:11 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 11 May 2021 02:37:11 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 11 May 2021 02:37:08 -0400 From: Jeff King To: Junio C Hamano 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 Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, May 11, 2021 at 03:17:13PM +0900, Junio C Hamano wrote: > >> 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. > > > > Yes, though even in "git am", we forbid using interactive mode with > > patches on stdin (and did so even when we were reading from the tty; > > presumably the rule dates back to when it was a shell script and was > > using stdin). > > As long as the "prompt and accept an single-line answer from the end > user" is restricted to "git am -i", I'll be perfectly OK with that. > I just do not want my regular "type '|' in my MUA to pipe the > current article to a command, and give 'git am -s' as the command" > workflow to get broken in the future when somebody blindly follows a > carelessly written direction to use a helper that reads from the > standard input for confirmation. The condition under which use of > that helper is appropriate needs to be clearly spelled out. Yeah, I don't think anybody is proposing to change the behavior of "git am" here (we might swap out the current fgets(stdin) for a helper which does the equivalent). But I agree that any comment recommending one versus the other should probably remind people to think about how stdin is otherwise used in the program, and whether that will cause any conflicts. -Peff