Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH/RFC 2/4] contrib: contacts: add support for multiple patches

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:58

Junio C Hamano [off-list ref] 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();
		}
	}
quoted
@@ -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, $_);
	}	        
quoted
 import_commits(\%commits);
 
 my %count_per_person;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help