git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
RPRudolf 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
Previous: Tay Ray Chuan
Message 15 of 15 in “Add push --set-upstream”
  1. Add push --set-upstreamIlari Liusvaara, Jan 15, 2010
  2. Junio C HamanoJan 15, 2010
  3. Junio C HamanoJan 15, 2010
  4. Nanako ShiraishiJan 16, 2010
  5. Junio C HamanoJan 16, 2010
  6. Tay Ray ChuanJan 16, 2010
  7. Sverre RabbelierJan 16, 2010
  8. Tay Ray ChuanJan 16, 2010
  9. Sverre RabbelierJan 16, 2010
  10. Junio C HamanoJan 16, 2010
  11. Junio C HamanoJan 16, 2010
  12. Tay Ray ChuanJan 16, 2010
  13. Nanako ShiraishiJan 16, 2010
  14. Tay Ray ChuanJan 16, 2010
  15. Rudolf PolzerJan 16, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.