Gitk:设置“忽略空间更改”选项默认为 true

发布于 2024-12-17 03:56:08 字数 76 浏览 4 评论 0原文

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

Is this possible in any way? I have tried git config --global alias.diff 'diff -b -w' but unfortunately that was not the solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

残龙傲雪 2024-12-24 03:56:08

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

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

set ignorespace 1

It's a bit old but I found that question the other day googling, and the already accepted answer gave me a hint of how to do it.

No need to modify gitk itself: just edit your .gitk file (~/.config/git/gitk or ~/.gitk) and add:

set ignorespace 1
各自安好 2024-12-24 03:56:08

这里真正需要的只是保留 UI 上的复选按钮设置的变量值。以下补丁实现了这一点。或者您可以在第 11475 行强制默认值为 true(setignorespace 1)。

From 54f9e800fe28cd6d5d0d44d4e2e561263cbf3407 Mon Sep 17 00:00:00 2001
From: Pat Thoyts <[email protected]>
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 <[email protected]>
---
 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

All that is really required here is to persist the value of the variable set by the checkbutton on the UI. The following patch achieves this. Or you could just force the default to be true at line 11475 (set ignorespace 1).

From 54f9e800fe28cd6d5d0d44d4e2e561263cbf3407 Mon Sep 17 00:00:00 2001
From: Pat Thoyts <[email protected]>
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 <[email protected]>
---
 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
江湖正好 2024-12-24 03:56:08

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

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

所有这些都刷新到 .gitk 文件。

Note: Now (after Sept 2014) update gitk config_variables and add ignorespace

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

All these are flushed to .gitk file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文