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".
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
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
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
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
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
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,
>
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
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))
> +
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,
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
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
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
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
14 matches
Mail list logo