LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Merge and Git

We currently have Git setup to use LV Merge whenever a merge action is needed; however, when Git creates the merge files it places it at the root of the repository. When LV Merge opens those files the dependences become in relation to the merge files and not the original file. Has anyone experienced this or found a workaround? 

0 Kudos
Message 1 of 3
(2,522 Views)

I don't use LVMerge myself, but I have the following script for diffs - it may with modification work for you:

 

#!/bin/bash

# When taking a diff using only a file path for changes vs previous commits
# First is the new file (specified in the git diff call)
# Second is the same file copied to temp from a previous commit

# Copy the temporary file to the project directory.
# This allows referenced classes and subVIs to be found
# using relative paths from the diff'd VI.
cp "$2" "$PWD/temp_${2##*/}"
tgt2="$PWD/temp_${2##*/}"


# vidiff.exe handles path conversion from bash format to Windows format,
# but quotation marks are needed for the correct passing of the new
# environment variable.
vidiff.exe "$1" "$tgt2" --lv=2019

rm "$tgt2" # Remove the copied temporary file

 

The vidiff.exe mentioned in the script is the one built by this project: https://github.com/smithed/vicompare

Since the project also has a merge executable, you might find it useful.


GCentral
0 Kudos
Message 2 of 3
(2,452 Views)

Thank you; however, if I am understanding the documentation for vicompare it internally calls LVCompare and LVMerge. I tried to use a similar method to you where we copied the temporary merge files to a location that would persevere the relative paths; however, it seems that Git loses track of any changes made to the merged file. I assume since the files being modified are no longer in the location Git knows about. When performing a Diff operation this is not an issue since we are not changing anything; however, for merging this does present a problem. 

0 Kudos
Message 3 of 3
(2,441 Views)