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 7
(1,534 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 7
(1,533 Views)

I know its four years old, but looks quit nice, any idea, why the snippets are only integrated as decorators?

0 Kudos
Message 3 of 7
(426 Views)

You have to download the original, i.e. click in the image and download the image that pops up. The inline view does not contain the VI data, just the image.

0 Kudos
Message 4 of 7
(418 Views)

Thanks for the fast reply. Have you tried for these snippets, its what I usually do and tried again now, but no chance. still only a decorator. other Snippets work fine. Tried Edge and Firefox for download using LV2020.

0 Kudos
Message 5 of 7
(413 Views)

They worked fine for me in Firefox with LV2020. Here they are as VIs.

Download All
0 Kudos
Message 6 of 7
(402 Views)

Thank you cordm, I finally managed to get the snippets working, in the two browsers I have available here, it is not the right way to klick the image, as this only opens an enlarged preview. I have to klick on an small icon (Scare with top left pointing arrow) appearing in the top left corner instead. This is bad UX imo but good to know the  problem is fond in front of the screen once more.

0 Kudos
Message 7 of 7
(342 Views)