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 D55D31F619 for ; Wed, 11 Mar 2020 19:10:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731040AbgCKTKX (ORCPT ); Wed, 11 Mar 2020 15:10:23 -0400 Received: from cloud.peff.net ([104.130.231.41]:36696 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1731030AbgCKTKX (ORCPT ); Wed, 11 Mar 2020 15:10:23 -0400 Received: (qmail 3430 invoked by uid 109); 11 Mar 2020 19:10:23 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Wed, 11 Mar 2020 19:10:23 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 22162 invoked by uid 111); 11 Mar 2020 19:19:44 -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; Wed, 11 Mar 2020 15:19:44 -0400 Authentication-Results: peff.net; auth=none Date: Wed, 11 Mar 2020 15:10:21 -0400 From: Jeff King To: Robert Dailey Cc: Git Subject: Re: Using push.default with push.remote.push Message-ID: <20200311191021.GA27978@coredump.intra.peff.net> References: <20200311162517.GA27893@coredump.intra.peff.net> 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 Wed, Mar 11, 2020 at 11:56:05AM -0500, Robert Dailey wrote: > > Then when would remote.*.push with a wildcard ever do anything? > > Maybe this is where a potential disconnect is, but I've always viewed > the wildcard refspec as a mapping, rather than an all-inclusive "Push > all the things". In other words, I view it as more of a structural > guide than a behavioral one. I recognize I probably have this wrong, > but it probably speaks to how some users view it, or at least, some > valid use cases to have more of a structural mechanism to map branches > to remote repositories, with `git push --all` being a supplement to > say "Push all branches using this mapping". I see. So you really want "push the current branch by default, but using this refspec to map the names". That doesn't exist right now, but it seems like it would be a reasonable thing to have. Bringing in your other reply: > I think `branch.*.pushRef` in this case is not enough. It implies that > for every branch I want to be mapped in this way, I'd have to manually > specify this config. Rather, I think a `remote.*.pushRef` would be > more appropriate, so that it would automatically set the > `branch.*.pushRef` version as needed, so I only set up the mapping > once. Yes, my suggestion would require per-branch config. And something like remote.*.pushRef makes sense to me as the implementation for what we were discussing above. I think you'd want the name to somehow indicate that it's a mapping to be used when pushing a ref, and not the definitive "this is what we will push" directive. I don't think it would make sense to use with something like "upstream" in push.default, because that's mapping the name already. So possibly it should be restricted to "current". I suppose it would also make sense with "matching". There the current remote.*.push _mostly_ does the same thing, but with one subtle exception that it pushes everything that matches the left-hand side of the refspec, not just ones that exist on the right-hand side. So I dunno. I could see it as being limited to "current", or being applied as it makes sense for each individual push.default. I'll leave that to whoever decides to work on the feature. :) -Peff