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

Re: [PATCH] git push --track

From
RPRudolf Polzer <divverent@alientrap.org>
Date
Jan 14, 2010, 07:00 UTC
Message-ID
<20100114070000.GA1528@rm.endoftheinternet.org>
In-Reply-To
<be6fef0d1001132121w4e25c7f0j760d71c136012401@mail.gmail.com>
On Thu, Jan 14, 2010 at 01:21:17PM +0800, Tay Ray Chuan wrote:
Show 5 quoted lines
> Hi,
> 
> generally, it would be better if you could add some tests for this.
> 
> If I'm not wrong, the place to put it would be t5516-fetch-push.sh.

Can add that, but it seems like it won't go in anyway from the discussion here, so it's probably not worth working on it. Sad.

Show 6 quoted lines
> On Wed, Jan 13, 2010 at 11:55 PM, Rudolf Polzer <divVerent@alientrap.org> wrote:
> > On Wed, 13 Jan 2010 16:43:10 +0100, Ilari Liusvaara
> > <ilari.liusvaara@elisanet.fi> wrote:
> 
> please don't drop people from the Cc list - especially when you're
> replying to somebody!

I did not drop anyone, but simply replied from my newsreader. I really don't want to subscribe to a mailing list and then get hundreds of emails a day.

Show 8 quoted lines
> > From 123598516c7d4e1f83591e8dae64e2c76dc87c90 Mon Sep 17 00:00:00 2001
> > From: Rudolf Polzer <divVerent@alientrap.org>
> > Date: Wed, 13 Jan 2010 16:42:04 +0100
> > Subject: [PATCH 1/2] Add a feature "git push --track" to automatically make
> > the pushed branches tracking
> 
> Each patch should be sent out in its own mail. (As Matthieu has
> recommended, you should check out Documentation/SubmittingPatches.)

So, using a newsreader is not accepted practice? Why is the mailing list on a newsgroup then?

Show 23 quoted lines
> >  static const char * const push_usage[] = {
> > @@ -115,6 +116,36 @@ static int push_with_options(struct transport
> > *transport, int flags)
> >                fprintf(stderr, "Pushing to %s\n", transport->url);
> >        err = transport_push(transport, refspec_nr, refspec, flags,
> >                             &nonfastforward);
> > +       if (err == 0 && flags & TRANSPORT_PUSH_TRACK) {
> > +               struct ref *remote_refs =
> > +                       transport->get_refs_list(transport, 1);
> > +               struct ref *local_refs = get_local_heads();
> > +               int match_flags = 0;
> > +               if (flags & TRANSPORT_PUSH_ALL)
> > +                       match_flags |= MATCH_REFS_ALL;
> > +               if (flags & TRANSPORT_PUSH_MIRROR)
> > +                       match_flags |= MATCH_REFS_MIRROR;
> > +               if(!(flags & TRANSPORT_PUSH_DRY_RUN))
> > +               if(!match_refs(local_refs, &remote_refs, refspec_nr,
> > refspec,
> > +                                       match_flags)) {
> 
> It would be better if you can move this to
> transport.c::transport_push(). It repeats what's already there, so you
> don't have to configure match_flags, nor call match_refs, etc.

Then I have to duplicate it in the rsync specific push code too. Otherwise, agreed.

Show 11 quoted lines
> > +                       struct ref *next = remote_refs;
> > +                       while(next) {
> > [snip]
> > +                               next = next->next;
> 
> In most places, this is done like this:
> 
>   struct ref* ref;
>   for (ref = remote_refs; ref; ref = ref->next) {
>     ...
>   }
Sure, could do that too, I got this loop from the loop that frees a ref list.
Best regards,
Rudolf
Previous: Tay Ray ChuanNext: Junio C Hamano
Message 7 of 42 in “git push --track”
  1. git push --trackRudolf Polzer, Jan 13, 2010
  2. Ilari LiusvaaraJan 13, 2010
  3. Rudolf PolzerJan 13, 2010
  4. Ilari LiusvaaraJan 13, 2010
  5. Matthieu MoyJan 13, 2010
  6. Tay Ray ChuanJan 14, 2010
  7. Rudolf PolzerJan 14, 2010
  8. Junio C HamanoJan 14, 2010
  9. Jeff KingJan 14, 2010
  10. Junio C HamanoJan 15, 2010
  11. Rudolf PolzerJan 15, 2010
  12. Miles BaderJan 15, 2010
  13. Junio C HamanoJan 15, 2010
  14. Miles BaderJan 14, 2010
  15. Miles BaderJan 14, 2010
  16. Johannes SchindelinJan 14, 2010
  17. Miles BaderJan 14, 2010
  18. Miles BaderJan 14, 2010
  19. Rudolf PolzerJan 14, 2010
  20. Martin LanghoffJan 14, 2010
  21. Johannes SchindelinJan 14, 2010
  22. Matthieu MoyJan 14, 2010
  23. Martin LanghoffJan 14, 2010
  24. Andreas KreyJan 14, 2010
  25. Tay Ray ChuanJan 14, 2010
  26. Miles BaderJan 14, 2010
  27. Tay Ray ChuanJan 14, 2010
  28. Miles BaderJan 14, 2010
  29. Tay Ray ChuanJan 14, 2010
  30. Rudolf PolzerJan 14, 2010
  31. Junio C HamanoJan 14, 2010
  32. Miles BaderJan 15, 2010
  33. Junio C HamanoJan 15, 2010
  34. Miles BaderJan 15, 2010
  35. Matthieu MoyJan 15, 2010
  36. Nanako ShiraishiJan 14, 2010
  37. Rudolf PolzerJan 14, 2010
  38. Johannes SchindelinJan 14, 2010
  39. Nanako ShiraishiJan 14, 2010
  40. Junio C HamanoJan 14, 2010
  41. Rudolf PolzerJan 15, 2010
  42. Johannes SchindelinJan 15, 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.