@noldova/checkpoints.git.linux-arm64 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +11 -2
  3. package/git/bin/git +0 -0
  4. package/git/bin/scalar +0 -0
  5. package/git/etc/gitconfig +13 -0
  6. package/git/libexec/git-core/git +0 -0
  7. package/git/libexec/git-core/git-archimport +1136 -0
  8. package/git/libexec/git-core/git-cvsexportcommit +469 -0
  9. package/git/libexec/git-core/git-cvsimport +1185 -0
  10. package/git/libexec/git-core/git-cvsserver +5109 -0
  11. package/git/libexec/git-core/git-daemon +0 -0
  12. package/git/libexec/git-core/git-difftool--helper +125 -0
  13. package/git/libexec/git-core/git-filter-branch +665 -0
  14. package/git/libexec/git-core/git-http-backend +0 -0
  15. package/git/libexec/git-core/git-http-fetch +0 -0
  16. package/git/libexec/git-core/git-imap-send +0 -0
  17. package/git/libexec/git-core/git-instaweb +786 -0
  18. package/git/libexec/git-core/git-merge-octopus +112 -0
  19. package/git/libexec/git-core/git-merge-one-file +167 -0
  20. package/git/libexec/git-core/git-merge-resolve +64 -0
  21. package/git/libexec/git-core/git-mergetool +579 -0
  22. package/git/libexec/git-core/git-mergetool--lib +549 -0
  23. package/git/libexec/git-core/git-quiltimport +155 -0
  24. package/git/libexec/git-core/git-receive-pack +0 -0
  25. package/git/libexec/git-core/git-remote-ftp +0 -0
  26. package/git/libexec/git-core/git-remote-ftps +0 -0
  27. package/git/libexec/git-core/git-remote-http +0 -0
  28. package/git/libexec/git-core/git-remote-https +0 -0
  29. package/git/libexec/git-core/git-request-pull +178 -0
  30. package/git/libexec/git-core/git-send-email +2474 -0
  31. package/git/libexec/git-core/git-sh-i18n +79 -0
  32. package/git/libexec/git-core/git-sh-i18n--envsubst +0 -0
  33. package/git/libexec/git-core/git-sh-setup +357 -0
  34. package/git/libexec/git-core/git-shell +0 -0
  35. package/git/libexec/git-core/git-submodule +671 -0
  36. package/git/libexec/git-core/git-upload-archive +0 -0
  37. package/git/libexec/git-core/git-upload-pack +0 -0
  38. package/git/libexec/git-core/git-web--browse +196 -0
  39. package/git/libexec/git-core/mergetools/araxis +26 -0
  40. package/git/libexec/git-core/mergetools/bc +37 -0
  41. package/git/libexec/git-core/mergetools/codecompare +31 -0
  42. package/git/libexec/git-core/mergetools/deltawalker +33 -0
  43. package/git/libexec/git-core/mergetools/diffmerge +26 -0
  44. package/git/libexec/git-core/mergetools/diffuse +23 -0
  45. package/git/libexec/git-core/mergetools/ecmerge +22 -0
  46. package/git/libexec/git-core/mergetools/emerge +34 -0
  47. package/git/libexec/git-core/mergetools/examdiff +24 -0
  48. package/git/libexec/git-core/mergetools/guiffy +26 -0
  49. package/git/libexec/git-core/mergetools/gvimdiff +1 -0
  50. package/git/libexec/git-core/mergetools/kdiff3 +44 -0
  51. package/git/libexec/git-core/mergetools/kompare +19 -0
  52. package/git/libexec/git-core/mergetools/meld +97 -0
  53. package/git/libexec/git-core/mergetools/nvimdiff +1 -0
  54. package/git/libexec/git-core/mergetools/opendiff +22 -0
  55. package/git/libexec/git-core/mergetools/p4merge +44 -0
  56. package/git/libexec/git-core/mergetools/smerge +20 -0
  57. package/git/libexec/git-core/mergetools/tkdiff +24 -0
  58. package/git/libexec/git-core/mergetools/tortoisemerge +40 -0
  59. package/git/libexec/git-core/mergetools/vimdiff +657 -0
  60. package/git/libexec/git-core/mergetools/vscode +19 -0
  61. package/git/libexec/git-core/mergetools/winmerge +23 -0
  62. package/git/libexec/git-core/mergetools/xxdiff +38 -0
  63. package/git/libexec/git-core/scalar +0 -0
  64. package/git/share/bash-completion/completions/git +4115 -0
  65. package/git/share/git-core/templates/description +1 -0
  66. package/git/share/git-core/templates/hooks/applypatch-msg.sample +15 -0
  67. package/git/share/git-core/templates/hooks/commit-msg.sample +74 -0
  68. package/git/share/git-core/templates/hooks/fsmonitor-watchman.sample +168 -0
  69. package/git/share/git-core/templates/hooks/post-update.sample +8 -0
  70. package/git/share/git-core/templates/hooks/pre-applypatch.sample +14 -0
  71. package/git/share/git-core/templates/hooks/pre-commit.sample +49 -0
  72. package/git/share/git-core/templates/hooks/pre-merge-commit.sample +13 -0
  73. package/git/share/git-core/templates/hooks/pre-push.sample +53 -0
  74. package/git/share/git-core/templates/hooks/pre-rebase.sample +169 -0
  75. package/git/share/git-core/templates/hooks/pre-receive.sample +24 -0
  76. package/git/share/git-core/templates/hooks/prepare-commit-msg.sample +42 -0
  77. package/git/share/git-core/templates/hooks/push-to-checkout.sample +78 -0
  78. package/git/share/git-core/templates/hooks/sendemail-validate.sample +77 -0
  79. package/git/share/git-core/templates/hooks/update.sample +128 -0
  80. package/git/share/git-core/templates/info/exclude +6 -0
  81. package/git/share/gitweb/gitweb.cgi +8499 -0
  82. package/git/share/gitweb/static/git-favicon.png +0 -0
  83. package/git/share/gitweb/static/git-logo.png +0 -0
  84. package/git/share/gitweb/static/gitweb.css +756 -0
  85. package/git/share/gitweb/static/gitweb.js +1579 -0
  86. package/git/share/locale/af/LC_MESSAGES/git.mo +0 -0
  87. package/git/share/locale/bg/LC_MESSAGES/git.mo +0 -0
  88. package/git/share/locale/ca/LC_MESSAGES/git.mo +0 -0
  89. package/git/share/locale/de/LC_MESSAGES/git.mo +0 -0
  90. package/git/share/locale/el/LC_MESSAGES/git.mo +0 -0
  91. package/git/share/locale/es/LC_MESSAGES/git.mo +0 -0
  92. package/git/share/locale/fr/LC_MESSAGES/git.mo +0 -0
  93. package/git/share/locale/ga/LC_MESSAGES/git.mo +0 -0
  94. package/git/share/locale/id/LC_MESSAGES/git.mo +0 -0
  95. package/git/share/locale/is/LC_MESSAGES/git.mo +0 -0
  96. package/git/share/locale/it/LC_MESSAGES/git.mo +0 -0
  97. package/git/share/locale/ko/LC_MESSAGES/git.mo +0 -0
  98. package/git/share/locale/pl/LC_MESSAGES/git.mo +0 -0
  99. package/git/share/locale/pt_BR/LC_MESSAGES/git.mo +0 -0
  100. package/git/share/locale/pt_PT/LC_MESSAGES/git.mo +0 -0
  101. package/git/share/locale/ru/LC_MESSAGES/git.mo +0 -0
  102. package/git/share/locale/sv/LC_MESSAGES/git.mo +0 -0
  103. package/git/share/locale/tr/LC_MESSAGES/git.mo +0 -0
  104. package/git/share/locale/uk/LC_MESSAGES/git.mo +0 -0
  105. package/git/share/locale/vi/LC_MESSAGES/git.mo +0 -0
  106. package/git/share/locale/zh_CN/LC_MESSAGES/git.mo +0 -0
  107. package/git/share/locale/zh_TW/LC_MESSAGES/git.mo +0 -0
  108. package/git/share/perl5/FromCPAN/Error.pm +1040 -0
  109. package/git/share/perl5/FromCPAN/Mail/Address.pm +280 -0
  110. package/git/share/perl5/Git/I18N.pm +125 -0
  111. package/git/share/perl5/Git/IndexInfo.pm +35 -0
  112. package/git/share/perl5/Git/LoadCPAN/Error.pm +10 -0
  113. package/git/share/perl5/Git/LoadCPAN/Mail/Address.pm +10 -0
  114. package/git/share/perl5/Git/LoadCPAN.pm +104 -0
  115. package/git/share/perl5/Git/Packet.pm +173 -0
  116. package/git/share/perl5/Git/SVN/Editor.pm +605 -0
  117. package/git/share/perl5/Git/SVN/Fetcher.pm +622 -0
  118. package/git/share/perl5/Git/SVN/GlobSpec.pm +65 -0
  119. package/git/share/perl5/Git/SVN/Log.pm +400 -0
  120. package/git/share/perl5/Git/SVN/Memoize/YAML.pm +93 -0
  121. package/git/share/perl5/Git/SVN/Migration.pm +265 -0
  122. package/git/share/perl5/Git/SVN/Prompt.pm +184 -0
  123. package/git/share/perl5/Git/SVN/Ra.pm +708 -0
  124. package/git/share/perl5/Git/SVN/Utils.pm +232 -0
  125. package/git/share/perl5/Git/SVN.pm +2573 -0
  126. package/git/share/perl5/Git.pm +1780 -0
  127. package/licenses/git/COPYING +360 -0
  128. package/licenses/git/LGPL-2.1 +511 -0
  129. package/licenses/perl-modules-from-cpan/Artistic +131 -0
  130. package/licenses/perl-modules-from-cpan/Copying +250 -0
  131. package/package.json +167 -4
@@ -0,0 +1,280 @@
1
+ # Copyrights 1995-2018 by [Mark Overmeer].
2
+ # For other contributors see ChangeLog.
3
+ # See the manual pages for details on the licensing terms.
4
+ # Pod stripped from pm file by OODoc 2.02.
5
+ # This code is part of the bundle MailTools. Meta-POD processed with
6
+ # OODoc into POD and HTML manual-pages. See README.md for Copyright.
7
+ # Licensed under the same terms as Perl itself.
8
+
9
+ package Mail::Address;
10
+ use vars '$VERSION';
11
+ $VERSION = '2.20';
12
+
13
+ use strict;
14
+
15
+ use Carp;
16
+
17
+ # use locale; removed in version 1.78, because it causes taint problems
18
+
19
+ sub Version { our $VERSION }
20
+
21
+
22
+
23
+ # given a comment, attempt to extract a person's name
24
+ sub _extract_name
25
+ { # This function can be called as method as well
26
+ my $self = @_ && ref $_[0] ? shift : undef;
27
+
28
+ local $_ = shift
29
+ or return '';
30
+
31
+ # Using encodings, too hard. See Mail::Message::Field::Full.
32
+ return '' if m/\=\?.*?\?\=/;
33
+
34
+ # trim whitespace
35
+ s/^\s+//;
36
+ s/\s+$//;
37
+ s/\s+/ /;
38
+
39
+ # Disregard numeric names (e.g. 123456.1234@compuserve.com)
40
+ return "" if /^[\d ]+$/;
41
+
42
+ s/^\((.*)\)$/$1/; # remove outermost parenthesis
43
+ s/^"(.*)"$/$1/; # remove outer quotation marks
44
+ s/\(.*?\)//g; # remove minimal embedded comments
45
+ s/\\//g; # remove all escapes
46
+ s/^"(.*)"$/$1/; # remove internal quotation marks
47
+ s/^([^\s]+) ?, ?(.*)$/$2 $1/; # reverse "Last, First M." if applicable
48
+ s/,.*//;
49
+
50
+ # Change casing only when the name contains only upper or only
51
+ # lower cased characters.
52
+ unless( m/[A-Z]/ && m/[a-z]/ )
53
+ { # Set the case of the name to first char upper rest lower
54
+ s/\b(\w+)/\L\u$1/igo; # Upcase first letter on name
55
+ s/\bMc(\w)/Mc\u$1/igo; # Scottish names such as 'McLeod'
56
+ s/\bo'(\w)/O'\u$1/igo; # Irish names such as 'O'Malley, O'Reilly'
57
+ s/\b(x*(ix)?v*(iv)?i*)\b/\U$1/igo; # Roman numerals, eg 'Level III Support'
58
+ }
59
+
60
+ # some cleanup
61
+ s/\[[^\]]*\]//g;
62
+ s/(^[\s'"]+|[\s'"]+$)//g;
63
+ s/\s{2,}/ /g;
64
+
65
+ $_;
66
+ }
67
+
68
+ sub _tokenise
69
+ { local $_ = join ',', @_;
70
+ my (@words,$snippet,$field);
71
+
72
+ s/\A\s+//;
73
+ s/[\r\n]+/ /g;
74
+
75
+ while ($_ ne '')
76
+ { $field = '';
77
+ if(s/^\s*\(/(/ ) # (...)
78
+ { my $depth = 0;
79
+
80
+ PAREN: while(s/^(\(([^\(\)\\]|\\.)*)//)
81
+ { $field .= $1;
82
+ $depth++;
83
+ while(s/^(([^\(\)\\]|\\.)*\)\s*)//)
84
+ { $field .= $1;
85
+ last PAREN unless --$depth;
86
+ $field .= $1 if s/^(([^\(\)\\]|\\.)+)//;
87
+ }
88
+ }
89
+
90
+ carp "Unmatched () '$field' '$_'"
91
+ if $depth;
92
+
93
+ $field =~ s/\s+\Z//;
94
+ push @words, $field;
95
+
96
+ next;
97
+ }
98
+
99
+ if( s/^("(?:[^"\\]+|\\.)*")\s*// # "..."
100
+ || s/^(\[(?:[^\]\\]+|\\.)*\])\s*// # [...]
101
+ || s/^([^\s()<>\@,;:\\".[\]]+)\s*//
102
+ || s/^([()<>\@,;:\\".[\]])\s*//
103
+ )
104
+ { push @words, $1;
105
+ next;
106
+ }
107
+
108
+ croak "Unrecognised line: $_";
109
+ }
110
+
111
+ push @words, ",";
112
+ \@words;
113
+ }
114
+
115
+ sub _find_next
116
+ { my ($idx, $tokens, $len) = @_;
117
+
118
+ while($idx < $len)
119
+ { my $c = $tokens->[$idx];
120
+ return $c if $c eq ',' || $c eq ';' || $c eq '<';
121
+ $idx++;
122
+ }
123
+
124
+ "";
125
+ }
126
+
127
+ sub _complete
128
+ { my ($class, $phrase, $address, $comment) = @_;
129
+
130
+ @$phrase || @$comment || @$address
131
+ or return undef;
132
+
133
+ my $o = $class->new(join(" ",@$phrase), join("",@$address), join(" ",@$comment));
134
+ @$phrase = @$address = @$comment = ();
135
+ $o;
136
+ }
137
+
138
+ #------------
139
+
140
+ sub new(@)
141
+ { my $class = shift;
142
+ bless [@_], $class;
143
+ }
144
+
145
+
146
+ sub parse(@)
147
+ { my $class = shift;
148
+ my @line = grep {defined} @_;
149
+ my $line = join '', @line;
150
+
151
+ my (@phrase, @comment, @address, @objs);
152
+ my ($depth, $idx) = (0, 0);
153
+
154
+ my $tokens = _tokenise @line;
155
+ my $len = @$tokens;
156
+ my $next = _find_next $idx, $tokens, $len;
157
+
158
+ local $_;
159
+ for(my $idx = 0; $idx < $len; $idx++)
160
+ { $_ = $tokens->[$idx];
161
+
162
+ if(substr($_,0,1) eq '(') { push @comment, $_ }
163
+ elsif($_ eq '<') { $depth++ }
164
+ elsif($_ eq '>') { $depth-- if $depth }
165
+ elsif($_ eq ',' || $_ eq ';')
166
+ { warn "Unmatched '<>' in $line" if $depth;
167
+ my $o = $class->_complete(\@phrase, \@address, \@comment);
168
+ push @objs, $o if defined $o;
169
+ $depth = 0;
170
+ $next = _find_next $idx+1, $tokens, $len;
171
+ }
172
+ elsif($depth) { push @address, $_ }
173
+ elsif($next eq '<') { push @phrase, $_ }
174
+ elsif( /^[.\@:;]$/ || !@address || $address[-1] =~ /^[.\@:;]$/ )
175
+ { push @address, $_ }
176
+ else
177
+ { warn "Unmatched '<>' in $line" if $depth;
178
+ my $o = $class->_complete(\@phrase, \@address, \@comment);
179
+ push @objs, $o if defined $o;
180
+ $depth = 0;
181
+ push @address, $_;
182
+ }
183
+ }
184
+ @objs;
185
+ }
186
+
187
+ #------------
188
+
189
+ sub phrase { shift->set_or_get(0, @_) }
190
+ sub address { shift->set_or_get(1, @_) }
191
+ sub comment { shift->set_or_get(2, @_) }
192
+
193
+ sub set_or_get($)
194
+ { my ($self, $i) = (shift, shift);
195
+ @_ or return $self->[$i];
196
+
197
+ my $val = $self->[$i];
198
+ $self->[$i] = shift if @_;
199
+ $val;
200
+ }
201
+
202
+
203
+ my $atext = '[\-\w !#$%&\'*+/=?^`{|}~]';
204
+ sub format
205
+ { my @addrs;
206
+
207
+ foreach (@_)
208
+ { my ($phrase, $email, $comment) = @$_;
209
+ my @addr;
210
+
211
+ if(defined $phrase && length $phrase)
212
+ { push @addr
213
+ , $phrase =~ /^(?:\s*$atext\s*)+$/o ? $phrase
214
+ : $phrase =~ /(?<!\\)"/ ? $phrase
215
+ : qq("$phrase");
216
+
217
+ push @addr, "<$email>"
218
+ if defined $email && length $email;
219
+ }
220
+ elsif(defined $email && length $email)
221
+ { push @addr, $email;
222
+ }
223
+
224
+ if(defined $comment && $comment =~ /\S/)
225
+ { $comment =~ s/^\s*\(?/(/;
226
+ $comment =~ s/\)?\s*$/)/;
227
+ }
228
+
229
+ push @addr, $comment
230
+ if defined $comment && length $comment;
231
+
232
+ push @addrs, join(" ", @addr)
233
+ if @addr;
234
+ }
235
+
236
+ join ", ", @addrs;
237
+ }
238
+
239
+ #------------
240
+
241
+ sub name
242
+ { my $self = shift;
243
+ my $phrase = $self->phrase;
244
+ my $addr = $self->address;
245
+
246
+ $phrase = $self->comment
247
+ unless defined $phrase && length $phrase;
248
+
249
+ my $name = $self->_extract_name($phrase);
250
+
251
+ # first.last@domain address
252
+ if($name eq '' && $addr =~ /([^\%\.\@_]+([\._][^\%\.\@_]+)+)[\@\%]/)
253
+ { ($name = $1) =~ s/[\._]+/ /g;
254
+ $name = _extract_name $name;
255
+ }
256
+
257
+ if($name eq '' && $addr =~ m#/g=#i) # X400 style address
258
+ { my ($f) = $addr =~ m#g=([^/]*)#i;
259
+ my ($l) = $addr =~ m#s=([^/]*)#i;
260
+ $name = _extract_name "$f $l";
261
+ }
262
+
263
+ length $name ? $name : undef;
264
+ }
265
+
266
+
267
+ sub host
268
+ { my $addr = shift->address || '';
269
+ my $i = rindex $addr, '@';
270
+ $i >= 0 ? substr($addr, $i+1) : undef;
271
+ }
272
+
273
+
274
+ sub user
275
+ { my $addr = shift->address || '';
276
+ my $i = rindex $addr, '@';
277
+ $i >= 0 ? substr($addr,0,$i) : $addr;
278
+ }
279
+
280
+ 1;
@@ -0,0 +1,125 @@
1
+ package Git::I18N;
2
+ require v5.26;
3
+ use strict;
4
+ use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
5
+ BEGIN {
6
+ require Exporter;
7
+ if ($] < 5.008003) {
8
+ *import = \&Exporter::import;
9
+ } else {
10
+ # Exporter 5.57 which supports this invocation was
11
+ # released with perl 5.8.3
12
+ Exporter->import('import');
13
+ }
14
+ }
15
+
16
+ our @EXPORT = qw(__ __n N__);
17
+ our @EXPORT_OK = @EXPORT;
18
+
19
+ # See Git::LoadCPAN's NO_PERL_CPAN_FALLBACKS_STR for a description of
20
+ # this "'@@' [...] '@@'" pattern.
21
+ use constant NO_GETTEXT_STR => '@@' . 'NO_GETTEXT' . '@@';
22
+ use constant NO_GETTEXT => (
23
+ q[] ne ''
24
+ and
25
+ q[] ne NO_GETTEXT_STR
26
+ );
27
+
28
+ sub __bootstrap_locale_messages {
29
+ our $TEXTDOMAIN = 'git';
30
+ our $TEXTDOMAINDIR ||= $ENV{GIT_TEXTDOMAINDIR} || '//share/locale';
31
+ die "NO_GETTEXT=" . NO_GETTEXT_STR if NO_GETTEXT;
32
+
33
+ require POSIX;
34
+ POSIX->import(qw(setlocale));
35
+ # Non-core prerequisite module
36
+ require Locale::Messages;
37
+ Locale::Messages->import(qw(:locale_h :libintl_h));
38
+
39
+ setlocale(LC_MESSAGES(), '');
40
+ setlocale(LC_CTYPE(), '');
41
+ textdomain($TEXTDOMAIN);
42
+ bindtextdomain($TEXTDOMAIN => $TEXTDOMAINDIR);
43
+
44
+ return;
45
+ }
46
+
47
+ BEGIN
48
+ {
49
+ # Used by our test script to see if it should test fallbacks or
50
+ # not.
51
+ our $__HAS_LIBRARY = 1;
52
+
53
+ local $@;
54
+ eval {
55
+ __bootstrap_locale_messages();
56
+ *__ = \&Locale::Messages::gettext;
57
+ *__n = \&Locale::Messages::ngettext;
58
+ 1;
59
+ } or do {
60
+ # Tell test.pl that we couldn't load the gettext library.
61
+ $Git::I18N::__HAS_LIBRARY = 0;
62
+
63
+ # Just a fall-through no-op
64
+ *__ = sub ($) { $_[0] };
65
+ *__n = sub ($$$) { $_[2] == 1 ? $_[0] : $_[1] };
66
+ };
67
+
68
+ sub N__($) { return shift; }
69
+ }
70
+
71
+ 1;
72
+
73
+ __END__
74
+
75
+ =head1 NAME
76
+
77
+ Git::I18N - Perl interface to Git's Gettext localizations
78
+
79
+ =head1 SYNOPSIS
80
+
81
+ use Git::I18N;
82
+
83
+ print __("Welcome to Git!\n");
84
+
85
+ printf __("The following error occurred: %s\n"), $error;
86
+
87
+ printf __n("committed %d file\n", "committed %d files\n", $files), $files;
88
+
89
+
90
+ =head1 DESCRIPTION
91
+
92
+ Git's internal Perl interface to gettext via L<Locale::Messages>. If
93
+ L<Locale::Messages> can't be loaded (it's not a core module) we
94
+ provide stub passthrough fallbacks.
95
+
96
+ This is a distilled interface to gettext, see C<info '(gettext)Perl'>
97
+ for the full interface. This module implements only a small part of
98
+ it.
99
+
100
+ =head1 FUNCTIONS
101
+
102
+ =head2 __($)
103
+
104
+ L<Locale::Messages>'s gettext function if all goes well, otherwise our
105
+ passthrough fallback function.
106
+
107
+ =head2 __n($$$)
108
+
109
+ L<Locale::Messages>'s ngettext function or passthrough fallback function.
110
+
111
+ =head2 N__($)
112
+
113
+ No-operation that only returns its argument. Use this if you want xgettext to
114
+ extract the text to the pot template but do not want to trigger retrieval of the
115
+ translation at run time.
116
+
117
+ =head1 AUTHOR
118
+
119
+ E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason <avarab@gmail.com>
120
+
121
+ =head1 COPYRIGHT
122
+
123
+ Copyright 2010 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason <avarab@gmail.com>
124
+
125
+ =cut
@@ -0,0 +1,35 @@
1
+ package Git::IndexInfo;
2
+ use strict;
3
+ use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
4
+ use Git qw/command_input_pipe command_close_pipe/;
5
+
6
+ sub new {
7
+ my ($class) = @_;
8
+ my $hash_algo = Git::config('extensions.objectformat') || 'sha1';
9
+ my ($gui, $ctx) = command_input_pipe(qw/update-index -z --index-info/);
10
+ bless { gui => $gui, ctx => $ctx, nr => 0, hash_algo => $hash_algo}, $class;
11
+ }
12
+
13
+ sub remove {
14
+ my ($self, $path) = @_;
15
+ my $length = $self->{hash_algo} eq 'sha256' ? 64 : 40;
16
+ if (print { $self->{gui} } '0 ', 0 x $length, "\t", $path, "\0") {
17
+ return ++$self->{nr};
18
+ }
19
+ undef;
20
+ }
21
+
22
+ sub update {
23
+ my ($self, $mode, $hash, $path) = @_;
24
+ if (print { $self->{gui} } $mode, ' ', $hash, "\t", $path, "\0") {
25
+ return ++$self->{nr};
26
+ }
27
+ undef;
28
+ }
29
+
30
+ sub DESTROY {
31
+ my ($self) = @_;
32
+ command_close_pipe($self->{gui}, $self->{ctx});
33
+ }
34
+
35
+ 1;
@@ -0,0 +1,10 @@
1
+ package Git::LoadCPAN::Error;
2
+ use 5.008001;
3
+ use strict;
4
+ use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
5
+ use Git::LoadCPAN (
6
+ module => 'Error',
7
+ import => 1,
8
+ );
9
+
10
+ 1;
@@ -0,0 +1,10 @@
1
+ package Git::LoadCPAN::Mail::Address;
2
+ use 5.008001;
3
+ use strict;
4
+ use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
5
+ use Git::LoadCPAN (
6
+ module => 'Mail::Address',
7
+ import => 0,
8
+ );
9
+
10
+ 1;
@@ -0,0 +1,104 @@
1
+ package Git::LoadCPAN;
2
+ require v5.26;
3
+ use strict;
4
+ use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
5
+
6
+ =head1 NAME
7
+
8
+ Git::LoadCPAN - Wrapper for loading modules from the CPAN (OS) or Git's own copy
9
+
10
+ =head1 DESCRIPTION
11
+
12
+ The Perl code in Git depends on some modules from the CPAN, but we
13
+ don't want to make those a hard requirement for anyone building from
14
+ source.
15
+
16
+ Therefore the L<Git::LoadCPAN> namespace shipped with Git contains
17
+ wrapper modules like C<Git::LoadCPAN::Module::Name> that will first
18
+ attempt to load C<Module::Name> from the OS, and if that doesn't work
19
+ will fall back on C<FromCPAN::Module::Name> shipped with Git itself.
20
+
21
+ Usually distributors will not ship with Git's Git::FromCPAN tree at
22
+ all via the C<NO_PERL_CPAN_FALLBACKS> option, preferring to use their
23
+ own packaging of CPAN modules instead.
24
+
25
+ This module is only intended to be used for code shipping in the
26
+ C<git.git> repository. Use it for anything else at your peril!
27
+
28
+ =cut
29
+
30
+ # NO_PERL_CPAN_FALLBACKS_STR evades the sed search-replace from the
31
+ # Makefile, and allows for detecting whether the module is loaded from
32
+ # perl/Git as opposed to perl/build/Git, which is useful for one-off
33
+ # testing without having Error.pm et al installed.
34
+ use constant NO_PERL_CPAN_FALLBACKS_STR => '@' . 'NO_PERL_CPAN_FALLBACKS' . '@';
35
+ use constant NO_PERL_CPAN_FALLBACKS => (
36
+ q[] ne ''
37
+ and
38
+ q[] ne NO_PERL_CPAN_FALLBACKS_STR
39
+ );
40
+
41
+ sub import {
42
+ shift;
43
+ my $caller = caller;
44
+ my %args = @_;
45
+ my $module = exists $args{module} ? delete $args{module} : die "BUG: Expected 'module' parameter!";
46
+ my $import = exists $args{import} ? delete $args{import} : die "BUG: Expected 'import' parameter!";
47
+ die "BUG: Too many arguments!" if keys %args;
48
+
49
+ # Foo::Bar to Foo/Bar.pm
50
+ my $package_pm = $module;
51
+ $package_pm =~ s[::][/]g;
52
+ $package_pm .= '.pm';
53
+
54
+ eval {
55
+ require $package_pm;
56
+ 1;
57
+ } or do {
58
+ my $error = $@ || "Zombie Error";
59
+
60
+ if (NO_PERL_CPAN_FALLBACKS) {
61
+ chomp(my $error = sprintf <<'THEY_PROMISED', $module);
62
+ BUG: The '%s' module is not here, but NO_PERL_CPAN_FALLBACKS was set!
63
+
64
+ Git needs this Perl module from the CPAN, and will by default ship
65
+ with a copy of it. This Git was built with NO_PERL_CPAN_FALLBACKS,
66
+ meaning that whoever built it promised to provide this module.
67
+
68
+ You're seeing this error because they broke that promise, and we can't
69
+ load our fallback version, since we were asked not to install it.
70
+
71
+ If you're seeing this error and didn't package Git yourself the
72
+ package you're using is broken, or your system is broken. This error
73
+ won't appear if Git is built without NO_PERL_CPAN_FALLBACKS (instead
74
+ we'll use our fallback version of the module).
75
+ THEY_PROMISED
76
+ die $error;
77
+ }
78
+
79
+ my $Git_LoadCPAN_pm_path = $INC{"Git/LoadCPAN.pm"} || die "BUG: Should have our own path from %INC!";
80
+
81
+ require File::Basename;
82
+ my $Git_LoadCPAN_pm_root = File::Basename::dirname($Git_LoadCPAN_pm_path) || die "BUG: Can't figure out lib/Git dirname from '$Git_LoadCPAN_pm_path'!";
83
+
84
+ require File::Spec;
85
+ my $Git_pm_FromCPAN_root = File::Spec->catdir($Git_LoadCPAN_pm_root, '..', 'FromCPAN');
86
+ die "BUG: '$Git_pm_FromCPAN_root' should be a directory!" unless -d $Git_pm_FromCPAN_root;
87
+
88
+ local @INC = ($Git_pm_FromCPAN_root, @INC);
89
+ require $package_pm;
90
+ };
91
+
92
+ if ($import) {
93
+ no strict 'refs';
94
+ *{"${caller}::import"} = sub {
95
+ shift;
96
+ use strict 'refs';
97
+ unshift @_, $module;
98
+ goto &{"${module}::import"};
99
+ };
100
+ use strict 'refs';
101
+ }
102
+ }
103
+
104
+ 1;