branch.autoSetupMerge option for "if name matches only"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux