git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] doc: clarify "explicitly given" in push.default

From
Jeff King <peff@peff.net>
Date
Jan 27, 2020, 23:14 UTC
Message-ID
<20200127231459.GD19360@coredump.intra.peff.net>
In-Reply-To
<dfcf0201-b634-2274-f041-a6ec4491825a@googlemail.com>
On Mon, Jan 27, 2020 at 08:48:01PM +0100, Bert Wesarg wrote:
Show 21 quoted lines
> > > There's another way of doing this, which is when you have a "triangular"
> > > flow: you might pull changes from origin/master into your local branch
> > > X, but then push them elsewhere. Usually this would be pushing to a
> > > branch named X on a different remote than origin (e.g., your public fork
> > > of upstream on a server). And for that you can set branch.X.pushRemote.
> 
> … it does not play well if you have have both flows in one repository.
> And I do have both flows. I track the upstream 'master' in the local
> branch 'Y' and I have also a branch 'X' which is based on 'Y' but
> should be pushed to a different remote as branch 'Y'. I have
> configured 'branch.X.pushRemote = triangular' but with 'push.default'
> set to 'upstream' I get this when:
> 
>     $ git push triangular
>     fatal: You are pushing to remote 'triangular', which is not the upstream of
>     your current branch 'X', without telling me what to push
>     to update which remote branch.
> 
> In this simple case, without a renaming, I would expect that 'git
> push' just works. May be just fallback to 'simple' if 'upstream' does
> not resolve to a fully qualified push?

I thought the point of "simple" was to be even more restrictive than "upstream".

At any rate, your setup is sufficiently complicated that I think you'd be better off adding a branch.X.pushRef feature (essentially a refspec to be used just on branch X, though since the source side is implied, it's really just a destination ref).

-Peff
Previous: Bert WesargNext: Bert Wesarg
Message 15 of 16 in “[Q] push refspec with wildcard pushes all matching branches”
  1. Bert WesargJan 24, 2020
  2. Jeff KingJan 25, 2020
  3. Bert WesargJan 25, 2020
  4. doc: clarify "explicitly given" in push.defaultJeff King, Jan 25, 2020
  5. Bert WesargJan 27, 2020
  6. Jeff KingJan 27, 2020
  7. doc: clarify "explicitly given" in push.defaultBert Wesarg, Jan 27, 2020
  8. Jeff KingJan 27, 2020
  9. Junio C HamanoJan 28, 2020
  10. Jeff KingJan 29, 2020
  11. Junio C HamanoJan 29, 2020
  12. Jeff KingJan 29, 2020
  13. Bert WesargJan 27, 2020
  14. Bert WesargJan 27, 2020
  15. Jeff KingJan 27, 2020
  16. Bert WesargJan 28, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.