Re: [RFC PATCH] push: start warning upcoming default change for push.default

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

 



On 15.03.2012 09:02, Matthieu Moy wrote:
Holger Hellmuth<hellmuth@xxxxxxxxxx>  writes:

So today I tried to create a
bidirectional link between a local and a remote branch using only
porcelain commands (i.e. without using git config directly). Somehow I
didn't succeed. I can either use git checkout --track or git push -u
to make a pull connection between the two, but to automatically push I
would have to create a branch of the same name (and know that this is
the magical ingredient that makes it work!)

In this particular case, having 'push.default=upstream' would have done
it for you: your "push -u" would have set up the upstream, and the next
"push" would have followed it.

I know, this is why I voted for "upstream", but there are good reasons for "current" too. Whatever is decided on will still get some users by surprise.

(or you could "git push remote local-branch:remote-branch")


Sure, I can believe that a new user will be able to get at that line after studying the "git push" manual page (or reading a tutorial), but I really doubt he will easily find out where to go from there to simplify that line. And typing that line every time for a permanent connection is out of the question, right?

That is why I think git push --track remote local-branch:remote-branch (or --permanent, --perm, --follow, --configure, --keep) would be a great help because a tutorial wouldn't have to talk about a lot of special cases, config options, it could just explain:

-----------------------------
1) To follow a remote repository do "git remote add <repo> <url>
2) To follow a remote branch do "git checkout [-b localbranch] --track <repo>/<branch>. Then "git pull" while in this branch will synchronize you whenever you want to be up-to-date. 3) To get a remote branch to follow you do "git push --track <repo> <local-branch>:<branch> once. Then "git push" while in this branch will synchronize the remote branch.
-----------------------------

With this simple recipe 90% of all workflows could be configured by a novice without embarrasing himself. Can you find a similar simple and consise recipe that would work today (even with upstream or current) ? I doubt it.

Sorry about opening up another tangent, but this is somewhat connected. If we give the novice an easy instrument to configure what he really wants then the default becomes much less important.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]