Re: [PATCH v2] Add push --set-upstream
- From
- Rudolf Polzer <divverent@alientrap.org>
- Date
- Jan 16, 2010, 18:13 UTC
- Message-ID
- <20100116181350.GA28938@rm.endoftheinternet.org>
- In-Reply-To
- <be6fef0d1001151700se963950i6932d30bae3ca940@mail.gmail.com>
On Sat, Jan 16, 2010 at 09:00:30AM +0800, Tay Ray Chuan wrote:
Show 6 quoted lines
> Hi, > > I'm adding people from the "git push --track" thread here, since this > feature is related to what they want. > > (sorry for any line-wrap mangling in the patch.)
Looks perfect to me, and if people want it, one could add the same option as an alias to the current --track option to the checkout and branch commands.
Show 7 quoted lines
> > + /* Chase symbolic refs (mainly for HEAD). */ > > + localname = i->peer_ref->name; > > + remotename = i->name; > > + tmp = resolve_ref(localname, sha, 1, &flag); > > + if (tmp && flag & REF_ISSYMREF && > > + !prefixcmp(tmp, "refs/heads/")) > > + localname = tmp;
I would never have thought of that case - good catch.
Show 8 quoted lines
> > @@ -974,6 +1016,10 @@ int transport_push(struct transport *transport,
> > verify_remote_names(refspec_nr, refspec);
> >
> > if (transport->push) {
> > + /* Maybe FIXME. But no important transport uses this case. */
> > + if (flags & TRANSPORT_PUSH_SET_UPSTREAM)
> > + die("This transport does not support using --set-upstream");
> > +That's ONE way to do it - and seriously, I don't know if anyone uses that transport :P
However, one possible improvement for this case would be setting ALL pushed refs as tracking if the push succeeded, and none otherwise.
Are new transports going to be added that use transport->push, or is that interface deprecated anyway?
Best regards,
Rudolf Polzer