Is it possible to set diff/merge-tool for a specific file extension in git-extensions?

无人久伴 提交于 2019-12-07 11:08:47

问题


I'm just getting started on developing in LabView, it's all new to me.

And i'd like to use git extensions to handle my versioning. Since the source is in a *.vi format, I can't use the normal diff tools, the source is binary.

Fortunately, LabView comes with dedicated diff and merge tools which seems to be very helpful. And I can setup TortoiseGit to use these tools on all *.vi files. It's from this how-to:

https://www.labviewhacker.com/doku.php?id=learn:software:github:getting_started

Is there a way to do the same in Git Extensions? I much prefer git extensions over TortoiseGit.. So I'd rather not be forced to use TortoiseGit.

From what I've found, you can only specify a general diff/merge tool, not different ones for different types of files.

Any help would be appreciated, do anyone know how? :)


回答1:


If the output of the diff tool is text, you can view diffs under standard Git using a combination of .gitattributes and .git/config. I hope that Git Extensions would respect this setting.

I recommend reading the Git Attributes chapter of the Pro Git book for details on setting this up, but the idea should be something like

*.vi diff=labview

in your repository's .gitattributes file, and

[diff "labview"]
textconv = labview-diff-tool

in your .git/config.

If the diff tool does not output text, you may find the top response to this question useful, which discusses using a graphical diff tool.




回答2:


Reference: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/configlvcomp_thirdparty/

  1. Right-click in any folder (that is not a git project) and select TortoiseGit –> Settings
  2. Click on Diff Viewer tab
  3. Click Advanced -> Add
    1. Extension: .vi
    2. External Program: C:\Program Files (x86)\National Instruments\Shared\LabVIEW Compare\LVCompare.exe %base %mine-nobdcosm -nobdpos
      • -nobdcosm means do not compare the appearance of block diagram objects.
      • -nobdpos means do not compare the size or position of block diagram objects.
  4. Repeat for: .ctl and .llb extensions


来源:https://stackoverflow.com/questions/20663296/is-it-possible-to-set-diff-merge-tool-for-a-specific-file-extension-in-git-exten

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!