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

Re: [PATCH 1/5] remote: don't use remote->{fetch,push}_refspec

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 16, 2017, 22:00 UTC
Message-ID
<xmqq60fvwq24.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170616192837.11035-2-szeder.dev@gmail.com>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 20 quoted lines
> diff --git a/remote.c b/remote.c
> index 336db8298..a021decee 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -919,6 +919,26 @@ char *apply_refspecs(struct refspec *refspecs, int nr_refspec,
>  	return query.dst;
>  }
>  
> +void strbuf_add_refspec(struct strbuf *sb, const struct refspec *refspec)
> +{
> +	if (refspec->force)
> +		strbuf_addch(sb, '+');
> +	if (refspec->src)
> +		strbuf_addstr(sb, refspec->src);
> +	if (refspec->dst) {
> +		strbuf_addch(sb, ':');
> +		strbuf_addstr(sb, refspec->dst);
> +	} else if (!refspec->src)
> +		strbuf_addch(sb, ':');
> +}
Hmph, don't we support wildcarding (aka refspec->pattern)?
    ... goes and looks ...

Ah, even when we set the .pattern bit, we retain '*' in the string, so the above is correct.

The last one looks a bit sloppy; shouldn't it be inspecting the .matching bit?

Previous: SZEDER GáborNext: SZEDER Gábor
Message 5 of 12 in “remote: eliminate remote->{fetch,push}_refspec and lazy parsing of refspecs”
  1. 0/5 remote: eliminate remote->{fetch,push}_refspec and lazy parsing of refspecsSZEDER Gábor, Jun 16, 2017
  2. 2/5 remote.c: don't pass copies of refspecs to add_{fetch,push}_refspec()SZEDER Gábor, Jun 16, 2017
  3. 4/5 remote.c: eliminate remote->fetch_refspecSZEDER Gábor, Jun 16, 2017
  4. 1/5 remote: don't use remote->{fetch,push}_refspecSZEDER Gábor, Jun 16, 2017
  5. Junio C HamanoJun 16, 2017
  6. 3/5 remote.c: extract a helper function to parse a single refspecSZEDER Gábor, Jun 16, 2017
  7. 5/5 remote.c: eliminate remote->push_refspecSZEDER Gábor, Jun 16, 2017
  8. Junio C HamanoJun 16, 2017
  9. SZEDER GáborJun 17, 2017
  10. Jeff KingJun 17, 2017
  11. Jeff KingJun 17, 2017
  12. Junio C HamanoJun 19, 2017

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.