[BUGFIX] Try to always honor local config for mounts #2724
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I realize this is a big PR, but sadly the more I was digging to fix #2721, the more I would uncover new edge cases around our local vs global config handling 😢
This:
config.WithMount
that allows to pass to a context the current "mount point" or "store" that we're working on.config.FromContext
to also return the mount point if any is provided in the context.config.Int
,Bool
andString
to take into account the mount point if any is provided.WithMount
in the relevant places, mostly:Show
andGenerate
are concerned by custom config options, as well as anything that can use the clipboard feature.Furthermore, in "config related" changes, this also:
recipients.hash
.recipients ack
to actually update therecipients.hash
when it was previously outdated, but the.gpg-id
were correct.config
package.In the "weird changes" I still did in here, this also:
<root>
to indicate the local root store when using the--store
flag even insync
.rcs_test.go
wheregit
was weirdly failing withfailed to add "/tmp/TestInitRCS2737126547/001/git" to git: exit status 128: fatal: Unable to create '/home/anomalroil/code/gopass/.git/index.lock.lock': File exists.
because of some Parallel tests. This might actually indicate a bigger underlying issue: I would expect our tests not to tamper with the local git things, and do everything in/tmp
....Let me know if you'd like me to chunk it into multiple PR / commits, it just was a big rabbit hole and it kept on giving more.
This is probably not entirely done yet, e.g. I don't think
core.autopush
is properly respected at the local level yet, might be worth opening a new issue to track a big review of all our config options?