From: Andy Whitcroft <apw@shadowen.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] rev list add option accepting revision constraints on standard input
Date: Wed, 06 Sep 2006 02:01:28 +0100 [thread overview]
Message-ID: <44FE1DE8.1040200@shadowen.org> (raw)
In-Reply-To: <7vpseaarrl.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> 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...
Heh, well I'll give it another poke tommorrow my time ...
Thanks for the feedback. Its hard to get any context on something new
without trying and failing :).
-apw
next prev parent reply other threads:[~2006-09-06 1:02 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
2006-09-06 1:01 ` Andy Whitcroft [this message]
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=44FE1DE8.1040200@shadowen.org \
--to=apw@shadowen.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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).