git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* branch.autoSetupMerge option for "if name matches only"?
@ 2022-02-03 18:58 Tao Klerks
  2022-02-09 13:46 ` Xavier Morel
  0 siblings, 1 reply; 3+ messages in thread
From: Tao Klerks @ 2022-02-03 18:58 UTC (permalink / raw)
  To: git

Hi folks,

In trying to recommend sane simple understandable git flows for large
numbers of (often not git-proficient) users, I've found upstream
tracking branches to be a sticky area.

The main problem is that when users intentionally create a new branch
"test1" from origin/master, for example, they automatically get
upstream tracking... but after they've pushed their new branch to the
remote, they (unless they do something "wrong") typically have
tracking switched to "origin/test1" (after a weird error about not
pushing to a differently-named upstream - because they have
push.default set to "simple", the safe default - unless they're using
a GUI that sweeps this under the rug). So the behavior of "pull"
changes dramatically, from the user's perspective, after the first
time they push. Until that point, the system is behaving "weird".

On the other hand, when another user wants to work on "test1"
directly, they branch from "origin/test1", they get upstream tracking,
and everything is normal/predictable.

I *think* the simplest / most understandable behavior for most users
would be a variation on the current branch.autoSetupMerge=true
behavior, except *only set up tracking if the local branch name
matches*.

This new branch.autoSetupMerge behavior (dare we call it "simple", to
match push.default?) would mean that when branching from origin/master
to test1, you would not get an upstream. Pull would say something like
"hey, you haven't pushed yet", and everything would be understandable.

Is this a scheme that makes sense to people here?

Alternatively, another workable option for my not-so-sophisticated
users would be something like branch.autoSetupMerge=current, which
would simply always assume the same-name branch on the same remote. If
this were a new branch, initial pulls would say "but there's no such
branch on the remote!", and the first push would be even simpler,
succeeding without the current surprising "The current branch has no
upstream branch -0 run this slightly-more-complex command" message.

Are my users the only ones who get caught out by the default tracking
behavior when branching from a different upstream branch (but *expect*
tracking when creating a local instance of a remote branch)?

Thanks,
Tao

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-24 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-03 18:58 branch.autoSetupMerge option for "if name matches only"? Tao Klerks
2022-02-09 13:46 ` Xavier Morel
2022-02-24 16:47   ` Tao Klerks

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 NNTP newsgroup(s).