-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Slightly adjust internal gix_path::env::git
-related organization
#1568
Conversation
This moves the `first_file_from_config_with_origin` test into the nested `exe_info` module, because like the other functions tested there, `first_file_from_config_with_origin` is a helper function for `EXE_INFO` that is separate largely to facilitate testing.
In `gix_path::env::git`.
The `gix_path::env::git::EXE_NAME` static item, while more visible than `NULL_DEVICE`, was crate-internal via `pub(super)`. So making it a `const` instead, as done here, is not a breaking nor otherwise user-facing change.
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.
Thanks a lot for your help with this, and for catching that indentation issue. Cargo-fmt doesn't deal as well with macros as one would hope.
I agree with renaming However, I think this name runs the risk making it seem like the opposite of what it really is: Although the meaning may vary subtly across contexts, in my mind this is the configuration file whose configuration has the lowest priority, because the variables in it have the highest scope; setting those variables in any other scope takes precedence. I am not sure what the best name is, but maybe a better name could be |
This renames the crate-internal static item with the cached path of the highest scope nonempty config, treated as associated with the `git` installation, from `GIT_HIGHEST_PRIORITY_CONFIG_PATH` to `GIT_HIGHEST_SCOPE_CONFIG_PATH`. This reflects the propensity of "priority" to have the opposite of the intended meaning here, since configuration in this file stands to be superseded by configuration in any lower (i.e. any other) scope. See GitoxideLabs#1568 for context. I think this change from "PRIORITY" to "SCOPE" in the name preserves the benefits of the change from `EXE_INFO` to `GIT_HIGHEST_PRIORITY_CONFIG_PATH` (dd2d666), while making clearer what is going on and avoiding misinterpretations.
I have opened #1569 to propose the PRIORITY -> SCOPE naming adjustment I suggested above in #1568 (comment). |
This is a small follow-up to #1567. As suggested in #1567 (comment), it moves the
first_file_from_config_with_origin
test case into the nestedexe_info
module, and it changesNULL_DEVICE
fromstatic
toconst
.This also changes
EXE_NAME
, which providesgit
orgit.exe
and never holds a longer path even when one is ultimately used, fromstatic
toconst
. WhileEXE_NAME
is non-private, it is crate-internal viapub(super)
, so this change is still non-breaking and non-user-facing.In contrast, the static items
ALTERNATIVE_LOCATIONS
andEXE_INFO
cannot be madeconst
. No change is made to them. It may make sense in the future forEXE_INFO
to hold anOption<PathBuf>
rather than anOption<BString>
; depending in part on the future direction of changes related to #1523 and #1567 or to the question of which scopes are eligible to informGitInstallation
, that may be required in the future. But nothing toward that is included here.