From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 32C511F4B9 for ; Sat, 25 Jan 2020 00:38:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729638AbgAYAih (ORCPT ); Fri, 24 Jan 2020 19:38:37 -0500 Received: from cloud.peff.net ([104.130.231.41]:44288 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729147AbgAYAih (ORCPT ); Fri, 24 Jan 2020 19:38:37 -0500 Received: (qmail 9348 invoked by uid 109); 25 Jan 2020 00:38:37 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Sat, 25 Jan 2020 00:38:37 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 12490 invoked by uid 111); 25 Jan 2020 00:45:48 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 24 Jan 2020 19:45:48 -0500 Authentication-Results: peff.net; auth=none Date: Fri, 24 Jan 2020 19:38:36 -0500 From: Jeff King To: Bert Wesarg Cc: git@vger.kernel.org Subject: Re: [Q] push refspec with wildcard pushes all matching branches Message-ID: <20200125003836.GA568952@coredump.intra.peff.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Jan 24, 2020 at 09:29:53PM +0100, Bert Wesarg wrote: > I'm a little confused, that a push refspec with a wildcard changes the number of branches pushed. I'm confused about which part you're confused about. :) > $ git push --dry-run > To ../bare.git > * [new branch] master -> master > $ git config remote.origin.push 'refs/heads/master*:refs/remotes/origin/master*' > $ git push --dry-run > To ../bare.git > * [new branch] master -> origin/master > * [new branch] master-two -> origin/master-two > > Is this expected behavior? You asked it to push master*, so it did. Is your confusion that you had set push.default to "current"? If there is a refspec (either in the config or specified on the command line), then that takes precedence over push.default. >From git-push(1): When the command line does not specify what to push with ... arguments or --all, --mirror, --tags options, the command finds the default by consulting remote.*.push configuration, and if it is not found, honors push.default configuration to decide what to push (See git-config(1) for the meaning of push.default). If that's not it, can you clarify what you expected to happen? -Peff