Skip to content

Commit

Permalink
lib/git: Refactor "POST_1_7_2_GIT => _omb_git_post_1_7_2"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Oct 14, 2023
1 parent 23e3108 commit 1dfbd39
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

_omb_module_require lib:omb-prompt-colors
_omb_module_require lib:omb-prompt-base
_omb_module_require lib:omb-deprecate

: "${_omb_git_post_1_7_2:=${POST_1_7_2_GIT:-}}"
_omb_deprecate_declare 20000 POST_1_7_2_GIT _omb_git_post_1_7_2 sync

# # Note: The same name of a functionis defined in omb-prompt-base. We comment
# # out this function for now.
Expand All @@ -20,7 +24,7 @@ function parse_git_dirty {
local STATUS=
local -a FLAGS=('--porcelain')
if [[ $(_omb_prompt_git config --get oh-my-bash.hide-dirty) != 1 ]]; then
if ((POST_1_7_2_GIT > 0)); then
if ((${_omb_git_post_1_7_2:=$(git_compare_version "1.7.2")} > 0)); then
FLAGS+=('--ignore-submodules=dirty')
fi
if [[ $DISABLE_UNTRACKED_FILES_DIRTY == "true" ]]; then
Expand Down Expand Up @@ -209,8 +213,3 @@ function git_current_user_name {
function git_current_user_email {
_omb_prompt_git config user.email 2>/dev/null
}

# This is unlikely to change so make it all statically assigned
#POST_1_7_2_GIT=$(git_compare_version "1.7.2")
# Clean up the namespace slightly by removing the checker function
#unset -f git_compare_version

2 comments on commit 1dfbd39

@mattfaucher
Copy link

Choose a reason for hiding this comment

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

Not exactly sure if this commit is the culprit, but now upon ssh login to my server, which uses omb, I am seeing this output:

POST_1_7_2_GITSDIRS[mfauch@machine] [~] ○

Which is prepending to my shell prompt.

@akinomyoga
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the report. I'm not sure why the problem doesn't arise in my environment, but this was just an easy mistake. I've pushed a fix 9b244fe to the master branch. Could you update OMB and see if it works?

Please sign in to comment.