important business fika

ernst and i attempt to "sweeten the deal" for the bosses, just before we justify the purchasing of two iphones for an upcoming project :)

Posted Fri May 15 15:58:26 2009 Tags:

continuing on the trend of finding novel ways to make life more interesting with git, here's the description from a new hook:

# prepare-commit-msg hook for debian package git repositories
#
# this script scans the diff that is going into a commit, and automatically
# injects some "proposed" comments based on what it finds in the diff.  this
# can be used to avoid a few extra keystrokes when performing some of the
# more standard/boring tasks.

(see below for how to fetch the script)

this one definitely falls in the "carrot" category, as it encourages properly isolated (and thus automatically identifiable) changes. the proposed comments are then given to the standard editor, so one can easily amend them, append "Closes:" lines, etc.

some sample use-cases currently implemented:

  • changelog entries

    • detect when a new version is introduced in debian/changelog

      prepare release information for <dist>/<vers>
      
      
    • detect when an existing version is updated in debian/changelog

      release information for <dist>/<vers>
      
      
  • debconf translations

    • detect when one or more po files are modified

      updates to (<lang1>,<lang2>...) debconf translations
      
      
       * <lang1>: <translator for lang1>
       * <lang2>: <translator for lang1>
      
      
  • updates in debian/patches

    • detect when a new patch is introduced

      new debian patch <patchname>
      
      
      <patch header (anything before the diff)>
      
      
    • detect when an existing patch is modified

      update debian patch <patchname>
      
      
      <patch header>
      
      
    • detect when several patches are imported simultaneously

      import <n> files in debian/patches
      
      
      <patch1>:
        <patch header>
      <patch2>:
        <patch header>
      <non-patch-file (series/etc)>:
        no patch description/comments found
      ...
      
      
    • detect when several patches are created/modified simultaneously

      create/update <n> files in debian/patches
      ...
      
      

as always, comments/feedback/suggestions/etc welcome :)

using this new hook

note this is the same repo as the previous hooks i've blogged about, so if you already have that set up you can skip the clone and instead just pull in the changes. also note that this is in your local repo, not the remote one.

to set it up:

REPO_PATH=/path/to/your/repo.git
HOOK_REPO_PATH=/somewhere/you/want/to/put/it
git clone git://git.debian.org/users/seanius/vcs-hooks/git-hooks.git $HOOK_REPO_PATH
ln -sf $HOOK_REPO_PATH/debian/git-hooks/prepare-commit-msg-guess-message.py $REPO_PATH/.git/hooks/prepare-commit-msg

there aren't currently any configurable options in this hook.

Posted Thu May 14 17:27:41 2009 Tags: