-
-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add omb version #621
base: master
Are you sure you want to change the base?
Add omb version #621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't version=$(cmd1) || version=$(cmd2) || ...
be combined to version=$(cmd1 || cmd2 || ...)
to reduce the number of forks? Or is there cases where the output is produced yet should be discarded when the command fails?
# 2) try branch name | ||
# 3) try name-rev (tag~<rev> or branch~<rev>) | ||
local version | ||
version=$(command git -C "$OSH" describe --tags HEAD 2>/dev/null) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version=$(command git -C "$OSH" describe --tags HEAD 2>/dev/null) \ | |
version=$(command git --git-dir="$OSH" describe --tags HEAD 2>/dev/null) \ |
See #311 for details. Sadly, CentOS was discontinued, yet many large systems continue to stay in CentOS 7. The same for the other occurrences of -C "$OSH"
# 1) try tag-like version | ||
# 2) try branch name | ||
# 3) try name-rev (tag~<rev> or branch~<rev>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the branch name useful to identify the version? A branch name is a moving target.
This implements
omb version
to attempt to retrieve the version of oh-my-bash using git.