本文介绍了LVDiff无法在Git中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从meta-diff套件中获取lvdiff以与Git一起使用.

I'm trying to get lvdiff from meta-diff suite to work with Git.

我的.gitconfig看起来像这样:

My .gitconfig looks like this:

[gui]
    recentrepo = C:/Users/Tanner/Desktop/FIRST 2010 Beta/Java/LoganRover
[user]
    name = Tanner Smith
    email = [email protected]
[merge "labview"]
    name = LabVIEW 3-Way Merge
    driver = 'C:/Program Files/National Instruments/Shared/LabVIEW Merge/LVMerge.exe' 'C:/Program Files/National Instruments/LabVIEW 8.6/LabVIEW.exe' %O %B %A %A
    recursive = binary
[diff "lvdiff"]
    #command = 'C:/Program Files/meta-diff suite/lvdiff.exe'
    external = C:/Users/Tanner/Desktop/FIRST 2010 Beta/lvdiff.sh
[core]
    autocrlf = true

lvdiff.sh看起来像这样:

lvdiff.sh looks like this:

#!/bin/sh

"C:/Program Files/meta-diff suite/lvdiff.exe" "$2" "%5" | cat

我的.gitattributes文件如下所示:

And my .gitattributes file looks like this:

#Use a cusstom driver to merge LabVIEW files
*.vi merge=labview

#Use lvdiff as the externel diff program for LabVIEW files
*.vi diff=lvdiff

但是每次我做比较时,所有Git返回的都是:

But everytime I do a diff, all Git returns is:

diff --git a/Build DashBoard Data.vi b/Build DashBoard Data.vi
index fd50547..662237f 100644
Binary files a/Build DashBoard Data.vi and b/Build DeashBoard Data.vi differ

就好像它没有使用它,甚至没有意识到我的更改一样.有什么想法吗?

It is like it is not using it or even recognizing my changes. Any ideas?

推荐答案

我没有LabView,但是您的配置中有一些错误.

I do not have LabView, but there are a few bits of your configuration that are wrong.

  1. diff.lvdiff下的外部"设置应命名为命令".
  2. lvdiff.sh中的%"可能应该是"$".
  1. The "external" setting under diff.lvdiff should be named "command".
  2. The "%" in your lvdiff.sh should probably be "$".

在我的计算机(不是Windows,没有LabView)上,使用diff.lvdiff.command,而您的.gitattributes足以让git diff foo.vi运行外部diff驱动程序(我什至使用了路径名称中带有空格的diff驱动程序). diff.lvdiff下的配置错误是为什么您看到"binary file"消息的原因,它是看似二进制文件的默认diff消息.您可能一直在考虑与diff.foo.command相关的diff.external,但它适用于所有的顶点差异,而不仅适用于具有diff=foo属性的路径子集.

On my machine (not Windows, no LabView), using diff.lvdiff.command and your .gitattributes is enough to let git diff foo.vi run the external diff driver (I even used a diff driver with a space in the pathname). The mis-configuration under diff.lvdiff is why you see the "binary file" message, it is the default diff message for files that appear to be binary. You may have been thinking of diff.external, which is related to diff.foo.command, but applies to ALL texual diffs, not just to the subset of paths with a diff=foo attribute.

这篇关于LVDiff无法在Git中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 01:31