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-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 2B6591F4B4 for ; Fri, 18 Sep 2020 18:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726152AbgIRSCl (ORCPT ); Fri, 18 Sep 2020 14:02:41 -0400 Received: from cloud.peff.net ([104.130.231.41]:33576 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbgIRSCl (ORCPT ); Fri, 18 Sep 2020 14:02:41 -0400 Received: (qmail 11498 invoked by uid 109); 18 Sep 2020 18:02:40 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 18 Sep 2020 18:02:40 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23586 invoked by uid 111); 18 Sep 2020 18:02:40 -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; Fri, 18 Sep 2020 14:02:40 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 18 Sep 2020 14:02:39 -0400 From: Jeff King To: Junio C Hamano Cc: "brian m. carlson" , Thomas Guyot-Sionnest , Taylor Blau , git@vger.kernel.org, Thomas Guyot-Sionnest Subject: Re: [PATCH 2/2] Allow passing pipes for input pipes to diff --no-index Message-ID: <20200918180239.GA186717@coredump.intra.peff.net> References: <20200918113256.8699-1-tguyot@gmail.com> <20200918113256.8699-3-tguyot@gmail.com> <20200918143647.GB1606445@nand.local> <20200918171950.GA183026@coredump.intra.peff.net> 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 Fri, Sep 18, 2020 at 10:48:41AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Getting back to the overall feature, this is definitely something that > > has come up before. The last I know of is: > > > > https://lore.kernel.org/git/20181220002610.43832-1-sandals@crustytoothpaste.net/ > > > > which everybody seemed to like the direction of; I suspect the original > > author (cc'd) just never got around to it again. Compared to this > > approach, it uses a command-line option to avoid dereferencing symlinks. > > That puts an extra burden on the caller to pass the option, but it's way > > less magical; you could drop all of the "does this look like a symlink > > to a pipe" heuristics. It would also be much easier to test. ;) > > Yes, I do remember liking the approach very much and wanted to take > it once the "do not dereference symlinks everywhere---just limit it > to what was given from the command line" was done. > > To be quite honest, I think "git diff --no-index A B" should > unconditionally dereference A and/or B if they are symlinks, whether > they are symlinks to pipes, regular files or directories, and > otherwise treat symlinks in A and B the same way as "git diff" if A > and B are directories. But that is a design guideline that becomes > needed only after we start resurrecting Brian's effort, not with > these patches that started this thread. Yeah, I think I'd be fine with that approach, too. It makes "git diff --no-index" more like other tools out of the box. And if we took brian's patch first, then we'd just be flipping its default, and the option it adds would give an easy escape hatch for somebody who really wants to diff two maybe-symlinks. -Peff