Embed git commit hash in binary #3
Labels
No labels
Area: Documentation
Bug
Enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: sbrl/cscz#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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
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.This is also useful: https://msdn.microsoft.com/en-GB/library/ms171484.aspx
Done.