git/perl/Git
Ævar Arnfjörð Bjarmason 1aca69c019 perl Git::LoadCPAN: emit better errors under NO_PERL_CPAN_FALLBACKS
Before my 20d2a30f8f ("Makefile: replace perl/Makefile.PL with simple
make rules", 2017-12-10) on an OS package that removed the
private-Error.pm copy we carried around manually removing the OS's
Error.pm would yield:

    $ git add -p
    Can't locate Error.pm in @INC (you may need to install the Error module) [...]

Now, before this change we'll instead emit this more cryptic error:

    $ git add -p
    BUG: '/usr/share/perl5/Git/FromCPAN' should be a directory! at /usr/share/perl5/Git/Error.pm line 36.

This is a confusing error. Now if the new NO_PERL_CPAN_FALLBACKS
option is specified and we can't find the module we'll instead emit:

    $ /tmp/git/bin/git add -p
    BUG: The 'Error' module is not here, but NO_PERL_CPAN_FALLBACKS was set!

    [...]

Where [...] is the lengthy explanation seen in the change below, which
explains what the potential breakage is, and how to fix it.

The reason for checking @@NO_PERL_CPAN_FALLBACKS@@] against the empty
string in Perl is as opposed to checking for a boolean value is that
that's (as far as I can tell) make's idea of a string that's set, and
e.g. NO_PERL_CPAN_FALLBACKS=0 is enough to set NO_PERL_CPAN_FALLBACKS.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-03-05 10:52:28 -08:00
..
LoadCPAN perl: generalize the Git::LoadCPAN facility 2018-03-05 10:52:28 -08:00
SVN git-svn: allow "0" in SVN path components 2016-12-12 10:49:50 -08:00
I18N.pm Makefile: replace perl/Makefile.PL with simple make rules 2017-12-11 15:28:10 -08:00
IndexInfo.pm
LoadCPAN.pm perl Git::LoadCPAN: emit better errors under NO_PERL_CPAN_FALLBACKS 2018-03-05 10:52:28 -08:00
Packet.pm Git/Packet.pm: use 'if' instead of 'unless' 2017-11-22 16:23:55 +09:00
SVN.pm git svn fetch: Create correct commit timestamp when using --localtime 2017-08-08 09:57:44 -07:00