about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiConfig.pm
DateCommit message (Collapse)
2023-11-03move read_all, try_cat, and poll_in to PublicInbox::IO
The IO package seems like a better home for I/O subs than the Git package. We lose the 60 second read timeout for `git cat-file --batch-*' processes since it's probably not necessary given how reliable the code has proven and things would fall over hard in other ways if the storage device were completely hosed.
2023-10-29lei_config: import read_all properly
*sigh* fixing interactive editing stuff is a pain... Found while making other changes... Fixes: 19b791f4894efcb6 (use read_all in more places to improve safety)
2023-10-18lei_config: drop redundant open check
autodie already takes care of checking for open failures.
2023-10-18use read_all in more places to improve safety
`readline' ops may not detect errors on partial reads. This saves us some code to reduce cognitive overhead for readers. We'll also support reusing a destination buffers so it can work more nicely with existing code.
2023-10-04lei: do_env combines fchdir and local
This will make switching $lei contexts less error-prone and hopefully save us from some suprising bugs in the future. Followup-to: 759885e60e59 (lei: ensure --stdin sets %ENV and $current_lei, 2023-09-14)
2023-09-24lei: fix `-c NAME=VALUE' config support
We can pass `-c NAME=VALUE' args directly to git-config without needing a temporary directory nor file. Furthermore, this opens the door to us being able to correctly handle `-c NAME=VALUE' after `delete $lei->{cfg}' if we need to reload the config during a command. This tightens up error-checking for `lei config' and ensures we can make config settings changes while using `-c NAME=VALUE' instead of editing the temporary file. The non-obvious part was avoiding the use of the -f/--file arg for `git config' for read-only operations and include relying on `-c include.path=$ABS_PATH'. This is done by parsing the switches to be passed to `git config' to determine if it's a read-only operation or not.
2023-09-24lei config: send `git config' errors to pager
Our previous use of lei->cfg_dump was wrong as the extra arg was never supported. Instead, we need to capture the output of `git config' and send it to the pager if ->cfg_dump fails. We'll also add a note to the user to quit the pager to continue.
2021-09-19lei config --edit: use controlling terminal
As with "lei edit-search", "lei config --edit" may spawn an interactive editor which works best from the terminal running script/lei. So implement LeiConfig as a superclass of LeiEditSearch so the two commands can share the same verification hooks and retry logic.