LVDiff 在 Git 中不起作用
我正在尝试从元差异套件中获取 lvdiff 以与 Git 一起使用。
我的 .gitconfig 看起来像这样:
[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 看起来像这样:
#!/bin/sh
"C:/Program Files/meta-diff suite/lvdiff.exe" "$2" "%5" | cat
我的 .gitattributes 文件看起来像这样:
#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 返回的是:
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
就好像它没有使用它,甚至没有识别我的更改。有什么想法吗?
I'm trying to get lvdiff from meta-diff suite to work with Git.
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 looks like this:
#!/bin/sh
"C:/Program Files/meta-diff suite/lvdiff.exe" "$2" "%5" | cat
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
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我没有 LabView,但您的配置有一些错误。
lvdiff.sh
中的“%”可能应该是“$”。在我的机器上(不是Windows,没有LabView),使用
diff.lvdiff.command
和你的.gitattributes
足以让git diff foo.vi
运行外部 diff 驱动程序(我什至使用了路径名中带有空格的 diff 驱动程序)。diff.lvdiff
下的错误配置是您看到“二进制文件”消息的原因,它是看似二进制文件的默认差异消息。您可能一直在考虑diff.external
,它与diff.foo.command
相关,但适用于所有文本差异,而不仅仅是具有diff=foo
属性。I do not have LabView, but there are a few bits of your configuration that are wrong.
lvdiff.sh
should probably be “$”.On my machine (not Windows, no LabView), using
diff.lvdiff.command
and your.gitattributes
is enough to letgit diff foo.vi
run the external diff driver (I even used a diff driver with a space in the pathname). The mis-configuration underdiff.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 ofdiff.external
, which is related todiff.foo.command
, but applies to ALL texual diffs, not just to the subset of paths with adiff=foo
attribute.您的 LVDiff 路径中有一个空格,而您没有将路径包含在引号内(就像使用 LabVIEW 合并一样)。
LVDiff 不允许重复的文件名,也许 Git 将远程文件复制到您的系统并且不重命名该文件。尝试编辑 lvdiff.vi 以重命名两个文件之一(我建议重命名第二个文件。
请参阅一些说明 这里
Your LVDiff has a space in it's path while you don't include the path inside quotes (like you do with the LabVIEW Merge).
LVDiff does not allow duplicate filenames, perhaps Git copies the remote file to your system and does not rename the file. Try editing the lvdiff.vi to rename one of the two files (I suggest to rename the second file.
See some instruction here
这取决于您的虚拟仪器 (VI) 以 LabVIEW
.gitattributes
设置的自定义差异可能不会生效。.gitattributes
手册页 假定仅针对文本文件进行差异,其中可以生成补丁。也许应该定义一个textconv
配置选项来执行.vi
文件到文本表示的转换。)我也遇到了类似的问题尝试在此 SO 答案。
It depends on the size and nature of your virtual instrument (VI) files written in LabVIEW
.gitattributes
might not kick in, I suppose..gitattributes
man page assume a diff only for text files, where a patch can be generated. Maybe atextconv
config option should be defined to perform a conversion of a.vi
file into a textual representation.)I had a similar problem with very small text file while trying to setup a custom merge in this SO answer.
通过省略对应执行合并的实际 LabVIEW 路径的引用,我成功地与 Mercurial 进行了合并:
Ton
I was successfull in doing a Merge with Mercurial by ommitting the reference to the actual LabVIEW path that should perform the Merge:
Ton