Gitk:默认情况下,将“忽略空间更改”选项设置为true

时间:2011-11-22 04:07:57

标签: git git-diff gitk git-config

这有可能吗?我试过git config --global alias.diff 'diff -b -w',但不幸的是,这不是解决方案。

3 个答案:

答案 0 :(得分:6)

它有点老了,但我在前几天用Google搜索发现了这个问题,已经接受的答案给了我一些如何做的提示。

无需修改gitk本身:只需编辑.gitk文件(〜/ .config / git / gitk或〜/ .gitk)并添加:

set ignorespace 1

答案 1 :(得分:5)

这里真正需要的是在UI上保持由checkbutton设置的变量的值。以下补丁实现了这一点。或者您可以在第11475行(set ignorespace 1)强制默认为true。

From 54f9e800fe28cd6d5d0d44d4e2e561263cbf3407 Mon Sep 17 00:00:00 2001
From: Pat Thoyts <patthoyts@users.sourceforge.net>
Date: Tue, 13 Dec 2011 11:39:01 +0000
Subject: [PATCH] gitk: persist the value of the ignorespace setting for
 diffs.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 gitk-git/gitk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 2a92e20..29b18d9 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2653,7 +2653,7 @@ proc savestuff {w} {
     global cmitmode wrapcomment datetimeformat limitdiffs
     global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor
     global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk
-    global hideremotes want_ttk
+    global hideremotes want_ttk ignorespace

     if {$stuffsaved} return
     if {![winfo viewable .]} return
@@ -2690,6 +2690,7 @@ proc savestuff {w} {
        puts $f [list set selectbgcolor $selectbgcolor]
        puts $f [list set extdifftool $extdifftool]
        puts $f [list set perfile_attrs $perfile_attrs]
+       puts $f [list set ignorespace $ignorespace]

        puts $f "set geometry(main) [wm geometry .]"
        puts $f "set geometry(state) [wm state .]"
--
1.7.8.msysgit.0

答案 2 :(得分:4)

注意:现在(2014年9月之后)更新gitk config_variables并添加ignorespace

https://github.com/git/git/commit/9fabefb1f3f658e77eb18afa3f95efe1a0ee8d0d

所有这些都被刷新到.gitk档。

相关问题