Embed git commit hash in binary #3

Closed
opened 2016-06-27 20:33:49 +00:00 by sbrl · 4 comments
Owner

It would make tracking who's using which version much easier if we embedded the git commit hash into built binaries.

(Apparently I didn't make a blog post about this. I really should!)

I've done this before somewhere.

It would make tracking who's using which version much easier if we embedded the git commit hash into built binaries. (Apparently I didn't make a blog post about this. I really should!) I've done this before somewhere.
Author
Owner

There doesn't seem to be a way of doing it that preserves both Linux and Windows compatibility and that doesn't require git to be installed and in the PATH variable.

I won't close this yet though, there are still stones that have been left unturned. Useful link: https://msdn.microsoft.com/en-us/library/ff521422.aspx

There doesn't seem to be a way of doing it that preserves both Linux and Windows compatibility and that doesn't require git to be installed and in the `PATH` variable. I won't close this yet though, there are still stones that have been left unturned. Useful link: https://msdn.microsoft.com/en-us/library/ff521422.aspx
Author
Owner

Found it! We need to use the Exec Task with the IgnoreExitCode parameter. That way we can execute git and if git isn't installed, we can display some default message or other instead.

Found it! We need to use the [Exec Task](https://msdn.microsoft.com/en-us/library/x8zx72cd.aspx) with the `IgnoreExitCode` parameter. That way we can execute git and if git isn't installed, we can display some default message or other instead.
Author
Owner
This is also useful: https://msdn.microsoft.com/en-GB/library/ms171484.aspx
Author
Owner

Done.

Done.
sbrl closed this issue 2016-08-10 08:31:43 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sbrl/cscz#3
No description provided.