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

Re: [PATCH 1/2] rev list add option accepting revision constraints on standard input

From
Junio C Hamano <junkio@cox.net>
Date
Sep 5, 2006, 22:10 UTC
Message-ID
<7vpseaarrl.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060905215157.GA29172@shadowen.org>
Andy Whitcroft <apw@shadowen.org> writes:
> Add a --stdin flag which causes rev-list to additionally read
> its stdin stream and parse that for revision constraints.
Show 18 quoted lines
> +/*
> + * Parse revision information, filling in the "rev_info" structure,
> + * revisions are taken from stream.
> + */
> +static void setup_revisions_stream(FILE *stream, struct rev_info *revs)
> +{
> +	char line[1000];
> +	const char *args[] = { 0, line, 0 };
> +
> +	while (fgets(line, sizeof(line), stream) != NULL) {
> +		line[strlen(line) - 1] = 0;
> +
> +		if (line[0] == '-')
> +			die("options not supported in --stdin mode");
> +
> +		(void)setup_revisions(2, args, revs, NULL);
> +	}
> +}

Is calling setup_revisions() on the same revs like this many times safe? I do not think so, especially what is after the primary "for()" loop in the function.

I was sort-of expecting that you would instead replace that primary for() loop in setup_revisions() with some sort of callback...

Previous: Andy WhitcroftNext: Andy Whitcroft
Message 5 of 8 in “send-pack: limit on negative references”
  1. Andy WhitcroftSep 5, 2006
  2. Junio C HamanoSep 5, 2006
  3. Andy WhitcroftSep 5, 2006
  4. 1/2 rev list add option accepting revision constraints on standard inputAndy Whitcroft, Sep 5, 2006
  5. Junio C HamanoSep 5, 2006
  6. Andy WhitcroftSep 6, 2006
  7. Junio C HamanoSep 6, 2006
  8. 2/2 send pack switch to using git rev list stdinAndy Whitcroft, Sep 5, 2006

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.