Junio C Hamano wrote:
> Kevin Bracey <ke...@bracey.fi> writes:

> > And it would be ideal if the initial base and push tracking
> > information could be set up automatically on the first "git checkout
> > -b"/"git branch" and "git push".
> 
> I think checkout and branch is already covered with -t.  There may
> even be a configuration option to implicitly add -t to them (I
> didn't check).

branch.autosetupmerge=always

> > (For one, I've always found it odd
> > that there's an asymmetry - if you check out a topic branch from the
> > server to work on or use it, you get a local copy with upstream set by
> > default. But if you create a topic branch yourself then push it, the
> > upstream isn't set by default - you need the -u flag. This seems odd
> > to me, and I've seen others confused by this).
> 
> Yeah, I would imagine that it would be trivial to add an option to
> cause "git push" to do that, and it would be useful if you push to
> and pull from the same place (I haven't thought about ramifications
> such an option would have on the triangular workflows, though).

It would work wonderfully. Now:

== remote ==

% git checkout -b master origin/master
# work
% git push

== local ==

% git checkout -b topic master
# work
% git push # ERR
% git push -u origin/master
# work
% git push # ERR

That doesn't work. We could set branch.autosetupmerge=always as the default,
but it still wouldn't work, because push.default=simple (or at least it will
be), and the names don't match.

But with my patches, and branch.autosetupmerge=always (hopefully for 2.0):

== local ==

% git checkout -b topic master
# work
% git push # ERR
% git push --set-downstream origin/master
# work
% git push

Cheers.

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

Reply via email to