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

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

 



lists@xxxxxxxxxxxxxxxx (Stefan Haller) writes:

> Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> wrote:
>
>> What do you set "upstream" to in your flow?
>
> The remote topic branch with the same name.

OK, so once it is configured, 'current' and 'upstream' do the same
thing. The difference is how the upstream is configured, and what
happens if you forget to do it.

> 1) After creating a new local topic branch, I must remember to use
> "push -u origin new-branch" the first time I push it.

For this case, I'd say 'upstream' is superior to 'current', because it
will remind you to set the upstream on the first push, while 'current'
will let you silently continue with the upstream unconfigured (which you
need for 'pull' and 'status').

> I don't want to have to remember whether this is the first time I
> push; it would be nice to be able to say "git push" the first time as
> well.

(If you're going to work colaboratively, I'd say it makes sense to push
an empty branch, just to let other people know that the branch is
created, but that's not the point here)

Probably the ideal command for you would be to allow something like

  git checkout -b topic origin/master --set-upstream=origin/topic

> 2) I get bitten by commands that configure the "wrong" upstream branch
> without me realizing it, like "checkout -b topic origin/master".

You may want to set branch.autosetupmerge to false, then. It will
disable the "set upstream" magic (but unfortunately, it will also
disable it for a plain "git checkout new-branch" which would create
new-branch automagically if origin/new-branch already exists).

Just to be clear: I'm not saying that your workflow is wrong, but my
feeling is that you wouldn't be hurt by 'push.default=upstream'. The
area of potential improvement for your case would be at branch creation
time more than at push time.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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]