Re: [PATCH v2] Add push --set-upstream

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

 



On Sat, Jan 16, 2010 at 09:00:30AM +0800, Tay Ray Chuan wrote:
> 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.

> > +               /* 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.

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