Thread (59 messages) flat view 59 messages, 5 authors, 2021-06-01

Re: [PATCH v2 6/6] doc: push: explain default=simple correctly

From: Felipe Contreras <hidden>
Date: 2021-05-31 17:01:02

Mathias Kunter wrote:
Am 30.05.21 um 21:09 schrieb Felipe Contreras:
quoted
quoted
quoted
The current branch is pushed to the corresponding upstream branch, but
as a safety measure, the push is aborted if the upstream branch does not
have the same name as the local one.
Except that isn't accurate.

   git clone $url
   git checkout -b fix-1
   # do commits
   git push

Does that push the current branch to the corresponding upstream branch?
I see. Then maybe reword to something like this:
quoted
The current branch is pushed to a branch with the same name on the
remote, but as a safety measure, the push is aborted if a corresponding
upstream branch does not have the same name as the local one.
In your above example, I'm in centralized workflow, but I can still push 
the fix-1 branch to origin without having to configure an upstream 
branch for it.
No, you can't:

  % git push
  fatal: The current branch fix-1 has no upstream branch.
  To push the current branch and set the remote as upstream, use

      git push --set-upstream origin fix-1

Isn't that problem the one you originally described [1]?

The behavior doesn't change if you don't specify the remote:
`git push` == `git push origin`.
So this seems to contradict with the currently proposed 
wording:
quoted
If you are working on a centralized workflow, then you need to configure
an upstream branch with the same name.
My wording is correct, and that's precisely the problem.

Maybe you are thinking this patch series implements the fix I proposed:
it doesn't.

The two patch series merely reorganizes the code to make it simpler and
easier to understand. No functionality changes.

Cheers.

[1] https://lore.kernel.org/git/065528bf-b496-83d3-767d-2a78e50a9edf@gmail.com (local)

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help