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

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

From
ILIlari Liusvaara <ilari.liusvaara@elisanet.fi>
Date
Jan 16, 2010, 13:46 UTC
Message-ID
<20100116134656.GA4504@Knoppix>
In-Reply-To
<20100116203557.95340c00.rctay89@gmail.com>
On Sat, Jan 16, 2010 at 08:35:57PM +0800, Tay Ray Chuan wrote:
Show 7 quoted lines
> Hi,
> 
> On Sat, 16 Jan 2010 11:23:47 +0200
> Ilari Liusvaara <ilari.liusvaara@elisanet.fi> wrote:
> > +		OPT_BIT('u', "set-upstream", &flags, "Set upstream for git pull", TRANSPORT_PUSH_SET_UPSTREAM),
> 
> This line exceeds 80 characters.
Broken into two (without breaking the message), it is still over 80.
 
> Also, I think you should follow the case-style of the other option
> descriptions and s/Set(?= upstream)/set/.
Fixed.
Show 5 quoted lines
> > [snip]
> > +static void set_upstreams(struct transport *trans, struct ref *refs,
> 
> I would prefer if you could follow the naming convention and say
> "transport" instead of truncating to "trans".
Fixed.
> > +	struct ref *i;
> > +	for (i = refs; i; i = i->next) {
> 
> In most places, "ref" instead of "i" is used; ie.
 
Fixed.
> > +		 * alreay up-to-date ref create/modify (not delete).
> 
> s/alreay/already/.
Fixed.
> > +		/* Chase symbolic refs (mainly for HEAD). */
> 
> Did you mean "Change" here?
No. Changed to 'Follow'.
Show 5 quoted lines
> Regarding the checking of ref->status here:
> 
> Is it possible to delegate this to push_had_errors(remote_refs)
> instead? We skip setting up upstream tracking when there are errors
> from pushing, so we don't have to check ref->status anymore.

No. As documetnation says, the update or no update is done on per-branch basis.

<snip patch>
 
> (As a side note, if you apply this on top of 'tr/http-push-ref-status'
> in 'pu', the result of push_had_errors() is saved in a variable
> ('err'), so you could just use it and not have to call push_had_errors
> () again.)
See above.
I'll sit on v4 for some more time to wait for more comments.
-Ilari
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 3 of 11 in “Add push --set-upstream”
  1. Add push --set-upstreamIlari Liusvaara, Jan 16, 2010
  2. Tay Ray ChuanJan 16, 2010
  3. Ilari LiusvaaraJan 16, 2010
  4. Tay Ray ChuanJan 16, 2010
  5. Ilari LiusvaaraJan 16, 2010
  6. Tay Ray ChuanJan 16, 2010
  7. Tay Ray ChuanJan 16, 2010
  8. Jeff KingJan 16, 2010
  9. Tay Ray ChuanJan 16, 2010
  10. Junio C HamanoJan 16, 2010
  11. Tay Ray ChuanJan 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.