From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C50201FC44 for ; Mon, 8 May 2017 16:03:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751536AbdEHQDl (ORCPT ); Mon, 8 May 2017 12:03:41 -0400 Received: from [192.252.130.194] ([192.252.130.194]:63505 "EHLO cubert.xiplink.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751156AbdEHQDk (ORCPT ); Mon, 8 May 2017 12:03:40 -0400 Received: from xiplink.com (rincewind.xiplink.com [10.10.1.32]) by cubert.xiplink.com (Postfix) with ESMTP id B53046034A; Mon, 8 May 2017 12:03:39 -0400 (EDT) From: Marc Branchaud To: git@vger.kernel.org, Junio C Hamano Cc: Jeff King , Stefan Beller , Michael Haggerty , =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Subject: [PATCH v4 1/4] diff: make the indent heuristic part of diff's basic configuration Date: Mon, 8 May 2017 12:03:36 -0400 Message-Id: <20170508160339.4551-2-marcnarc@xiplink.com> X-Mailer: git-send-email 2.13.0.rc1.15.gf67d331ad In-Reply-To: <20170508160339.4551-1-marcnarc@xiplink.com> References: <20170508160339.4551-1-marcnarc@xiplink.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This heuristic was originally introduced as an experimental feature, and therefore part of the UI configuration. But the user often sees diffs generated by plumbing commands like diff-tree. Moving the indent heuristic into diff's basic configuration prepares the way for diff plumbing commands to respect the setting. The heuristic itself merely makes the diffs more aesthetically pleasing, without changing their correctness. Scripts that rely on the diff plumbing commands should not care whether or not the heuristic is employed. Signed-off-by: Marc Branchaud --- diff.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diff.c b/diff.c index 74283d900..b6e3ffe92 100644 --- a/diff.c +++ b/diff.c @@ -290,9 +290,6 @@ int git_diff_ui_config(const char *var, const char *value, void *cb) return 0; } - if (git_diff_heuristic_config(var, value, cb) < 0) - return -1; - if (!strcmp(var, "diff.wserrorhighlight")) { int val = parse_ws_error_highlight(value); if (val < 0) @@ -351,6 +348,9 @@ int git_diff_basic_config(const char *var, const char *value, void *cb) if (starts_with(var, "submodule.")) return parse_submodule_config_option(var, value); + if (git_diff_heuristic_config(var, value, cb) < 0) + return -1; + return git_default_config(var, value, cb); } -- 2.13.0.rc1.15.gf67d331ad