LVDiff 在 Git 中不起作用

发布于 2024-08-16 06:00:49 字数 1365 浏览 9 评论 0原文

我正在尝试从元差异套件中获取 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 技术交流群。

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

发布评论

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

评论(4

生生漫 2024-08-23 06:00:49

我没有 LabView,但您的配置有一些错误。

  1. diff.lvdiff 下的“外部”设置应命名为“command”。
  2. 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.

  1. The “external” setting under diff.lvdiff should be named “command”.
  2. The “%” in your lvdiff.sh should probably be “$”.

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.

和影子一齐双人舞 2024-08-23 06:00:49

您的 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

缪败 2024-08-23 06:00:49

这取决于您的虚拟仪器 (VI) 以 LabVIEW

  • 大小编写的文件:即使这些文件是文本文件,但太小,默认情况下它们也会被视为二进制文件
  • :如果它们是二进制文件,则默认的差异或合并工具将无法工作。 (因此我想,您由 .gitattributes 设置的自定义差异可能不会生效。
    .gitattributes 手册页 假定仅针对文本文件进行差异,其中可以生成补丁。也许应该定义一个 textconv 配置选项来执行 .vi 文件到文本表示的转换。)

我也遇到了类似的问题尝试在此 SO 答案

It depends on the size and nature of your virtual instrument (VI) files written in LabVIEW

  • size: even if those files are text, but too small, they would be by default treated as binary
  • nature: if they are binary, the default diff or merge tool would not work. (hence your custom diff set by .gitattributes might not kick in, I suppose.
    .gitattributes man page assume a diff only for text files, where a patch can be generated. Maybe a textconv 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.

浅暮の光 2024-08-23 06:00:49

通过省略对应执行合并的实际 LabVIEW 路径的引用,我成功地与 Mercurial 进行了合并:

[merge-tools]
LVMerge.args = $base $other $local $output
LVMerge.executable = C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe
LVMerge.gui = True
LVMerge.binary = True
[merge-patterns]
**.vi = LVMerge
**.ctl = LVMerge
**.lvclass = LVMerge
**.xctl = LVMerge
**.lvlib =LVMerge

Ton

I was successfull in doing a Merge with Mercurial by ommitting the reference to the actual LabVIEW path that should perform the Merge:

[merge-tools]
LVMerge.args = $base $other $local $output
LVMerge.executable = C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe
LVMerge.gui = True
LVMerge.binary = True
[merge-patterns]
**.vi = LVMerge
**.ctl = LVMerge
**.lvclass = LVMerge
**.xctl = LVMerge
**.lvlib =LVMerge

Ton

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