- Notifications
You must be signed in to change notification settings - Fork46
Everything you need to hold your LabView projects version controlled with GIT.
License
joerg/LabViewGitEnv
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This represents everything that is needed to hold your LabVIEW projects under version control with GIT. With this you can configure GIT to use LabVIEW's diff and merge tools to play with your projects.
To view the actual code, switch to the branch that matches to your operating system. Currently only Windows is supported, but porting this to Linux or Mac should be fairly easy. Please contact me if you plan to do so.
Assume you have amaster branch with a few commits and afeature branch with new changes. You currently havemaster checked out.
To diff those branches, you can use
git diff featurewhich will bring upLVCompare.exe with the correct attributes and show you the differences betweenmaster andfeature.
To merge those branches, you can use
git merge featurewhich will bring upLVMerge.exe. This will show you 4 different versions:
- Base, which is the common ancestor of
featureandmaster, - Theirs which is the vi in
feature, - Yours, which is the vi in
master, - and finally the merged vi.
Just edit the merged vi if necessary, save it and press close, and GIT will automagically create a nice merge commit.
When calling
git merge feature masterGIT will not call LVMerge.exe at first, but will try to do an internal merge which will fail. You will then have to use
git mergetool -t labviewto call LVMerge.exe and do the merge.
To download, install, and configure LabViewGitEnv for every user on your system, open a GIT Bash shell and issue the following commands
mkdir -p /c/repos/other && cd /c/repos/othergit clone -b windows git://github.com/joerg/LabViewGitEnv.gitcd LabViewGitEnvbin/LVBootstrap.sh --system, where/c/repos/other is where you place your forked GitHub projects.
LabViewGitEnv can automatically detect your version of LabVIEW if you haveVIKit installed.
If you followed this section, you can skip the installation and configuration sections. However, if you useGIT Gui, there are few more settings to configure, and you can find them in the sections below.
There are (or should be) four branches. The one you are seeing here (master) should be fairly empty, the other ones represent everything that is needed for Linux, Mac and Windows.
In order to run this you will need LabVIEW, GIT, and bash, which comes with msysgit for Windows users and should be preinstalled on any *nix system.
You can install this system wide or per user. If you have administrative rights, I suggest installing it system wide.
Open GIT Bash as Administrator and issue the following commands
mkdir -p /usr/localgit clone -b windows git://github.com/joerg/LabViewGitEnv.git /usr/local/cd /usr/local && git checkout -b localIf you are planning to useGIT Gui, open cmd.exe as Administrator and issue the following command
setx Path "%Path%;GIT_INSTALL_PATH\local\bin /M", whereGIT_INSTALL_PATH mostly is something like C:\Programme Files\Git.
Open GIT Bash and issue the following commands
git clone -b windows git://github.com/joerg/LabViewGitEnv.git /tmp/LabViewGitEnvfind /tmp/LabViewGitEnv -maxdepth 1 -mindepth 1 -exec cp -r {} ~ \;cd ~ && git checkout -b localIf you are planning to useGIT Gui, open cmd.exe and issue the following command
setx Path "%Path%;C:\Users\USER_NAME\bin", whereUSER_NAME is your windows user name.
Work on this is not done yet, but I suppose it should be pretty simple to do so. If you are using LabVIEW on Linux or Mac and want to use it with GIT, then please contact me and we can surely figure this out pretty fast.
To configure GIT to use LabViewGitEnv, just open Git Bash on Windows or any Shell on Linux and Mac and issue the following
LVInit.sh OPTIONwhere OPTION can be one of the following
--systemCofigures GIT system wide. You need administrative rights to do that, so on Windows you need to have Git Bash opened as Administrator and on Linux and Mac you have to be root or use sudo. This is recommended since GIT will be configured to only use LabViewGitEnv for LabVIEW file types.
--globalConfigures user specific settings.
--localConfigures the Repository you are currently in. Beware: This does not get propagated through a push/pull.
LabViewGitEnv can automatically detect your version of LabVIEW to use for diffs and merges if you haveVIKit installed.
If not, you may also need to edit your LabVIEW path. To do so, edit yourLVConfig.sh in either /usr/local/etc or ~/etc and adapt the LabViewBin and LabViewShared variables. LabViewBin represents the LabVIEW binary you want to use, LabViewShared represents the folder where to find LabVIEW Compare and LabVIEW Merge.
If you can't find those two, you may use the following commands to search through your system (replace the "c" with whatever drive letter your LabVIEW is installed on)
find /c -type f -name LabVIEW.exe -print 2> /dev/nullfind /c -type d -name "LabVIEW Compare" -print 2> /dev/nullThe first one will search for your LabViewBin, the second one will search for your LabViewShared (be sure to only use the part of the path till the Shared folder without the trailing slash).
Full support is currently only given forGIT Gui. If you have set your Path variable according to the installation instructions, almost everything will work out of the box.
To Diff LabVIEW files you have to open gitk and configure one more option. On Windows, open GIT Gui and view some project tree to open gitk. In gitk select Edit -> Options and choose the installed LVGitKExternalDiffWrapper.
Open a GIT Bash, go to the folder you installed it to ( /usr/local for system wide installs, ~ for per user installs, or /c/repos/other/LabViewGitEnv for Quick Start installs), and issue the following commands:
git stash save "local changes"git checkout windowsgit pullgit checkout localgit rebase windows localgit stash popFinally, one more command is needed in case some changes happened for git-config. However, you should always run this to make sure everything is configured correctly:
bin/LVBootstrap.sh --systemLVInit.sh (--system|--global|--local)Copyright (c) 2011 Jörg Herzinger, see LICENSE for details.
- Joe Friedrichsen, 2014
About
Everything you need to hold your LabView projects version controlled with GIT.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.