git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Find .pm files automatically (was Re: Fix git-svn tests for SVN 1.7.5.)

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 18, 2012, 00:01 UTC
Message-ID
<20120718000120.GG25325@burratino>
In-Reply-To
<5005EFC5.8060105@pobox.com>
Hi,
Michael G Schwern wrote:
Show 5 quoted lines
> Ok, here goes.
>
> First patch overhauls perl/Makefile.PL to make it easier to add .pm files,
> which I'm going to be doing a lot of.  Instead of having to manually add to
> the %pm hash, it scans for .pm files.
An excellent goal.
> It also moves Error.pm into a bundle directory.  This both makes it just
> another directory to scan (or not scan), but it also makes it possible to
> bundle additional modules in the future.  ExtUtils::MakeMaker uses this
> technique itself.

This is not so much "also" as "as an example to demonstrate the technique", no? I guess I'd prefer it to be in a separate patch, but this way's fine, too.

[...]
Show 11 quoted lines
> From 47a723a860cded6b16a716ea74c5bc029ee5b0ac Mon Sep 17 00:00:00 2001
> From: "Michael G. Schwern" <schwern@pobox.com>
> Date: Thu, 12 Jul 2012 00:05:38 -0700
> Subject: [PATCH 01/11] Make the process of adding a module less blecherous.
>
> * Scan for .pm files and build %pms rather than having to do it by hand.
> * Move the bundled Error into its own directory so we can bundle other modules.
>
> In addition...
> * Add all the .pm files to the all dependency in the alternative Makefile
> ---

You'll probably hate this. Because we have a bunch of patches to incorporate, I think it's worth spending the time to make that go as smoothly as possible for later patches.

 - the "From 47a723..." line is for your mailer.  Please do not
   include it in the body of your message.
 - likewise for the From: and Date: lines which are redundant next to
   the corresponding fields in the mail header
 - comments that are useful for posterity, like 
	This patch overhauls perl/Makefile.PL to make it easier to add .pm files,
	which I'm going to be doing a lot of.  Instead of having to manually add to
	the %pm hash, it scans for .pm files.
   should go above the triple-dash marker, while comments that are
   less useful, like "Hi", go after the triple-dash.
 - using a different subject line for each patch makes the reader's
   life much easier, so please do use the subject lines from your
   commits in the mail header.

The git-format-patch(1) manpage has some instructions for using Thunderbird to send patches, which should take care of all this automatically.

If everything is right, then maintainers will love you because they can save a bunch of your patches that look ready into a single mbox and apply them all at once with "git am".

As Documentation/SubmittingPatches explains under "MUA specific hints", you can test that a patch is being sent correctly by emailing it to yourself, saving as an mbox, and trying to apply it with "git am <path to mbox file>". If the resulting commit is as expected, then you've succeeded.

Show 7 quoted lines
>  perl/Makefile                                     |  6 ++--
>  perl/Makefile.PL                                  | 42 +++++++++++++----------
>  perl/{private-Error.pm => bundles/Error/Error.pm} |  0
>  perl/bundles/README                               | 10 ++++++
>  4 files changed, 36 insertions(+), 22 deletions(-)
>  rename perl/{private-Error.pm => bundles/Error/Error.pm} (100%)
>  create mode 100644 perl/bundles/README
Ok, on to the patch proper.
Show 10 quoted lines
> diff --git a/perl/Makefile b/perl/Makefile
> index 6ca7d47..4f25930 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -33,7 +33,7 @@ modules += Git/SVN/Prompt
>  modules += Git/SVN/Ra
> 
>  $(makfile): ../GIT-CFLAGS Makefile
> -	echo all: private-Error.pm Git.pm Git/I18N.pm > $@
> +	echo all: bundles/Error/Error.pm $(modules) > $@

The word "bundles/" left me a little nervous, because I (ignorantly) imagined that this might be some specialized facility like Python eggs or Ruby gems. Is the intent that this directory contains CPAN modules we want to be able to depend on? Is there really any intention of having more of them than Error.pm?

Before this patch, in the default case (with MakeMaker), "make install" wrote a manpage in <mandir>/man3/private-Error.3pm. Does it still do so after the patch? Will people who have installation scripts that expected that manpage have to change them, and if so, is the new behavior better to make up for that effort?

[...]
Show 10 quoted lines
> --- a/perl/Makefile.PL
> +++ b/perl/Makefile.PL
> @@ -2,11 +2,16 @@ use strict;
>  use warnings;
>  use ExtUtils::MakeMaker;
>  use Getopt::Long;
> +use File::Find;
> +
> +# Don't forget to update the perl/Makefile, too.
> +# Don't forget to test with NO_PERL_MAKEMAKER=YesPlease

Now the reader will have no reason to be looking at this file, so these comments are pretty much useless. In an ideal world, "make test" in the MakeMaker build would automatically "grep perl/Makefile" to catch modules that are not listed there, but that can wait, I imagine.

Alternatively, maybe there could be a perl/modules.list that both makefiles read? That way, if I drop in an unrelated .pm file for reference while coding the build system would not be confused by it, and since both build systems would use the same module list there would be no risk of it falling out of date.

Thanks for some food for thought, and hope that helps, Jonathan

Previous: Michael G SchwernNext: Michael G Schwern
Message 7 of 34 in “Fix git-svn tests for SVN 1.7.5.”
  1. Michael G SchwernJul 17, 2012
  2. Jonathan NiederJul 17, 2012
  3. Michael G SchwernJul 17, 2012
  4. Extract Git classes from git-svn (4/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  5. Extract Git classes from git-svn (5/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  6. Find .pm files automatically (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  7. Jonathan NiederJul 18, 2012
  8. Michael G SchwernJul 18, 2012
  9. Jonathan NiederJul 18, 2012
  10. Extract Git classes from git-svn (2/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  11. Jonathan NiederJul 18, 2012
  12. Eric WongJul 18, 2012
  13. Michael G SchwernJul 19, 2012
  14. Extract Git classes from git-svn (3/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  15. Jonathan NiederJul 18, 2012
  16. Extract Git classes from git-svn (6/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  17. Extract Git classes from git-svn (7/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  18. Extract Git classes from git-svn (8/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  19. Extract Git classes from git-svn (9/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  20. Extract Git classes from git-svn (10/10) (was Re: Fix git-svn tests for SVN 1.7.5.)Michael G Schwern, Jul 17, 2012
  21. Ben WaltonJul 21, 2012
  22. Jonathan NiederJul 17, 2012
  23. Junio C HamanoJul 18, 2012
  24. Thiago FarinaJul 19, 2012
  25. Michael G SchwernJul 24, 2012
  26. Jonathan NiederJul 24, 2012
  27. Eric WongJul 25, 2012
  28. Michael G SchwernJul 25, 2012
  29. OT: mail-based interfaces and web-based interfaces (Re: Extract Git classes from git-svn (1/10))Jonathan Nieder, Jul 25, 2012
  30. Michael G SchwernJul 25, 2012
  31. Eric WongJul 25, 2012
  32. Michael G SchwernJul 26, 2012
  33. Jonathan NiederJul 26, 2012
  34. Eric WongJul 26, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.