From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH] MinGW: fix diff --no-index /dev/null ... Date: Sat, 07 Mar 2009 12:15:54 -0800 Message-ID: <7v8wnhnl6t.fsf@gitster.siamese.dyndns.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org, gitster@pobox.com, Johannes Sixt To: Johannes Schindelin X-From: git-owner@vger.kernel.org Sat Mar 07 21:18:45 2009 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lg2yp-0000oJ-Uy for gcvg-git-2@gmane.org; Sat, 07 Mar 2009 21:18:44 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755192AbZCGUQI (ORCPT ); Sat, 7 Mar 2009 15:16:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753673AbZCGUQF (ORCPT ); Sat, 7 Mar 2009 15:16:05 -0500 Received: from a-sasl-quonix.sasl.smtp.pobox.com ([208.72.237.25]:41500 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753799AbZCGUQF (ORCPT ); Sat, 7 Mar 2009 15:16:05 -0500 Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTP id 99A394B08; Sat, 7 Mar 2009 15:16:00 -0500 (EST) Received: from pobox.com (unknown [68.225.240.211]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTPSA id D77614B07; Sat, 7 Mar 2009 15:15:55 -0500 (EST) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Pobox-Relay-ID: C6AED52A-0B54-11DE-9E12-CBE7E3B37BAC-77302942!a-sasl-quonix.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Johannes Schindelin writes: > diff --git a/diff-no-index.c b/diff-no-index.c > index 0a14268..598687b 100644 > --- a/diff-no-index.c > +++ b/diff-no-index.c > @@ -38,6 +38,10 @@ static int get_mode(const char *path, int *mode) > > if (!path || !strcmp(path, "/dev/null")) > *mode = 0; > +#ifdef _WIN32 > + else if (!strcasecmp(path, "nul")) > + *mode = 0; > +#endif > else if (!strcmp(path, "-")) > *mode = create_ce_mode(0666); > else if (lstat(path, &st)) I had a brief "Huh? -- doesn't this call for an is_dev_null() helper" moment, but I think you are right that diff-no-index.c is the right place to special case it. Should this go to 'maint'? > diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh > index 3cf5b5c..f64aa48 100755 > --- a/t/t4012-diff-binary.sh > +++ b/t/t4012-diff-binary.sh > @@ -87,7 +87,7 @@ nul_to_q() { > > test_expect_success 'diff --no-index with binary creation' ' > echo Q | q_to_nul >binary && > - (:# hide error code from diff, which just indicates differences > + (: hide error code from diff, which just indicates differences > git diff --binary --no-index /dev/null binary >current || > true > ) && > -- > 1.6.2.327.g0fa6c