From patchwork Wed Oct 10 15:09:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 10634741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81E5969B1 for ; Wed, 10 Oct 2018 15:09:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DD2E28709 for ; Wed, 10 Oct 2018 15:09:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E375291BE; Wed, 10 Oct 2018 15:09:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7924428709 for ; Wed, 10 Oct 2018 15:09:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726933AbeJJWcW (ORCPT ); Wed, 10 Oct 2018 18:32:22 -0400 Received: from mga17.intel.com ([192.55.52.151]:29841 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbeJJWcW (ORCPT ); Wed, 10 Oct 2018 18:32:22 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2018 08:09:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,364,1534834800"; d="scan'208";a="96323519" Received: from vjcarmax-mobl2.amr.corp.intel.com (HELO ldmartin-desk.jf.intel.com) ([10.254.118.37]) by fmsmga004.fm.intel.com with ESMTP; 10 Oct 2018 08:09:34 -0700 From: Lucas De Marchi To: git@vger.kernel.org Cc: Johannes Schindelin , Thomas Gummerer , Eric Sunshine , Junio C Hamano , lucas.de.marchi@gmail.com Subject: [PATCH] range-diff: allow to diff files regardless submodule Date: Wed, 10 Oct 2018 08:09:16 -0700 Message-Id: <20181010150916.4295-1-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.19.1.1.g8c3cf03f71 MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do like it's done in grep so mode doesn't end up as 0160000, which means range-diff doesn't work if one has "submodule.diff = log" in the configuration. Without this while using range-diff I only get a Submodule a 0000000...0000000 (new submodule) instead of the diff between the revisions. Signed-off-by: Lucas De Marchi --- range-diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/range-diff.c b/range-diff.c index 60edb2f518..bd8083f2d1 100644 --- a/range-diff.c +++ b/range-diff.c @@ -354,7 +354,7 @@ static struct diff_filespec *get_filespec(const char *name, const char *p) { struct diff_filespec *spec = alloc_filespec(name); - fill_filespec(spec, &null_oid, 0, 0644); + fill_filespec(spec, &null_oid, 0, 0100644); spec->data = (char *)p; spec->size = strlen(p); spec->should_munmap = 0;