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.9 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 5A6DC207E4 for ; Fri, 28 Apr 2017 22:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1035998AbdD1WdS (ORCPT ); Fri, 28 Apr 2017 18:33:18 -0400 Received: from [192.252.130.194] ([192.252.130.194]:26925 "EHLO cubert.xiplink.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1035260AbdD1WdQ (ORCPT ); Fri, 28 Apr 2017 18:33:16 -0400 Received: from xiplink.com (rincewind.xiplink.com [10.10.1.32]) by cubert.xiplink.com (Postfix) with ESMTP id DD0B761824; Fri, 28 Apr 2017 18:33:13 -0400 (EDT) From: Marc Branchaud To: git@vger.kernel.org Cc: Michael Haggerty , Jeff King , Stefan Beller Subject: [PATCHv2 1/3] diff: make the indent heuristic part of diff's basic configuration Date: Fri, 28 Apr 2017 18:33:13 -0400 Message-Id: <20170428223315.17140-2-marcnarc@xiplink.com> X-Mailer: git-send-email 2.13.0.rc1.15.gf67d331ad In-Reply-To: <20170428223315.17140-1-marcnarc@xiplink.com> References: <20170427205037.1787-1-marcnarc@xiplink.com> <20170428223315.17140-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 11eef1c85..da96577ea 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