Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-13 Thread Marius Paliga
Updated patch and added tests: (feel free to modify Documentation) --- Subject: [PATCH] Added support for new configuration parameter push.pushOption builtin/push.c: add push.pushOption config Currently push options need to be given explicitly, via the command line as "git push --push-option".

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-12 Thread Junio C Hamano
Stefan Beller writes: > Junio, > do we have variables that behave similarly to this? If you scan Documentation/config.txt, you'll find http.extraHeader as an example' but I do not recall offhand if that was the original that introduced the convention, or it merely followed

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-12 Thread Junio C Hamano
Marius Paliga writes: > Thank you for your coments and explanation. > > Just one thing: > >> - After parse_options() returns to cmd_push(), see if push_options >>is empty. If it is, you did not get any command line option, so >>override it with what you

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-12 Thread Stefan Beller
On Thu, Oct 12, 2017 at 9:32 AM, Marius Paliga wrote: > Subject: [PATCH] Added support for new configuration parameter push.pushOption > > builtin/push.c: add push.pushOption config > > Currently push options need to be given explicitly, via > the command line as "git

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-12 Thread Marius Paliga
Subject: [PATCH] Added support for new configuration parameter push.pushOption builtin/push.c: add push.pushOption config Currently push options need to be given explicitly, via the command line as "git push --push-option". The UX of Git would be enhanced if push options could be configured

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-12 Thread Marius Paliga
Thank you for your coments and explanation. Just one thing: > - After parse_options() returns to cmd_push(), see if push_options >is empty. If it is, you did not get any command line option, so >override it with what you collected in the "from-config" string >list. Otherwise, do

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-11 Thread Stefan Beller
On Wed, Oct 11, 2017 at 2:18 AM, Marius Paliga wrote: > Found one possible issue when looking for duplicates, we need to use > "unsorted_string_list_has_string" instead of "string_list_has_string" > > - if (!string_list_has_string(_options, >

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-11 Thread Junio C Hamano
Marius Paliga writes: > @@ -505,6 +509,12 @@ static int git_push_config(const char *k, const > char *v, void *cb) > recurse_submodules = val; > } > > +default_push_options = git_config_get_value_multi("push.optiondefault"); > +if

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-11 Thread Junio C Hamano
Marius Paliga writes: > +default_push_options = git_config_get_value_multi("push.optiondefault"); > +if (default_push_options) > +for_each_string_list_item(item, default_push_options) > +if (!string_list_has_string(_options, item->string)) > +

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-11 Thread Marius Paliga
Found one possible issue when looking for duplicates, we need to use "unsorted_string_list_has_string" instead of "string_list_has_string" - if (!string_list_has_string(_options, item->string)) + if (!unsorted_string_list_has_string(_options,

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-11 Thread Marius Paliga
Including proposed patch... Signed-off-by: Marius Paliga --- Documentation/git-push.txt | 3 +++ builtin/push.c | 11 ++- t/t5545-push-options.sh| 48 ++ 3 files changed, 61 insertions(+), 1

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-04 Thread Marius Paliga
Hi Stefan, I will look at it. Thanks, Marius 2017-10-03 18:53 GMT+02:00 Stefan Beller : > On Tue, Oct 3, 2017 at 3:15 AM, Marius Paliga wrote: >> There is a need to pass predefined push-option during "git push" >> without need to specify it

Re: Enhancement request: git-push: Allow (configurable) default push-option

2017-10-03 Thread Stefan Beller
On Tue, Oct 3, 2017 at 3:15 AM, Marius Paliga wrote: > There is a need to pass predefined push-option during "git push" > without need to specify it explicitly. > > In another words we need to have a new "git config" variable to > specify string that will be automatically

Enhancement request: git-push: Allow (configurable) default push-option

2017-10-03 Thread Marius Paliga
There is a need to pass predefined push-option during "git push" without need to specify it explicitly. In another words we need to have a new "git config" variable to specify string that will be automatically passed as "--push-option" when pushing to remote. Something like the following: git