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>
14 files changed
tree: d634455fd49a5675af4919d08aecb152f9752e47
  1. .github/
  2. block-sha1/
  3. builtin/
  4. ci/
  5. compat/
  6. contrib/
  7. Documentation/
  8. ewah/
  9. git-gui/
  10. gitk-git/
  11. gitweb/
  12. mergetools/
  13. perl/
  14. po/
  15. ppc/
  16. refs/
  17. sha1dc/
  18. t/
  19. templates/
  20. vcs-svn/
  21. xdiff/
  22. .clang-format
  23. .gitattributes
  24. .gitignore
  25. .gitmodules
  26. .mailmap
  27. .travis.yml
  28. .tsan-suppressions
  29. abspath.c
  30. aclocal.m4
  31. advice.c
  32. advice.h
  33. alias.c
  34. alloc.c
  35. apply.c
  36. apply.h
  37. archive-tar.c
  38. archive-zip.c
  39. archive.c
  40. archive.h
  41. argv-array.c
  42. argv-array.h
  43. attr.c
  44. attr.h
  45. base85.c
  46. bisect.c
  47. bisect.h
  48. blame.c
  49. blame.h
  50. blob.c
  51. blob.h
  52. branch.c
  53. branch.h
  54. builtin.h
  55. bulk-checkin.c
  56. bulk-checkin.h
  57. bundle.c
  58. bundle.h
  59. cache-tree.c
  60. cache-tree.h
  61. cache.h
  62. check-builtins.sh
  63. check-racy.c
  64. check_bindir
  65. color.c
  66. color.h
  67. column.c
  68. column.h
  69. combine-diff.c
  70. command-list.txt
  71. commit-slab.h
  72. commit.c
  73. commit.h
  74. common-main.c
  75. config.c
  76. config.h
  77. config.mak.in
  78. config.mak.uname
  79. configure.ac
  80. connect.c
  81. connect.h
  82. connected.c
  83. connected.h
  84. convert.c
  85. convert.h
  86. copy.c
  87. COPYING
  88. credential-cache--daemon.c
  89. credential-cache.c
  90. credential-store.c
  91. credential.c
  92. credential.h
  93. csum-file.c
  94. csum-file.h
  95. ctype.c
  96. daemon.c
  97. date.c
  98. decorate.c
  99. decorate.h
  100. delta.h
  101. diff-delta.c
  102. diff-lib.c
  103. diff-no-index.c
  104. diff.c
  105. diff.h
  106. diffcore-break.c
  107. diffcore-delta.c
  108. diffcore-order.c
  109. diffcore-pickaxe.c
  110. diffcore-rename.c
  111. diffcore.h
  112. dir-iterator.c
  113. dir-iterator.h
  114. dir.c
  115. dir.h
  116. editor.c
  117. entry.c
  118. environment.c
  119. exec_cmd.c
  120. exec_cmd.h
  121. fast-import.c
  122. fetch-pack.c
  123. fetch-pack.h
  124. fmt-merge-msg.h
  125. fsck.c
  126. fsck.h
  127. fsmonitor.c
  128. fsmonitor.h
  129. generate-cmdlist.sh
  130. gettext.c
  131. gettext.h
  132. git-add--interactive.perl
  133. git-archimport.perl
  134. git-bisect.sh
  135. git-compat-util.h
  136. git-cvsexportcommit.perl
  137. git-cvsimport.perl
  138. git-cvsserver.perl
  139. git-difftool--helper.sh
  140. git-filter-branch.sh
  141. git-instaweb.sh
  142. git-merge-octopus.sh
  143. git-merge-one-file.sh
  144. git-merge-resolve.sh
  145. git-mergetool--lib.sh
  146. git-mergetool.sh
  147. git-p4.py
  148. git-parse-remote.sh
  149. git-quiltimport.sh
  150. git-rebase--am.sh
  151. git-rebase--interactive.sh
  152. git-rebase--merge.sh
  153. git-rebase.sh
  154. git-remote-testgit.sh
  155. git-request-pull.sh
  156. git-send-email.perl
  157. git-sh-i18n.sh
  158. git-sh-setup.sh
  159. git-stash.sh
  160. git-submodule.sh
  161. git-svn.perl
  162. GIT-VERSION-GEN
  163. git-web--browse.sh
  164. git.c
  165. git.rc
  166. gpg-interface.c
  167. gpg-interface.h
  168. graph.c
  169. graph.h
  170. grep.c
  171. grep.h
  172. hash.h
  173. hashmap.c
  174. hashmap.h
  175. help.c
  176. help.h
  177. hex.c
  178. http-backend.c
  179. http-fetch.c
  180. http-push.c
  181. http-walker.c
  182. http.c
  183. http.h
  184. ident.c
  185. imap-send.c
  186. INSTALL
  187. iterator.h
  188. khash.h
  189. kwset.c
  190. kwset.h
  191. levenshtein.c
  192. levenshtein.h
  193. LGPL-2.1
  194. line-log.c
  195. line-log.h
  196. line-range.c
  197. line-range.h
  198. list-objects.c
  199. list-objects.h
  200. list.h
  201. ll-merge.c
  202. ll-merge.h
  203. lockfile.c
  204. lockfile.h
  205. log-tree.c
  206. log-tree.h
  207. mailinfo.c
  208. mailinfo.h
  209. mailmap.c
  210. mailmap.h
  211. Makefile
  212. match-trees.c
  213. merge-blobs.c
  214. merge-blobs.h
  215. merge-recursive.c
  216. merge-recursive.h
  217. merge.c
  218. mergesort.c
  219. mergesort.h
  220. mru.c
  221. mru.h
  222. name-hash.c
  223. notes-cache.c
  224. notes-cache.h
  225. notes-merge.c
  226. notes-merge.h
  227. notes-utils.c
  228. notes-utils.h
  229. notes.c
  230. notes.h
  231. object.c
  232. object.h
  233. oidmap.c
  234. oidmap.h
  235. oidset.c
  236. oidset.h
  237. pack-bitmap-write.c
  238. pack-bitmap.c
  239. pack-bitmap.h
  240. pack-check.c
  241. pack-objects.c
  242. pack-objects.h
  243. pack-revindex.c
  244. pack-revindex.h
  245. pack-write.c
  246. pack.h
  247. packfile.c
  248. packfile.h
  249. pager.c
  250. parse-options-cb.c
  251. parse-options.c
  252. parse-options.h
  253. patch-delta.c
  254. patch-ids.c
  255. patch-ids.h
  256. path.c
  257. path.h
  258. pathspec.c
  259. pathspec.h
  260. pkt-line.c
  261. pkt-line.h
  262. preload-index.c
  263. pretty.c
  264. prio-queue.c
  265. prio-queue.h
  266. progress.c
  267. progress.h
  268. prompt.c
  269. prompt.h
  270. quote.c
  271. quote.h
  272. reachable.c
  273. reachable.h
  274. read-cache.c
  275. README.md
  276. ref-filter.c
  277. ref-filter.h
  278. reflog-walk.c
  279. reflog-walk.h
  280. refs.c
  281. refs.h
  282. remote-curl.c
  283. remote-testsvn.c
  284. remote.c
  285. remote.h
  286. replace_object.c
  287. repository.c
  288. repository.h
  289. rerere.c
  290. rerere.h
  291. resolve-undo.c
  292. resolve-undo.h
  293. revision.c
  294. revision.h
  295. run-command.c
  296. run-command.h
  297. send-pack.c
  298. send-pack.h
  299. sequencer.c
  300. sequencer.h
  301. server-info.c
  302. setup.c
  303. sh-i18n--envsubst.c
  304. sha1-array.c
  305. sha1-array.h
  306. sha1-lookup.c
  307. sha1-lookup.h
  308. sha1_file.c
  309. sha1_name.c
  310. sha1dc_git.c
  311. sha1dc_git.h
  312. shallow.c
  313. shell.c
  314. shortlog.h
  315. show-index.c
  316. sideband.c
  317. sideband.h
  318. sigchain.c
  319. sigchain.h
  320. split-index.c
  321. split-index.h
  322. strbuf.c
  323. strbuf.h
  324. streaming.c
  325. streaming.h
  326. string-list.c
  327. string-list.h
  328. sub-process.c
  329. sub-process.h
  330. submodule-config.c
  331. submodule-config.h
  332. submodule.c
  333. submodule.h
  334. symlinks.c
  335. tag.c
  336. tag.h
  337. tar.h
  338. tempfile.c
  339. tempfile.h
  340. thread-utils.c
  341. thread-utils.h
  342. tmp-objdir.c
  343. tmp-objdir.h
  344. trace.c
  345. trace.h
  346. trailer.c
  347. trailer.h
  348. transport-helper.c
  349. transport.c
  350. transport.h
  351. tree-diff.c
  352. tree-walk.c
  353. tree-walk.h
  354. tree.c
  355. tree.h
  356. unicode_width.h
  357. unimplemented.sh
  358. unix-socket.c
  359. unix-socket.h
  360. unpack-trees.c
  361. unpack-trees.h
  362. upload-pack.c
  363. url.c
  364. url.h
  365. urlmatch.c
  366. urlmatch.h
  367. usage.c
  368. userdiff.c
  369. userdiff.h
  370. utf8.c
  371. utf8.h
  372. varint.c
  373. varint.h
  374. version.c
  375. version.h
  376. versioncmp.c
  377. walker.c
  378. walker.h
  379. wildmatch.c
  380. wildmatch.h
  381. worktree.c
  382. worktree.h
  383. wrap-for-bin.sh
  384. wrapper.c
  385. write_or_die.c
  386. ws.c
  387. wt-status.c
  388. wt-status.h
  389. xdiff-interface.c
  390. xdiff-interface.h
  391. zlib.c
README.md

Git - fast, scalable, distributed revision control system

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Git is an Open Source project covered by the GNU General Public License version 2 (some parts of it are under different licenses, compatible with the GPLv2). It was originally written by Linus Torvalds with help of a group of hackers around the net.

Please read the file INSTALL for installation instructions.

Many Git online resources are accessible from https://git-scm.com/ including full documentation and Git related tools.

See Documentation/gittutorial.txt to get started, then see Documentation/giteveryday.txt for a useful minimum set of commands, and Documentation/git-.txt for documentation of each command. If git has been correctly installed, then the tutorial can also be read with man gittutorial or git help tutorial, and the documentation of each command with man git-<commandname> or git help <commandname>.

CVS users may also want to read Documentation/gitcvs-migration.txt (man gitcvs-migration or git help cvs-migration if git is installed).

The user discussion and development of Git take place on the Git mailing list -- everyone is welcome to post bug reports, feature requests, comments and patches to git@vger.kernel.org (read Documentation/SubmittingPatches for instructions on patch submission). To subscribe to the list, send an email with just “subscribe git” in the body to majordomo@vger.kernel.org. The mailing list archives are available at https://public-inbox.org/git/, http://marc.info/?l=git and other archival sites.

The maintainer frequently sends the “What's cooking” reports that list the current status of various development topics to the mailing list. The discussion following them give a good reference for project status, development direction and remaining tasks.

The name “git” was given by Linus Torvalds when he wrote the very first version. He described the tool as “the stupid content tracker” and the name as (depending on your mood):

  • random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of “get” may or may not be relevant.
  • stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
  • “global information tracker”: you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
  • “goddamn idiotic truckload of sh*t”: when it breaks