Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add omb version #621

wants to merge 2 commits into from

Conversation

RobLoach
Copy link
Contributor

@RobLoach RobLoach commented Oct 2, 2024

This implements omb version to attempt to retrieve the version of oh-my-bash using git.

Copy link
Contributor

@akinomyoga akinomyoga left a 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) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"

Comment on lines +33 to +35
# 1) try tag-like version
# 2) try branch name
# 3) try name-rev (tag~<rev> or branch~<rev>)
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants