Menu

One disarm override per pattern, not per key
📰

One disarm override per pattern, not per key

DEV Community: go·polycratia·8 days ago
#GOhCijw0
#devtogo#devto#dev#entry#program
Reading 0:00
15s threshold

gitdisarm reads the git configuration that arrived with a repository, and for every key that would make git run a program it prints the invocation that neutralizes it. The obvious store for those invocations is a map from key name to override string, and that map fails on the very first key worth reporting: the keys worth reporting are patterns, a pager for one command, a filter driver, a credential helper for one URL. So there is no finished override to keep around. Only a template, plus the entry that fills it.

The second half of the job is quieter and it bit me later: once the templates are filled, the results are not interchangeable. A -c pair goes to any git command. An option like --no-ext-diff belongs to git diff alone. Put both on one command line and git rejects it, which is about the worst thing that can happen to a tool whose whole output is a command you are supposed to paste.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.