Re: [PATCH RFC 2/8] push: add push.default = mirror

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paolo Bonzini <bonzini@xxxxxxx> writes:

> This patch adds a new value for push.default.  The aim of the series is
> to support all push.default values as arguments to `--push' in git-clone
> and git-remote, and if push.default=mirror works it is easy to make
> `--mirror' a synonym for `--push=mirror' in those comments.
>
> Signed-off-by: Paolo Bonzini <bonzini@xxxxxxx>
> ---
>  Documentation/config.txt |    2 ++
>  builtin-push.c           |   12 ++++++++++--
>  cache.h                  |    1 +
>  config.c                 |    4 +++-
>  4 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 4c27e9d..fa5eb76 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1290,6 +1290,8 @@ push.default::
>  * `matching` push all matching branches.
>    All branches having the same name in both ends are considered to be
>    matching. This is the default.
> +* `mirror` pushes all branches forcing non fast-forward updates and
> +  deletes branches that do not exist anymore locally.
>  * `tracking` push the current branch to its upstream branch.
>  * `current` push the current branch to a branch of the same name.

I think this patch alone (regardless of the rest which I haven't read)
probably makes sense.

Except that I think the part below contradicts with the --mirror push
semantics (see remote.c::match_refs()).

> diff --git a/builtin-push.c b/builtin-push.c
> index e678a9d..8a312a3 100644
> --- a/builtin-push.c
> +++ b/builtin-push.c
> @@ -74,6 +73,10 @@ static void setup_default_push_refspecs(void)
>  		add_refspec(":");
>  		break;
>  
> +	case PUSH_DEFAULT_MIRROR:
> +		add_refspec("+refs/*:refs/*");
> +		break;
> +
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]