git-remote-s3
git-remote-s3 copied to clipboard
WIP add option for gpg.program to git config
Thank you for the useful program.
Apologies for the slightly ugly PR, this is my first time using Rust. One day I'll understand why method chains have to end in question marks to compile, but for now I'm moving on to other tasks.
This PR parameterizes the gpg command to be used, using the gpg.program git config setting or defaulting to gpg if not set.
To do so required refactoring the config function to optionally take a default value. I feel like this refactor feels "backwards" and that config + defaults should delegate to config w/o, but this is what I was able to get to compile.
I've tested it with the following shell script for gpg.program, which is able to push/pull cleartext from s3
#!/bin/bash
echo "trying $* " >&2
if test "$5" == "-d"; then
cat <"$6" >"$4"
else
cat <"$8" >"$6"
fi
Ultimately, I will need to cross-build this for windows (which uses "gpg.exe", among other differences) ; I'll post here if I'm able to get that working.