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

Re: [PATCH 2/4] push: make upstream, simple work with pushdefault

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 13, 2013, 16:48 UTC
Message-ID
<7vehc6vtvt.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CALkWK0mDDKETE1O=g7X5s5MJvU7UA_NQiMNESor_8=phW0WR-A@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 5 quoted lines
> Junio C Hamano wrote:
>
>> [...]
>
> Okay, so what you're saying makes sense.
That is not a very useful style of quoting; what did you just agree to?

I think we should step back and clarify the "to which repository the push goes" and "what branch(es) in that chosen repository is updated". The former is determined by your original "triangular" topic in the recent world order.

The push.default specifies the logic/algorithm to decide the latter, when there is no stronger configuration is given (e.g. the push refspecs in remote.*.push, and branch.*.push).

> - current: push "$(HEAD)".  No restrictions on destination.

This updates the branch with the same name the current branch on the pushing side.

> - matching: push ":" to the destination specified by the current
> branch.

This updates the branches in the destination repository, for which branches with the same name exists on the pushing side.

> - upstream: In the special case when fetch source is equal to push
> destination, push "$(HEAD):$(branch.$(HEAD).merge)".  Otherwise,
> fallback to current.  Useful in central workflows.

That looks to me as an inconsistent description. If you are not pushing to where you fetched from, that is not even central.

This is mean to update the branch that is fetched from and is integrated with the current branch with the tip of the current branch, so the branch at the destination repository that gets updated is branch.$current.merge. It further means that the repository being pushed to must be the same as the repository we fetch from; otherwise it is an error.

> - simple: [still haven't thought about what to do with this; I'm
> generally not in favor of artificially crippling functionality by
> erroring out]

In a central workflow (i.e. repository we fetch from to update the current branch is the same as the repository we push the tip of this branch to), this works the same as upstream, but the configured branch.$current.merge has to be the same as the name of the current branch in the local repository; otherwise it is an error.

In a triangular workflow TBD, but I think doing the same as current may be a good starting point.

> Just like upstream respects branch.<name>.merge, current respects
> branch.<name>.push, making branch-level ref mapping in triangular
> workflows possible.

I do not know we want to make branch.*.push linked to current. If it is set, shouldn't that apply when push.default is "matching" and other values? That is why I threw it in the same category as the traditional push refspecs in remote.*.push in the early part of this message.

Previous: Ramkumar RamachandraNext: Junio C Hamano
Message 12 of 16 in “Fix triangular workflows for upstream, simple”
  1. 0/4 Fix triangular workflows for upstream, simpleRamkumar Ramachandra, Jun 9, 2013
  2. 1/4 t/push-default: remove redundant test_config linesRamkumar Ramachandra, Jun 9, 2013
  3. 2/4 push: make upstream, simple work with pushdefaultRamkumar Ramachandra, Jun 9, 2013
  4. Junio C HamanoJun 9, 2013
  5. Ramkumar RamachandraJun 10, 2013
  6. Junio C HamanoJun 10, 2013
  7. Ramkumar RamachandraJun 10, 2013
  8. Junio C HamanoJun 10, 2013
  9. Ramkumar RamachandraJun 10, 2013
  10. Junio C HamanoJun 10, 2013
  11. Ramkumar RamachandraJun 13, 2013
  12. Junio C HamanoJun 13, 2013
  13. Junio C HamanoJun 13, 2013
  14. Ramkumar RamachandraJun 13, 2013
  15. 3/4 t/push-default: generalize test_push_{success, commit}Ramkumar Ramachandra, Jun 9, 2013
  16. 4/4 t/push-default: test pushdefault with all modesRamkumar Ramachandra, Jun 9, 2013

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.