From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reliably recording Git commit hashes

Hi all,

 

How does everyone here go about adding your commit revisions to software logs in a way that is agnostic to the location of the software?

 

This would be the ideal behavior for me:

 

1. If you're running on a dev machine, simple use the git command line to grab the current hash, updating a cache of some kind for later use

2. If you're deployed in the wild, try using the git command line, and when it fails, fall back on the cached value

 

Here's my attempt:

 

Get the current revision

current git rev.png

 

Update the Git revisionupdate git rev.png

 

 

So here's the rub: when you run the update code above, it only works when the "current git revision" VI is nowhere in the call stack; therefore you have the run the update code before running your application to have it work as expected.

 

That's easy to do in an application builder scenario (just add the update VI to your pre-build actions), but less easy on the dev machine.

 

Should I just add that same git code to the "current git revision vi"? That might work but doesn't have the best code smell IMO

0 Kudos
Message 1 of 2
(922 Views)

Looks like when the snippet saved in the "current git revision" VI, it disconnected the "git revision" indicator from those property nodes. Just link them back up and it should work as expected.

0 Kudos
Message 2 of 2
(921 Views)