5.3 compat#562
Conversation
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
|
Tests were passing in 1354be4 before I moved the file, so I think vsi_common main is being cloned by a integration test, and will fail until after this is merged in. So ignore the test failures. |
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
| # "./_" is used so that when JUSTFILE and JUST_DOCKER_COMPOSE_DIR are unset, | ||
| # it will use that value that is dirnamed and throws away "/_" and results | ||
| # in pushd . to handle the bash 5.3 issue where pushd "" is now an error |
There was a problem hiding this comment.
| # "./_" is used so that when JUSTFILE and JUST_DOCKER_COMPOSE_DIR are unset, | |
| # it will use that value that is dirnamed and throws away "/_" and results | |
| # in pushd . to handle the bash 5.3 issue where pushd "" is now an error | |
| # "./_" is used so that when JUSTFILE and JUST_DOCKER_COMPOSE_DIR are unset, | |
| # it will dirname that value, which throws away "/_" and results in pushd . | |
| # in order to handle the bash 5.3 issue where pushd "" is now an error |
| # | ||
| # In bash version 5.3 and older, caller returns the first line of a multiline command, whereas before it returned the last line. | ||
| # | ||
| # :Value: * ``0`` ``pushd ""`` returns 0 |
There was a problem hiding this comment.
is this example right? I dont se a multi-line command
| # Guarantee a trailing / or empty string (this may be guaranteed by | ||
| # --show-prefix) | ||
| prefix="${prefix:+"${prefix%/}/"}" | ||
| local prefix=$("${GIT}" rev-parse --show-prefix) |
There was a problem hiding this comment.
is the trailing / here guaranteed by --show-prefix or something?
There was a problem hiding this comment.
Yes and no. If it returns a non-empty value, it appears to be guaranteed. But if it's empty, then clearly, no slash
| # core.worktree isn't set). Fortunately, in this case, --git-dir is correct | ||
| local dir | ||
| dir="$("${GIT}" rev-parse --show-toplevel)" | ||
| dir="$("${GIT}" rev-parse --show-toplevel)" # Don't use git_helper_toplevel, logic reasons |
There was a problem hiding this comment.
heh. I don't get it, but def a good comment
| # git submodule foreach must be run from the top-level working tree in | ||
| # git v1.8.3 | ||
| pushd "$("${GIT}" rev-parse --show-cdup)" &> /dev/null | ||
| local git_top_dir="$(git_helper_cdup)" |
There was a problem hiding this comment.
should prob be called up_path or git_up_path. You have something called git_helper_toplevel
| # git submodule foreach must be run from the top-level working tree in | ||
| # git v1.8.3 | ||
| pushd "$("${GIT}" rev-parse --show-cdup)" &> /dev/null | ||
| local git_top_dir="$(git_helper_cdup)" |
| # git submodule foreach must be run from the top-level working tree in | ||
| # git v1.8.3 | ||
| pushd "$("${GIT}" rev-parse --show-cdup)" &> /dev/null | ||
| local git_top_dir="$(git_helper_cdup)" |
| # At some point, prefix was deprecated and removed in favor of displaypath | ||
| local submodule_paths | ||
| if [ "${submodule_foreach_rv}" -eq "0" ]; then | ||
| # The following logic works based off of these variables being empty instead of `./` for proper output |
There was a problem hiding this comment.
| # The following logic works based off of these variables being empty instead of `./` for proper output | |
| # The following logic works based off of these variables being empty instead | |
| # of `./` (as they are in bash 5.3) |
| popd &> /dev/null | ||
| fi | ||
| popd &> /dev/null | ||
| # |
| # Guarantee a trailing / or empty string (this may be guaranteed by | ||
| # --show-prefix) | ||
| prefix="${prefix:+"${prefix%/}/"}" | ||
| local prefix=$("${GIT}" rev-parse --show-prefix) |
There was a problem hiding this comment.
Yes and no. If it returns a non-empty value, it appears to be guaranteed. But if it's empty, then clearly, no slash
Co-authored-by: Andy Neff <andyneff@users.noreply.github.com>
There are a few changes in bash 5.3 that lead to incompatibilities and failures in VSI Common.
The primary different is
pushd ""+popdno longer silently works exactly as intended. So many patches had to be added for that.