From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC 2/4] contrib: contacts: add support for multiple patches
Date: Mon, 01 Jul 2013 11:57:46 -0700 [thread overview]
Message-ID: <7v38ryglat.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v7ghaglmx.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Mon, 01 Jul 2013 11:50:30 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> while (<$f>) {
> if (/^From ([0-9a-f]{40}) Mon Sep 17 00:00:00 2001$/) {
> # beginning of a patch
> $id = $1;
> }
> next if (!defined $id);
> # inline the body of scan_hunks here...
Or alternatively, teach scan_hunks to stop reading when it sees the
beginning of the next patch (and probably you would need to return
the $id you read, as it would be more cumbersome to "rewind" the
input stream).
> if (m{^--- (a/.*|/dev/null)$}) {
> $source = ...
> } elsif (/^@@ -(\d+)...) {
> get_blame();
> }
> }
>
>> @@ -100,10 +104,8 @@ sub commits_from_patch {
>> close $f;
>> }
>>
>> -exit 1 unless @ARGV == 1;
>> -
>> my %commits;
>> -commits_from_patch(\%commits, $ARGV[0]);
>> +commits_from_patch(\%commits, $_) for (@ARGV);
>
> This change does not seem to account for an invocation without any
> argument. Perhaps write it like so to make it more readable?
>
> if (!@ARGV) {
> die "No input file?\n";
> }
>
> for (@ARGV) {
> commits_from_patch(\%commits, $_);
> }
>
>> import_commits(\%commits);
>>
>> my %count_per_person;
next prev parent reply other threads:[~2013-07-01 18:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-30 11:08 [PATCH/RFC 0/4] Perl rewrite of Ruby git-related Eric Sunshine
2013-06-30 11:08 ` [PATCH/RFC 1/4] contrib: add git-contacts helper Eric Sunshine
2013-07-01 18:39 ` Junio C Hamano
2013-07-01 19:17 ` Junio C Hamano
2013-07-02 8:17 ` Eric Sunshine
2013-07-02 18:32 ` Junio C Hamano
2013-07-02 19:04 ` Eric Sunshine
2013-06-30 11:08 ` [PATCH/RFC 2/4] contrib: contacts: add support for multiple patches Eric Sunshine
2013-07-01 18:50 ` Junio C Hamano
2013-07-01 18:57 ` Junio C Hamano [this message]
2013-07-02 8:52 ` Eric Sunshine
2013-06-30 11:08 ` [PATCH/RFC 3/4] contrib: contacts: add ability to parse from committish Eric Sunshine
2013-06-30 11:08 ` [PATCH/RFC 4/4] contrib: contacts: interpret committish akin to format-patch Eric Sunshine
2013-07-01 17:00 ` [PATCH/RFC 0/4] Perl rewrite of Ruby git-related Junio C Hamano
2013-07-02 9:01 ` Eric Sunshine
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=7v38ryglat.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.com \
/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).