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

Provide "/dev/null" (b:\nul on 💾 Windows) instead of empty string as a git-repo to avoid reading local repo configuration #6986

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Aug 26, 2022

It is the resurrected #6820 but now with "Windows support". More information/references in the diff itself and individual commits.

Closes #6815

As it was reported in datalad#6815
and inquired from git folks for a better solution (no reply yet) at
https://lore.kernel.org/git/YscCKuoDPBbs4iPX@lena.dartmouth.edu/T/#u
whenever we provide an empty value for --git-dir, iff there is includeIf
statement in config, then git starts to demand a non-empty value for that
setting.  Unfortunately RTFM does not give any clear answer either that is
a legit or not. So I have decided to replace one questionable use with
another which does not cause an error.

Anther alternative I found we could have used two separate invocations of
--system and --global, but we cannot use them at the same time.
More information in the diff in comments.

b - used to be used for "second floppy drive", less likely to be used
these days

nul - corresponds to something like /dev/null on any drive.  Although
could be created (via some other syscalls, like FAR manager does) a very
unlikely to be present.
@yarikoptic yarikoptic added the semver-patch Increment the patch version when merged label Aug 26, 2022
@codecov
Copy link

codecov bot commented Aug 26, 2022

Codecov Report

Merging #6986 (3935734) into maint (2dea515) will increase coverage by 0.87%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            maint    #6986      +/-   ##
==========================================
+ Coverage   90.25%   91.12%   +0.87%     
==========================================
  Files         354      354              
  Lines       46057    46354     +297     
  Branches        0     6612    +6612     
==========================================
+ Hits        41567    42241     +674     
+ Misses       4490     4097     -393     
- Partials        0       16      +16     
Impacted Files Coverage Δ
datalad/config.py 97.27% <100.00%> (+0.01%) ⬆️
datalad/tests/test_config.py 99.73% <100.00%> (+<0.01%) ⬆️
datalad/version.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/api.py 90.24% <0.00%> (-4.50%) ⬇️
datalad/tests/test_archives.py 91.91% <0.00%> (-2.75%) ⬇️
datalad/customremotes/tests/test_datalad.py 95.34% <0.00%> (-2.28%) ⬇️
datalad/_version.py 45.68% <0.00%> (-2.03%) ⬇️
datalad/support/s3.py 42.26% <0.00%> (-1.14%) ⬇️
datalad/support/network.py 90.15% <0.00%> (-1.10%) ⬇️
datalad/local/tests/test_wtf.py 97.72% <0.00%> (-1.09%) ⬇️
... and 64 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@yarikoptic yarikoptic marked this pull request as ready for review August 29, 2022 15:02
@yarikoptic yarikoptic changed the title Provide "/dev/null" as a git-repo to prevent local repo configuration Provide "/dev/null" (b:\nul on Windows) instead of empty string as a git-repo to prevent local repo configuration Aug 30, 2022
@yarikoptic yarikoptic changed the title Provide "/dev/null" (b:\nul on Windows) instead of empty string as a git-repo to prevent local repo configuration Provide "/dev/null" (b:\nul on Windows) instead of empty string as a git-repo to avoid reading local repo configuration Aug 30, 2022
@yarikoptic yarikoptic changed the title Provide "/dev/null" (b:\nul on Windows) instead of empty string as a git-repo to avoid reading local repo configuration Provide "/dev/null" (b:\nul on 💾 Windows) instead of empty string as a git-repo to avoid reading local repo configuration Aug 30, 2022
@yarikoptic yarikoptic merged commit 4ae6358 into datalad:maint Aug 30, 2022
@github-actions
Copy link

🚀 PR was released in 0.17.4 🚀

@yarikoptic yarikoptic deleted the bf-config-no-repo branch October 14, 2022 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released semver-patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant