external: trigger git commit-msg hooks on import
authorAndrew Deason <adeason@sinenomine.net>
Thu, 3 Nov 2011 17:33:55 +0000 (12:33 -0500)
committerDerrick Brashear <shadow@dementix.org>
Thu, 3 Nov 2011 20:09:29 +0000 (13:09 -0700)
When we import commits, the new commit does not have a Change-Id in
the commit message. Usually a git commit-msg hook will be installed to
automatically insert a Change-Id into the commit message if one does
not already exist, so trigger the hook by performing a no-op 'git
commit --amend'.

Change-Id: Ie5e83c529b83c9f3d269df6742a59e965dbc6407
Reviewed-on: http://gerrit.openafs.org/5797
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/external/import-external-git.pl

index a3dcd42..190be1b 100755 (executable)
@@ -216,6 +216,8 @@ eval {
        system("git rebase --whitespace=fix HEAD^") == 0
            or print STDERR "WARNING: Fixing whitespace errors failed.\n";
     }
+    system("GIT_EDITOR=true git commit --amend") == 0
+      or print STDERR "WARNING: Firing commit msg hooks failed.\n";
   }
 };