From: Jeff King <peff@peff.net>
To: Robert Dailey <rcdailey.lists@gmail.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: Using push.default with push.remote.push
Date: Wed, 11 Mar 2020 12:25:17 -0400 [thread overview]
Message-ID: <20200311162517.GA27893@coredump.intra.peff.net> (raw)
In-Reply-To: <CAHd499BhLe0xF_k2ASV=ZuM7LVvxui_cxzB9UrJ2MDCyyNUmtw@mail.gmail.com>
On Wed, Mar 11, 2020 at 10:41:36AM -0500, Robert Dailey wrote:
> With the specified configuration:
>
> ```
> [push]
> default = current
> [remote "origin"]
> url = git@mydomain:myrepo
> fetch = +refs/heads/dev/john/*:refs/remotes/origin/*
> fetch = +refs/heads/*:refs/remotes/origin/*
> push = refs/heads/master:refs/heads/master
> push = refs/heads/*:refs/heads/dev/john/*
> ```
>
> Given a currently checked out local branch named `my-feature`, how can
> I make this command:
>
> git push -n origin
>
> Behave semantically identical to this command?
>
> git push -n origin my-feature
I don't know of a way. If we had branch.*.pushRef (and not just
pushRemote), it would presumably do what you want.
This came up recently in:
https://lore.kernel.org/git/20200127231459.GD19360@coredump.intra.peff.net/
as well.
> The current behavior seems to be working as designed, but not as
> desired. The first push command pushes *all* branches under
> `refs/heads/*`, instead of just the current branch as it normally
> would via `push.default` setting. It sort of feels like if a resolved,
> explicitly defined `push.<remote>.push` config is found *and* it
> includes wildcards, the `push.default` setting should still be
> respected.
Then when would remote.*.push with a wildcard ever do anything?
> Note my ultimate goal here is to transparently map local branches to a
> branch with a prefix on the remote. But I do not want to explicitly
> work with or see those prefixes locally. Basically
> `dev/john/my-feature` on the remote should be `refs/heads/my-feature`
> locally, and `refs/remotes/origin/my-feature` for fetches. The
> push-without-explicit-refspec case is the only one I haven't gotten to
> work as desired yet.
I think this is similar to what was desired in the thread I linked
above.
-Peff
next prev parent reply other threads:[~2020-03-11 16:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 15:41 Using push.default with push.remote.push Robert Dailey
2020-03-11 15:43 ` Robert Dailey
2020-03-11 16:25 ` Jeff King [this message]
2020-03-11 16:56 ` Robert Dailey
2020-03-11 17:01 ` Robert Dailey
2020-03-11 19:10 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200311162517.GA27893@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=rcdailey.lists@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).