/
usr
/
libexec
/
git-core
/
/usr/libexec/git-core
mkdir
upload
Name
Size
Mode
Actions
mergetools/
-
0755
rm
git
4397352
0755
edit
dl
rm
git-add
4397352
0755
edit
dl
rm
git-am
4397352
0755
edit
dl
rm
git-annotate
4397352
0755
edit
dl
rm
git-apply
4397352
0755
edit
dl
rm
git-archive
4397352
0755
edit
dl
rm
git-backfill
4397352
0755
edit
dl
rm
git-bisect
4397352
0755
edit
dl
rm
git-blame
4397352
0755
edit
dl
rm
git-branch
4397352
0755
edit
dl
rm
git-bugreport
4397352
0755
edit
dl
rm
git-bundle
4397352
0755
edit
dl
rm
git-cat-file
4397352
0755
edit
dl
rm
git-check-attr
4397352
0755
edit
dl
rm
git-check-ignore
4397352
0755
edit
dl
rm
git-check-mailmap
4397352
0755
edit
dl
rm
git-check-ref-format
4397352
0755
edit
dl
rm
git-checkout
4397352
0755
edit
dl
rm
git-checkout--worker
4397352
0755
edit
dl
rm
git-checkout-index
4397352
0755
edit
dl
rm
git-cherry
4397352
0755
edit
dl
rm
git-cherry-pick
4397352
0755
edit
dl
rm
git-clean
4397352
0755
edit
dl
rm
git-clone
4397352
0755
edit
dl
rm
git-column
4397352
0755
edit
dl
rm
git-commit
4397352
0755
edit
dl
rm
git-commit-graph
4397352
0755
edit
dl
rm
git-commit-tree
4397352
0755
edit
dl
rm
git-config
4397352
0755
edit
dl
rm
git-contacts
4509
0755
edit
dl
rm
git-count-objects
4397352
0755
edit
dl
rm
git-credential
4397352
0755
edit
dl
rm
git-credential-cache
4397352
0755
edit
dl
rm
git-credential-cache--daemon
4397352
0755
edit
dl
rm
git-credential-netrc
11246
0755
edit
dl
rm
git-credential-store
4397352
0755
edit
dl
rm
git-describe
4397352
0755
edit
dl
rm
git-diagnose
4397352
0755
edit
dl
rm
git-diff
4397352
0755
edit
dl
rm
git-diff-files
4397352
0755
edit
dl
rm
git-diff-index
4397352
0755
edit
dl
rm
git-diff-pairs
4397352
0755
edit
dl
rm
git-diff-tree
4397352
0755
edit
dl
rm
git-difftool
4397352
0755
edit
dl
rm
git-difftool--helper
2664
0755
edit
dl
rm
git-fast-export
4397352
0755
edit
dl
rm
git-fast-import
4397352
0755
edit
dl
rm
git-fetch
4397352
0755
edit
dl
rm
git-fetch-pack
4397352
0755
edit
dl
rm
git-filter-branch
15795
0755
edit
dl
rm
git-fmt-merge-msg
4397352
0755
edit
dl
rm
git-for-each-ref
4397352
0755
edit
dl
rm
git-for-each-repo
4397352
0755
edit
dl
rm
git-format-patch
4397352
0755
edit
dl
rm
git-fsck
4397352
0755
edit
dl
rm
git-fsck-objects
4397352
0755
edit
dl
rm
git-fsmonitor--daemon
4397352
0755
edit
dl
rm
git-gc
4397352
0755
edit
dl
rm
git-get-tar-commit-id
4397352
0755
edit
dl
rm
git-grep
4397352
0755
edit
dl
rm
git-hash-object
4397352
0755
edit
dl
rm
git-help
4397352
0755
edit
dl
rm
git-hook
4397352
0755
edit
dl
rm
git-http-backend
848848
0755
edit
dl
rm
git-http-fetch
933280
0755
edit
dl
rm
git-http-push
1295016
0755
edit
dl
rm
git-imap-send
920072
0755
edit
dl
rm
git-index-pack
4397352
0755
edit
dl
rm
git-init
4397352
0755
edit
dl
rm
git-init-db
4397352
0755
edit
dl
rm
git-interpret-trailers
4397352
0755
edit
dl
rm
git-last-modified
4397352
0755
edit
dl
rm
git-log
4397352
0755
edit
dl
rm
git-ls-files
4397352
0755
edit
dl
rm
git-ls-remote
4397352
0755
edit
dl
rm
git-ls-tree
4397352
0755
edit
dl
rm
git-mailinfo
4397352
0755
edit
dl
rm
git-mailsplit
4397352
0755
edit
dl
rm
git-maintenance
4397352
0755
edit
dl
rm
git-merge
4397352
0755
edit
dl
rm
git-merge-base
4397352
0755
edit
dl
rm
git-merge-file
4397352
0755
edit
dl
rm
git-merge-index
4397352
0755
edit
dl
rm
git-merge-octopus
2481
0755
edit
dl
rm
git-merge-one-file
3699
0755
edit
dl
rm
git-merge-ours
4397352
0755
edit
dl
rm
git-merge-recursive
4397352
0755
edit
dl
rm
git-merge-resolve
1230
0755
edit
dl
rm
git-merge-subtree
4397352
0755
edit
dl
rm
git-merge-tree
4397352
0755
edit
dl
rm
git-mergetool
11697
0755
edit
dl
rm
git-mergetool--lib
10908
0644
edit
dl
rm
git-mktag
4397352
0755
edit
dl
rm
git-mktree
4397352
0755
edit
dl
rm
git-multi-pack-index
4397352
0755
edit
dl
rm
git-mv
4397352
0755
edit
dl
rm
git-name-rev
4397352
0755
edit
dl
rm
git-notes
4397352
0755
edit
dl
rm
git-pack-objects
4397352
0755
edit
dl
rm
git-pack-redundant
4397352
0755
edit
dl
rm
git-pack-refs
4397352
0755
edit
dl
rm
git-patch-id
4397352
0755
edit
dl
rm
git-prune
4397352
0755
edit
dl
rm
git-prune-packed
4397352
0755
edit
dl
rm
git-pull
4397352
0755
edit
dl
rm
git-push
4397352
0755
edit
dl
rm
git-quiltimport
3700
0755
edit
dl
rm
git-range-diff
4397352
0755
edit
dl
rm
git-read-tree
4397352
0755
edit
dl
rm
git-rebase
4397352
0755
edit
dl
rm
git-receive-pack
4397352
0755
edit
dl
rm
git-reflog
4397352
0755
edit
dl
rm
git-refs
4397352
0755
edit
dl
rm
git-remote
4397352
0755
edit
dl
rm
git-remote-ext
4397352
0755
edit
dl
rm
git-remote-fd
4397352
0755
edit
dl
rm
git-remote-ftp
966840
0755
edit
dl
rm
git-remote-ftps
966840
0755
edit
dl
rm
git-remote-http
966840
0755
edit
dl
rm
git-remote-https
966840
0755
edit
dl
rm
git-repack
4397352
0755
edit
dl
rm
git-replace
4397352
0755
edit
dl
rm
git-replay
4397352
0755
edit
dl
rm
git-repo
4397352
0755
edit
dl
rm
git-request-pull
3996
0755
edit
dl
rm
git-rerere
4397352
0755
edit
dl
rm
git-reset
4397352
0755
edit
dl
rm
git-restore
4397352
0755
edit
dl
rm
git-rev-list
4397352
0755
edit
dl
rm
git-rev-parse
4397352
0755
edit
dl
rm
git-revert
4397352
0755
edit
dl
rm
git-rm
4397352
0755
edit
dl
rm
git-send-pack
4397352
0755
edit
dl
rm
git-sh-i18n
1683
0644
edit
dl
rm
git-sh-i18n--envsubst
831264
0755
edit
dl
rm
git-sh-setup
8398
0644
edit
dl
rm
git-shell
826960
0755
edit
dl
rm
git-shortlog
4397352
0755
edit
dl
rm
git-show
4397352
0755
edit
dl
rm
git-show-branch
4397352
0755
edit
dl
rm
git-show-index
4397352
0755
edit
dl
rm
git-show-ref
4397352
0755
edit
dl
rm
git-sparse-checkout
4397352
0755
edit
dl
rm
git-stage
4397352
0755
edit
dl
rm
git-stash
4397352
0755
edit
dl
rm
git-status
4397352
0755
edit
dl
rm
git-stripspace
4397352
0755
edit
dl
rm
git-submodule
10497
0755
edit
dl
rm
git-submodule--helper
4397352
0755
edit
dl
rm
git-switch
4397352
0755
edit
dl
rm
git-symbolic-ref
4397352
0755
edit
dl
rm
git-tag
4397352
0755
edit
dl
rm
git-unpack-file
4397352
0755
edit
dl
rm
git-unpack-objects
4397352
0755
edit
dl
rm
git-update-index
4397352
0755
edit
dl
rm
git-update-ref
4397352
0755
edit
dl
rm
git-update-server-info
4397352
0755
edit
dl
rm
git-upload-archive
4397352
0755
edit
dl
rm
git-upload-pack
4397352
0755
edit
dl
rm
git-var
4397352
0755
edit
dl
rm
git-verify-commit
4397352
0755
edit
dl
rm
git-verify-pack
4397352
0755
edit
dl
rm
git-verify-tag
4397352
0755
edit
dl
rm
git-version
4397352
0755
edit
dl
rm
git-web--browse
4405
0755
edit
dl
rm
git-whatchanged
4397352
0755
edit
dl
rm
git-worktree
4397352
0755
edit
dl
rm
git-write-tree
4397352
0755
edit
dl
rm
scalar
876968
0755
edit
dl
rm
Edit:
/usr/libexec/git-core/git-contacts
(4509B)
#!/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"; }
Save
cmd:
run