1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-18 01:56:15 +02:00
git/contrib
Ævar Arnfjörð Bjarmason 20d2a30f8f Makefile: replace perl/Makefile.PL with simple make rules
Replace the perl/Makefile.PL and the fallback perl/Makefile used under
NO_PERL_MAKEMAKER=NoThanks with a much simpler implementation heavily
inspired by how the i18n infrastructure's build process works[1].

The reason for having the Makefile.PL in the first place is that it
was initially[2] building a perl C binding to interface with libgit,
this functionality, that was removed[3] before Git.pm ever made it to
the master branch.

We've since since started maintaining a fallback perl/Makefile, as
MakeMaker wouldn't work on some platforms[4]. That's just the tip of
the iceberg. We have the PM.stamp hack in the top-level Makefile[5] to
detect whether we need to regenerate the perl/perl.mak, which I fixed
just recently to deal with issues like the perl version changing from
under us[6].

There is absolutely no reason for why this needs to be so complex
anymore. All we're getting out of this elaborate Rube Goldberg machine
was copying perl/* to perl/blib/* as we do a string-replacement on
the *.pm files to hardcode @@LOCALEDIR@@ in the source, as well as
pod2man-ing Git.pm & friends.

So replace the whole thing with something that's pretty much a copy of
how we generate po/build/**.mo from po/*.po, just with a small sed(1)
command instead of msgfmt. As that's being done rename the files
from *.pm to *.pmc just to indicate that they're generated (see
"perldoc -f require").

While I'm at it, change the fallback for Error.pm from being something
where we'll ship our own Error.pm if one doesn't exist at build time
to one where we just use a Git::Error wrapper that'll always prefer
the system-wide Error.pm, only falling back to our own copy if it
really doesn't exist at runtime. It's now shipped as
Git::FromCPAN::Error, making it easy to add other modules to
Git::FromCPAN::* in the future if that's needed.

Functional changes:

 * This will not always install into perl's idea of its global
   "installsitelib". This only potentially matters for packagers that
   need to expose Git.pm for non-git use, and as explained in the
   INSTALL file there's a trivial workaround.

 * The scripts themselves will 'use lib' the target directory, but if
   INSTLIBDIR is set it overrides it. It doesn't have to be this way,
   it could be set in addition to INSTLIBDIR, but my reading of [7] is
   that this is the desired behavior.

 * We don't build man pages for all of the perl modules as we used to,
   only Git(3pm). As discussed on-list[8] that we were building
   installed manpages for purely internal APIs like Git::I18N or
   private-Error.pm was always a bug anyway, and all the Git::SVN::*
   ones say they're internal APIs.

   There are apparently external users of Git.pm, but I don't expect
   there to be any of the others.

   As a side-effect of these general changes the perl documentation
   now only installed by install-{doc,man}, not a mere "install" as
   before.

1. 5e9637c629 ("i18n: add infrastructure for translating Git with
   gettext", 2011-11-18)

2. b1edc53d06 ("Introduce Git.pm (v4)", 2006-06-24)

3. 18b0fc1ce1 ("Git.pm: Kill Git.xs for now", 2006-09-23)

4. f848718a69 ("Make perl/ build procedure ActiveState friendly.",
   2006-12-04)

5. ee9be06770 ("perl: detect new files in MakeMaker builds",
   2012-07-27)

6. c59c4939c2 ("perl: regenerate perl.mak if perl -V changes",
   2017-03-29)

7. 0386dd37b1 ("Makefile: add PERLLIB_EXTRA variable that adds to
   default perl path", 2013-11-15)

8. 87bmjjv1pu.fsf@evledraar.booking.com ("Re: [PATCH] Makefile:
   replace perl/Makefile.PL with simple make rules"

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-12-11 15:28:10 -08:00
..
buildsystems mark Windows build scripts executable 2013-11-25 15:01:22 -08:00
coccinelle coccinelle: remove parentheses that become unnecessary 2017-10-02 13:02:26 +09:00
completion Merge branch 'tz/complete-branch-copy' 2017-11-27 11:06:37 +09:00
contacts git-contacts: also recognise "Reported-by:" 2017-07-27 09:42:55 -07:00
credential Merge branch 'tz/fsf-address-update' 2017-11-15 12:14:34 +09:00
diff-highlight diff-highlight: add clean target to Makefile 2017-09-06 12:56:26 +09:00
emacs Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00
examples Makefile: replace perl/Makefile.PL with simple make rules 2017-12-11 15:28:10 -08:00
fast-import Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00
git-jump git-jump: give contact instructions in the README 2017-11-21 11:01:02 +09:00
git-shell-commands
hg-to-git Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00
hooks Spelling fixes 2017-06-27 10:35:49 -07:00
long-running-filter docs: warn about possible '=' in clean/smudge filter process values 2016-12-06 11:29:52 -08:00
mw-to-git Merge branch 'ab/mediawiki-namespace' 2017-11-15 12:14:32 +09:00
persistent-https docs/config: mention protocol implications of url.insteadOf 2017-06-01 10:07:10 +09:00
remote-helpers contrib: git-remote-{bzr,hg} placeholders don't need Python 2017-03-03 11:09:34 -08:00
stats contrib: update stats/mailmap script 2012-12-12 11:09:11 -08:00
subtree treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
svn-fe contrib/svn-fe: fix Makefile 2014-08-28 15:41:28 -07:00
thunderbird-patch-inline contrib/thunderbird-patch-inline/appp.sh: use the $( ... ) construct for command substitution 2015-12-27 15:33:13 -08:00
update-unicode update_unicode.sh: remove the plane filter 2016-12-14 09:48:07 -08:00
workdir git-new-workdir: mark script as LF-only 2017-05-10 13:32:50 +09:00
README
convert-grafts-to-replace-refs.sh contrib: add convert-grafts-to-replace-refs.sh 2014-07-21 12:05:53 -07:00
git-resurrect.sh Merge branch 'jc/bs-t-is-not-a-tab-for-sed' 2017-04-16 23:29:29 -07:00
remotes2config.sh
rerere-train.sh contrib/rerere-train: optionally overwrite existing resolutions 2017-07-26 13:38:48 -07:00

Contributed Software

Although these pieces are available as part of the official git
source tree, they are in somewhat different status.  The
intention is to keep interesting tools around git here, maybe
even experimental ones, to give users an easier access to them,
and to give tools wider exposure, so that they can be improved
faster.

I am not expecting to touch these myself that much.  As far as
my day-to-day operation is concerned, these subdirectories are
owned by their respective primary authors.  I am willing to help
if users of these components and the contrib/ subtree "owners"
have technical/design issues to resolve, but the initiative to
fix and/or enhance things _must_ be on the side of the subtree
owners.  IOW, I won't be actively looking for bugs and rooms for
enhancements in them as the git maintainer -- I may only do so
just as one of the users when I want to scratch my own itch.  If
you have patches to things in contrib/ area, the patch should be
first sent to the primary author, and then the primary author
should ack and forward it to me (git pull request is nicer).
This is the same way as how I have been treating gitk, and to a
lesser degree various foreign SCM interfaces, so you know the
drill.

I expect that things that start their life in the contrib/ area
to graduate out of contrib/ once they mature, either by becoming
projects on their own, or moving to the toplevel directory.  On
the other hand, I expect I'll be proposing removal of disused
and inactive ones from time to time.

If you have new things to add to this area, please first propose
it on the git mailing list, and after a list discussion proves
there are some general interests (it does not have to be a
list-wide consensus for a tool targeted to a relatively narrow
audience -- for example I do not work with projects whose
upstream is svn, so I have no use for git-svn myself, but it is
of general interest for people who need to interoperate with SVN
repositories in a way git-svn works better than git-svnimport),
submit a patch to create a subdirectory of contrib/ and put your
stuff there.

-jc