From: Junio C Hamano <junkio@cox.net>
To: Andy Whitcroft <apw@shadowen.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] rev list add option accepting revision constraints on standard input
Date: Tue, 05 Sep 2006 15:10:54 -0700 [thread overview]
Message-ID: <7vpseaarrl.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20060905215157.GA29172@shadowen.org> (Andy Whitcroft's message of "Tue, 5 Sep 2006 22:51:57 +0100")
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.
> +/*
> + * 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...
next prev parent reply other threads:[~2006-09-05 22:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-05 12:45 send-pack: limit on negative references Andy Whitcroft
2006-09-05 16:23 ` Junio C Hamano
2006-09-05 21:32 ` Andy Whitcroft
2006-09-05 21:51 ` [PATCH 1/2] rev list add option accepting revision constraints on standard input Andy Whitcroft
2006-09-05 22:10 ` Junio C Hamano [this message]
2006-09-06 1:01 ` Andy Whitcroft
2006-09-06 4:46 ` Junio C Hamano
2006-09-05 21:52 ` [PATCH 2/2] send pack switch to using git rev list stdin Andy Whitcroft
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vpseaarrl.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=apw@shadowen.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).