<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,16 +3,7 @@ use warnings;
 
 use Module::Build;
 
-print &lt;&lt;END_MESSAGE;
-
-&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  WARNING &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
-
-This Build.PL won't do the full install dance (yet).
-
-For the time being, it's only here to let you know
-if you have all the right dependencies installed.
-
-END_MESSAGE
+use List::MoreUtils qw/ apply uniq /;
 
 my $builder = Module::Build-&gt;new(
     module_name  =&gt; 'Git::CPAN::Patch',
@@ -40,4 +31,58 @@ my $builder = Module::Build-&gt;new(
     },
 );
 
+locate_git( $builder );
+
 $builder-&gt;create_build_script();
+
+
+sub locate_git {
+
+    my $builder = shift;
+
+    print &lt;&lt;'END_MESSAGE';
+
+When programs named 'git-&lt;something&gt;' are put in the 
+same directory than git's own commands, they are  
+considered as part of the family. Which means that 
+you can type
+
+    $ git something
+
+and Git will do the right thing.  Bash expansion, 
+if you have it configured, will work on the new commands
+as well.
+
+END_MESSAGE
+
+    $builder-&gt;prompt( 
+        q{install Git::CPAN::Patch's scripts in Git's commands directory?},
+        'n' 
+    ) =~ /^y/i or return;
+
+    print &quot;\nokay, let's see where that directory could be...\n&quot;;
+
+    # let's find where the git-* commands are
+    my @dirs =  uniq
+                grep { -f &quot;$_/git-init&quot; }
+                map { 
+                        my $original = $_;
+                        s#/bin/?$##; 
+                        $_ .= &quot;/libexec/git-core&quot;;
+                        $_ =&gt; $original;
+            } 
+            apply { y#/#/#s } 
+                    split( ':' =&gt; $ENV{PATH} ), qw( /usr /usr/local );
+
+    if ( @dirs ) {
+        print &quot;git commands detected in the following directories:\n&quot;;
+        print &quot;\t$_\n&quot; for @dirs;
+    }
+
+    my $path = $builder-&gt;prompt(
+        'git commands directory', $dirs[0] 
+    );
+
+    $builder-&gt;install_path( script =&gt; $path );
+
+}</diff>
      <filename>Build.PL</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+=== WHAT'S THIS ? 
+
 This is a series of scripts developped for the 
 article 'CPAN Patching with Git' that I wrote
 for the Winter 2008 edition (aka issue 5.1) 
@@ -16,3 +18,21 @@ recommend to subscribe to the TPR :-) )
 `/anick, January 2009
 
 [1] http://www.theperlreview.com/
+
+=== INSTALLATION
+
+To install the scripts and their supporting module, do
+
+    $ perl ./Build.PL
+    $ ./Build test
+    $ sudo ./Build install
+
+or a variation thereof.
+
+If you run Build.PL interactively, it'll also
+ask you if you want to install the scripts alongside
+the Git commands for a tighter integration (Git will
+consider all the git-cpan-* commands as being legit
+Git sub-command, which means that shell completion and
+'git &lt;blah&gt;' type of commands will transparently work).  
+</diff>
      <filename>README</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0891f398e62f4dbdabd380f3b9d8919d49b7becd</id>
    </parent>
  </parents>
  <author>
    <name>Yanick Champoux</name>
    <email>yanick@babyl.dyndns.org</email>
  </author>
  <url>http://github.com/yanick/git-cpan-patch/commit/648da99ada31aabb061ae7c39b11afd0ae5b3e42</url>
  <id>648da99ada31aabb061ae7c39b11afd0ae5b3e42</id>
  <committed-date>2009-01-16T17:21:25-08:00</committed-date>
  <authored-date>2009-01-16T17:21:25-08:00</authored-date>
  <message>Build.PL now install the stuff

Build.PL will also look for the git-core directory and offer
to the user the possibility to dump the G:C:P scripts in there.</message>
  <tree>c1b96d48d4d140cf045ef0968efa88ab508110e6</tree>
  <committer>
    <name>Yanick Champoux</name>
    <email>yanick@babyl.dyndns.org</email>
  </committer>
</commit>
