Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-17 Thread Junio C Hamano
Dave Borowitz writes: > Slight digression for a question that came up during reworking the > series: would it be reasonable to rewrite option parsing in > builtin/send-pack.c to use the options API? Surely. The part of the system whose option parsing predates parse-options may not have been con

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-17 Thread Dave Borowitz
On Mon, Aug 17, 2015 at 3:54 PM, Junio C Hamano wrote: > In the shorter term, at least we should be able to introduce > git_parse_maybe_bool() that does not take "name", use that as a > helper to implement git_config_maybe_bool(), so that the existing > callers of git_config_maybe_bool() does not

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-17 Thread Junio C Hamano
Dave Borowitz writes: > Is there a common utility function that does what we want? Basically > git_config_maybe_bool but not specifically about configs. Interesting. git_config_maybe_bool() and its friends take the usual (name, value) and pretend to be part of the "config" family, primarily bec

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-17 Thread Dave Borowitz
On Mon, Aug 17, 2015 at 2:47 PM, Junio C Hamano wrote: > Dave Borowitz writes: > >> On Mon, Aug 17, 2015 at 1:21 PM, Junio C Hamano wrote: >>> >>> My preference on Bikeshed 1. would probably be to add >>> >>> --sign=yes/no/if-asked >>> >>> and to keep --[no-]signed for "no" and "yes" for exi

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-17 Thread Junio C Hamano
Dave Borowitz writes: > On Mon, Aug 17, 2015 at 1:21 PM, Junio C Hamano wrote: >> >> My preference on Bikeshed 1. would probably be to add >> >> --sign=yes/no/if-asked >> >> and to keep --[no-]signed for "no" and "yes" for existing users. > > Incidentally, I just looked up incidence of true/

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-17 Thread Dave Borowitz
On Mon, Aug 17, 2015 at 1:21 PM, Junio C Hamano wrote: > Dave Borowitz writes: > >> Ok, so let us bikeshed a bit further. >> >> Bikeshed 1. >> Option A: --signed/--no-signed--signed-if-possible >> Option B: --signed=true|false|if-possible, "--signed" alone implies "=true". >> >> Bikeshed 2. >> >>

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-17 Thread Junio C Hamano
Dave Borowitz writes: > Ok, so let us bikeshed a bit further. > > Bikeshed 1. > Option A: --signed/--no-signed--signed-if-possible > Option B: --signed=true|false|if-possible, "--signed" alone implies "=true". > > Bikeshed 2. > > Option A: if-possible > > The possibly confusing thing is one might

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-14 Thread Junio C Hamano
Dave Borowitz writes: > Ok, so let us bikeshed a bit further. > > Bikeshed 1. > Option A: --signed/--no-signed--signed-if-possible > Option B: --signed=true|false|if-possible, "--signed" alone implies "=true". > > Bikeshed 2. > > Option A: if-possible > > The possibly confusing thing is one might

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-14 Thread Dave Borowitz
On Fri, Aug 14, 2015 at 4:45 PM, Junio C Hamano wrote: > Dave Borowitz writes: > >> On Fri, Aug 14, 2015 at 2:12 PM, Junio C Hamano wrote: >>> Yes, it looks somewhat strange. >> ... The straw-man >> strangeness is that two of them are the traditional boolean values >> "true/false" and the third

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-14 Thread Junio C Hamano
Dave Borowitz writes: > On Fri, Aug 14, 2015 at 2:12 PM, Junio C Hamano wrote: >> Yes, it looks somewhat strange. > ... The straw-man > strangeness is that two of them are the traditional boolean values > "true/false" and the third is "file not found^W^W^Wif-possible" :) It actually is not unco

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-14 Thread Dave Borowitz
On Fri, Aug 14, 2015 at 2:12 PM, Junio C Hamano wrote: >> The "if-possible" name and weird tri-state boolean is basically a straw man, >> and I am happy to change if someone has a clearer suggestion. > > Yes, it looks somewhat strange. Let me go on a slight tangent to > explain why I think it is

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-14 Thread Dave Borowitz
On Fri, Aug 14, 2015 at 2:12 PM, Junio C Hamano wrote: > So I am fine as long as "if-possible" turns a failure to make signed > push into a success _only_ when the reason of the failure is because > we did not see the capability supported by the receiving end. If > the reason why you cannot do a

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-14 Thread Junio C Hamano
Dave Borowitz writes: > Remembering to pass --signed to git push on every push is extra typing that is > easy to forget, and just leads to annoyance if the remote has a hook that > makes > signed pushes required. Add a config option push.gpgSign, analogous to > commit.gpgSign, allowing users to

Re: [PATCH 0/7] Flags and config to sign pushes by default

2015-08-14 Thread Chris Packham
Bike shedding a little (I've never used the signed push functionality) On Fri, Aug 14, 2015 at 7:00 AM, Dave Borowitz wrote: > The "if-possible" name and weird tri-state boolean is basically a straw man, > and I am happy to change if someone has a clearer suggestion. what about git push --signed