404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.221.191.25: ~ $
#!/usr/bin/perl

# List people who might be interested in a patch.  Useful as the argument to
# git-send-email --cc-cmd option, and in other situations.
#
# Usage: git contacts <file | rev-list option> ...

use strict;
use warnings;
use IPC::Open2;

my $since = '5-years-ago';
my $min_percent = 10;
my $labels_rx = qr/Signed-off-by|Reviewed-by|Acked-by|Cc|Reported-by/i;
my %seen;

sub format_contact {
	my ($name, $email) = @_;
	return "$name <$email>";
}

sub parse_commit {
	my ($commit, $data) = @_;
	my $contacts = $commit->{contacts};
	my $inbody = 0;
	for (split(/^/m, $data)) {
		if (not $inbody) {
			if (/^author ([^<>]+) <(\S+)> .+$/) {
				$contacts->{format_contact($1, $2)} = 1;
			} elsif (/^$/) {
				$inbody = 1;
			}
		} elsif (/^$labels_rx:\s+([^<>]+)\s+<(\S+?)>$/o) {
			$contacts->{format_contact($1, $2)} = 1;
		}
	}
}

sub import_commits {
	my ($commits) = @_;
	return unless %$commits;
	my $pid = open2 my $reader, my $writer, qw(git cat-file --batch);
	for my $id (keys(%$commits)) {
		print $writer "$id\n";
		my $line = <$reader>;
		if ($line =~ /^([0-9a-f]{40}) commit (\d+)/) {
			my ($cid, $len) = ($1, $2);
			die "expected $id but got $cid\n" unless $id eq $cid;
			my $data;
			# cat-file emits newline after data, so read len+1
			read $reader, $data, $len + 1;
			parse_commit($commits->{$id}, $data);
		}
	}
	close $reader;
	close $writer;
	waitpid($pid, 0);
	die "git-cat-file error: $?\n" if $?;
}

sub get_blame {
	my ($commits, $source, $from, $ranges) = @_;
	return unless @$ranges;
	open my $f, '-|',
		qw(git blame --porcelain -C),
		map({"-L$_->[0],+$_->[1]"} @$ranges),
		'--since', $since, "$from^", '--', $source or die;
	while (<$f>) {
		if (/^([0-9a-f]{40}) \d+ \d+ \d+$/) {
			my $id = $1;
			$commits->{$id} = { id => $id, contacts => {} }
				unless $seen{$id};
			$seen{$id} = 1;
		}
	}
	close $f;
}

sub blame_sources {
	my ($sources, $commits) = @_;
	for my $s (keys %$sources) {
		for my $id (keys %{$sources->{$s}}) {
			get_blame($commits, $s, $id, $sources->{$s}{$id});
		}
	}
}

sub scan_patches {
	my ($sources, $id, $f) = @_;
	my $source;
	while (<$f>) {
		if (/^From ([0-9a-f]{40}) Mon Sep 17 00:00:00 2001$/) {
			$id = $1;
			$seen{$id} = 1;
		}
		next unless $id;
		if (m{^--- (?:a/(.+)|/dev/null)$}) {
			$source = $1;
		} elsif (/^@@ -(\d+)(?:,(\d+))?/ && $source) {
			my $len = defined($2) ? $2 : 1;
			push @{$sources->{$source}{$id}}, [$1, $len] if $len;
		}
	}
}

sub scan_patch_file {
	my ($commits, $file) = @_;
	open my $f, '<', $file or die "read failure: $file: $!\n";
	scan_patches($commits, undef, $f);
	close $f;
}

sub parse_rev_args {
	my @args = @_;
	open my $f, '-|',
		qw(git rev-parse --revs-only --default HEAD --symbolic), @args
		or die;
	my @revs;
	while (<$f>) {
		chomp;
		push @revs, $_;
	}
	close $f;
	return @revs if scalar(@revs) != 1;
	return "^$revs[0]", 'HEAD' unless $revs[0] =~ /^-/;
	return $revs[0], 'HEAD';
}

sub scan_rev_args {
	my ($commits, $args) = @_;
	my @revs = parse_rev_args(@$args);
	open my $f, '-|', qw(git rev-list --reverse), @revs or die;
	while (<$f>) {
		chomp;
		my $id = $_;
		$seen{$id} = 1;
		open my $g, '-|', qw(git show -C --oneline), $id or die;
		scan_patches($commits, $id, $g);
		close $g;
	}
	close $f;
}

sub mailmap_contacts {
	my ($contacts) = @_;
	my %mapped;
	my $pid = open2 my $reader, my $writer, qw(git check-mailmap --stdin);
	for my $contact (keys(%$contacts)) {
		print $writer "$contact\n";
		my $canonical = <$reader>;
		chomp $canonical;
		$mapped{$canonical} += $contacts->{$contact};
	}
	close $reader;
	close $writer;
	waitpid($pid, 0);
	die "git-check-mailmap error: $?\n" if $?;
	return \%mapped;
}

if (!@ARGV) {
	die "No input revisions or patch files\n";
}

my (@files, @rev_args);
for (@ARGV) {
	if (-e) {
		push @files, $_;
	} else {
		push @rev_args, $_;
	}
}

my %sources;
for (@files) {
	scan_patch_file(\%sources, $_);
}
if (@rev_args) {
	scan_rev_args(\%sources, \@rev_args)
}

my $toplevel = `git rev-parse --show-toplevel`;
chomp $toplevel;
chdir($toplevel) or die "chdir failure: $toplevel: $!\n";

my %commits;
blame_sources(\%sources, \%commits);
import_commits(\%commits);

my $contacts = {};
for my $commit (values %commits) {
	for my $contact (keys %{$commit->{contacts}}) {
		$contacts->{$contact}++;
	}
}
$contacts = mailmap_contacts($contacts);

my $ncommits = scalar(keys %commits);
for my $contact (keys %$contacts) {
	my $percent = $contacts->{$contact} * 100 / $ncommits;
	next if $percent < $min_percent;
	print "$contact\n";
}

Filemanager

Name Type Size Permission Actions
mergetools Folder 0755
git File 3.67 MB 0755
git-add File 3.67 MB 0755
git-am File 3.67 MB 0755
git-annotate File 3.67 MB 0755
git-apply File 3.67 MB 0755
git-archive File 3.67 MB 0755
git-bisect File 3.67 MB 0755
git-blame File 3.67 MB 0755
git-branch File 3.67 MB 0755
git-bugreport File 3.67 MB 0755
git-bundle File 3.67 MB 0755
git-cat-file File 3.67 MB 0755
git-check-attr File 3.67 MB 0755
git-check-ignore File 3.67 MB 0755
git-check-mailmap File 3.67 MB 0755
git-check-ref-format File 3.67 MB 0755
git-checkout File 3.67 MB 0755
git-checkout--worker File 3.67 MB 0755
git-checkout-index File 3.67 MB 0755
git-cherry File 3.67 MB 0755
git-cherry-pick File 3.67 MB 0755
git-clean File 3.67 MB 0755
git-clone File 3.67 MB 0755
git-column File 3.67 MB 0755
git-commit File 3.67 MB 0755
git-commit-graph File 3.67 MB 0755
git-commit-tree File 3.67 MB 0755
git-config File 3.67 MB 0755
git-contacts File 4.4 KB 0755
git-count-objects File 3.67 MB 0755
git-credential File 3.67 MB 0755
git-credential-cache File 3.67 MB 0755
git-credential-cache--daemon File 3.67 MB 0755
git-credential-netrc File 10.69 KB 0755
git-credential-store File 3.67 MB 0755
git-describe File 3.67 MB 0755
git-diagnose File 3.67 MB 0755
git-diff File 3.67 MB 0755
git-diff-files File 3.67 MB 0755
git-diff-index File 3.67 MB 0755
git-diff-tree File 3.67 MB 0755
git-difftool File 3.67 MB 0755
git-difftool--helper File 2.55 KB 0755
git-fast-export File 3.67 MB 0755
git-fast-import File 3.67 MB 0755
git-fetch File 3.67 MB 0755
git-fetch-pack File 3.67 MB 0755
git-filter-branch File 15.49 KB 0755
git-fmt-merge-msg File 3.67 MB 0755
git-for-each-ref File 3.67 MB 0755
git-for-each-repo File 3.67 MB 0755
git-format-patch File 3.67 MB 0755
git-fsck File 3.67 MB 0755
git-fsck-objects File 3.67 MB 0755
git-fsmonitor--daemon File 3.67 MB 0755
git-gc File 3.67 MB 0755
git-get-tar-commit-id File 3.67 MB 0755
git-grep File 3.67 MB 0755
git-hash-object File 3.67 MB 0755
git-help File 3.67 MB 0755
git-hook File 3.67 MB 0755
git-http-backend File 2.14 MB 0755
git-http-fetch File 2.17 MB 0755
git-http-push File 2.19 MB 0755
git-imap-send File 2.19 MB 0755
git-index-pack File 3.67 MB 0755
git-init File 3.67 MB 0755
git-init-db File 3.67 MB 0755
git-interpret-trailers File 3.67 MB 0755
git-log File 3.67 MB 0755
git-ls-files File 3.67 MB 0755
git-ls-remote File 3.67 MB 0755
git-ls-tree File 3.67 MB 0755
git-mailinfo File 3.67 MB 0755
git-mailsplit File 3.67 MB 0755
git-maintenance File 3.67 MB 0755
git-merge File 3.67 MB 0755
git-merge-base File 3.67 MB 0755
git-merge-file File 3.67 MB 0755
git-merge-index File 3.67 MB 0755
git-merge-octopus File 2.42 KB 0755
git-merge-one-file File 3.61 KB 0755
git-merge-ours File 3.67 MB 0755
git-merge-recursive File 3.67 MB 0755
git-merge-resolve File 1.2 KB 0755
git-merge-subtree File 3.67 MB 0755
git-merge-tree File 3.67 MB 0755
git-mergetool File 11.42 KB 0755
git-mergetool--lib File 10.48 KB 0644
git-mktag File 3.67 MB 0755
git-mktree File 3.67 MB 0755
git-multi-pack-index File 3.67 MB 0755
git-mv File 3.67 MB 0755
git-name-rev File 3.67 MB 0755
git-notes File 3.67 MB 0755
git-pack-objects File 3.67 MB 0755
git-pack-redundant File 3.67 MB 0755
git-pack-refs File 3.67 MB 0755
git-patch-id File 3.67 MB 0755
git-prune File 3.67 MB 0755
git-prune-packed File 3.67 MB 0755
git-pull File 3.67 MB 0755
git-push File 3.67 MB 0755
git-quiltimport File 3.61 KB 0755
git-range-diff File 3.67 MB 0755
git-read-tree File 3.67 MB 0755
git-rebase File 3.67 MB 0755
git-receive-pack File 3.67 MB 0755
git-reflog File 3.67 MB 0755
git-remote File 3.67 MB 0755
git-remote-ext File 3.67 MB 0755
git-remote-fd File 3.67 MB 0755
git-remote-ftp File 2.19 MB 0755
git-remote-ftps File 2.19 MB 0755
git-remote-http File 2.19 MB 0755
git-remote-https File 2.19 MB 0755
git-repack File 3.67 MB 0755
git-replace File 3.67 MB 0755
git-request-pull File 4.05 KB 0755
git-rerere File 3.67 MB 0755
git-reset File 3.67 MB 0755
git-restore File 3.67 MB 0755
git-rev-list File 3.67 MB 0755
git-rev-parse File 3.67 MB 0755
git-revert File 3.67 MB 0755
git-rm File 3.67 MB 0755
git-send-pack File 3.67 MB 0755
git-sh-i18n File 1.64 KB 0644
git-sh-i18n--envsubst File 2.13 MB 0755
git-sh-setup File 8.2 KB 0644
git-shell File 2.13 MB 0755
git-shortlog File 3.67 MB 0755
git-show File 3.67 MB 0755
git-show-branch File 3.67 MB 0755
git-show-index File 3.67 MB 0755
git-show-ref File 3.67 MB 0755
git-sparse-checkout File 3.67 MB 0755
git-stage File 3.67 MB 0755
git-stash File 3.67 MB 0755
git-status File 3.67 MB 0755
git-stripspace File 3.67 MB 0755
git-submodule File 10.26 KB 0755
git-submodule--helper File 3.67 MB 0755
git-switch File 3.67 MB 0755
git-symbolic-ref File 3.67 MB 0755
git-tag File 3.67 MB 0755
git-unpack-file File 3.67 MB 0755
git-unpack-objects File 3.67 MB 0755
git-update-index File 3.67 MB 0755
git-update-ref File 3.67 MB 0755
git-update-server-info File 3.67 MB 0755
git-upload-archive File 3.67 MB 0755
git-upload-pack File 3.67 MB 0755
git-var File 3.67 MB 0755
git-verify-commit File 3.67 MB 0755
git-verify-pack File 3.67 MB 0755
git-verify-tag File 3.67 MB 0755
git-version File 3.67 MB 0755
git-web--browse File 4.3 KB 0755
git-whatchanged File 3.67 MB 0755
git-worktree File 3.67 MB 0755
git-write-tree File 3.67 MB 0755
scalar File 2.18 MB 0755