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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 834DF1F54E for ; Wed, 7 Sep 2022 16:25:52 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Owt5oEAc"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbiIGQZs (ORCPT ); Wed, 7 Sep 2022 12:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiIGQZr (ORCPT ); Wed, 7 Sep 2022 12:25:47 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7720D59259 for ; Wed, 7 Sep 2022 09:25:45 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id t11-20020a17090a510b00b001fac77e9d1fso18830445pjh.5 for ; Wed, 07 Sep 2022 09:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:sender:from:to:cc :subject:date; bh=mxV6nBzZbVkItvponi3/2ZUKq2MnnQchYd1FtHAYSwo=; b=Owt5oEAccSHbrpxbxiU8lUQdtJuxvjvwn6+6A8YpmacglgHvFIHpkpvYQdtC134Vx8 UsKKJZiJ6c6tpt+9t6HLRF6MN0R6vMXXD4640647YzvN7R/hV9HybC3CMU6r43nLnMXG PbKU+SXX0abRJ7gZkZUM29FMSb83ax582Hv3NsuWyECIcKV+0fUPAvqnezQ/T9J/h2xC uMqs65rtpvvTBpnSNa7buDC6xiIlha/l2brNeIsbGaMT/SnndrVOeqgaTh+Hluyyk7cp +NdkQM0R5N9AthneC5prTg2wPFvppT09cW6eMi6Q4HT0SJJw8SWb3xvkVslVIxNMWw9s RjkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:sender :x-gm-message-state:from:to:cc:subject:date; bh=mxV6nBzZbVkItvponi3/2ZUKq2MnnQchYd1FtHAYSwo=; b=zn81o+CSkrresL6v01wmdtlQefofZi2FX/oFm17+ekvnuwh84t9yHBXCvKAscsh4Zi yk2OIk/MFMUaqQSV/lU5SNxrkqbiKQCzyhIFm2JqxMqf6huFI9m46yx/bSQHt+DaNB0f hYFw69kGFkQawR/nWBtvKgKXjuCpeptTrJbqwNaySBRkUukiKXK9jFueU7CTmNycNvSh EzpsSIECPK1Bg2F0bsTMX21eCBmIDbT1ZbNK4+glBN1uz2EyQDfFn1EHa7dkJJOJnkhs JJ9ELQ2/OzPuHa8qEhcEckJ477fK1i9BIjiHbHvf5MyA2PweGYrzn30YVb7iASkb6Gi0 boCA== X-Gm-Message-State: ACgBeo2Sj0YGpm1k5YyGUyyAAY9RY3sh6MF7RCoJqRCvwbOyCs+4S0i2 QsBAdq7V4llHy78naqw8JpI= X-Google-Smtp-Source: AA6agR7k66yHB3mK50BOvzhuHdQ0tUYTVw3n/siMk4bz2wkx0V0ND4i6Ia4W9wH7G8MgSg86vqJLmw== X-Received: by 2002:a17:90b:1b12:b0:200:5dbd:adff with SMTP id nu18-20020a17090b1b1200b002005dbdadffmr4980681pjb.43.1662567944872; Wed, 07 Sep 2022 09:25:44 -0700 (PDT) Received: from localhost (33.5.83.34.bc.googleusercontent.com. [34.83.5.33]) by smtp.gmail.com with ESMTPSA id e10-20020a17090301ca00b0016dbdf7b97bsm12610092plh.266.2022.09.07.09.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 09:25:44 -0700 (PDT) Sender: Junio C Hamano From: Junio C Hamano To: =?utf-8?Q?Ren=C3=A9?= Scharfe Cc: Johannes Schindelin , Johannes Schindelin via GitGitGadget , git@vger.kernel.org Subject: Re: [PATCH] tests: replace mingw_test_cmp with a helper in C References: <354qp59q-r4r3-1971-5o09-71q224911orp@tzk.qr> Date: Wed, 07 Sep 2022 09:25:44 -0700 In-Reply-To: (=?utf-8?Q?=22R?= =?utf-8?Q?en=C3=A9?= Scharfe"'s message of "Wed, 7 Sep 2022 14:09:27 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org René Scharfe writes: > "git diff --no-index - -" also doesn't complain, by the way. True, but in this case hopefully it is worth to call it out, as both this code that uses "diff --no-index" and "diff --no-index" itself came from the same author ;-) I think "git diff --no-index - -" should just exit 0 after slurping all its input (i.e. allow it to be placed downstream of a pipe without blocking the upstream), but it is also fine to exit with 0 without reading a single byte from the standard input. Of course the latter is easier to implement ;-) >>> But otherwise the idea is sound. We compare them line by line, >>> using strbuf_getline() to ignore differences in CRLF and LF that >>> originates at 4d715ac0 (Windows: a test_cmp that is agnostic to >>> random LF <> CRLF conversions, 2013-10-26). Only when we find the >>> input different, we use "git diff --no-index" to make the difference >>> (and unfortunately more, as it does not ignore CRLF <> LF >>> differences) visible. > > Why not use "git diff --no-index --ignore-cr-at-eol"? Do you even need > to wrap it? Hmph. That surely sounds sensible if it works, and I offhand do not see why it shouldn't work.