2014-08-27 43 views
2

在IBM i計算機(fka iSeries)上從bash執行git diff時出現奇怪的輸出。例如,下面有^[[個字符後綴整數。如何在沒有額外繁瑣的情況下將它們顯示爲正常git diff在IBM i操作系統上git diff奇怪字符

^[[1mdiff --git a/libtest/GNUmakefile b/libtest/GNUmakefile^[[m 
^[[1mindex 9e70664..65c3097 100644^[[m 
^[[1m--- a/libtest/GNUmakefile^[[m 
^[[1m+++ b/libtest/GNUmakefile^[[m 
^[[[email protected]@ -153,6 +153,13 @@^[[m ^[[mifneq ($(findstring mingw, $(OS)),)^[[m 
    LIBEXT = dll^[[m 
    PICFLAGS=^[[m 
endif^[[m 
^[[32m+^[[m 
^[[32m+^[[m^[[32mifeq ($(OS), os400)^[[m 
^[[32m+^[[m^[[32m LIBEXT = a^[[m 
^[[32m+^[[m^[[32m SOFLAGS = -shared -static-libgcc^[[m 
^[[32m+^[[m^[[32m PICFLAGS += -pthread^[[m 
^[[32m+^[[m^[[32mendif^[[m 
^[[32m+^[[m 

回答

4

這很可能是由於git着色和IBMi的[(括號)字符的翻譯。

您可以檢查git的着色是否通過運行下面的開啓:

$ git config --list 
[email protected] 
user.name=Aaron Bartell 
color.ui=auto 
core.repositoryformatversion=0 
core.filemode=true 
core.bare=false 
core.logallrefupdates=true 
core.ignorecase=true 

在這種情況下color.ui=auto正在轉向着色上一切。運行以下命令將着色關閉只是git diff

git config --global color.diff false

現在,當你運行git diff它看起來應該如你所期望:

diff --git a/libtest/GNUmakefile b/libtest/GNUmakefile 
index 9e70664..65c3097 100644 
--- a/libtest/GNUmakefile 
+++ b/libtest/GNUmakefile 
@@ -153,6 +153,13 @@ ifneq ($(findstring mingw, $(OS)),) 
    LIBEXT = dll 
    PICFLAGS= 
endif 
+ 
+ifeq ($(OS), os400) 
+ LIBEXT = a 
+ SOFLAGS = -shared -static-libgcc 
+ PICFLAGS += -pthread 
+endif 
+ 
+0

(n)的詛咒再次挫敗! – Hellion 2014-09-05 19:42:57