Git plumbing command to find out which files have been changed in a given revision

I’ve created a hook that sends out notification emails when a developer pushes an update to his shared repository. This email includes a list of changed files, example:

A   __classes/Page/Activity.php
M   __config/Scheme.php

that I generate using the following bit of bash:

  • Mercurial copy patch to repository
  • Jenkins + git - ensure that the build has been run
  • Permission denied while cloning project in htdocs
  • Can I set up a git repository to be available from several computers?
  • Could not resolve hostname git: nodename nor servname provided, or not known
  • Can a lightweight tag be converted to an annotated tag?
  • $(git diff "$newrev"^ "$newrev" --name-status)
    

    This works fine. However, I’m trying to port all this now to the well-known post-receive-email hook. This hook does have a hooks.showrev configuration directive, but this I think this only allows for the revision number (%s) to be used once in the command. So this doesn’t work:

    showrev = "git diff %s^ %s --name-status"
    

    There must be a ‘plumbing’ command that does just this. Can anyone point me in the right direction? 🙂

  • Way to build web application with GIT, when designer can't have access to all sources?
  • How to revert changes after git reset
  • git svn clone hangs. fetch restarts but hangs at the same place
  • How to get 'test' branch into 'master' when 'test' is a branch of 'dev'?
  • git filter not 'unmodifying' file
  • autodoc directive works locally but not on readthedocs
  • 2 Solutions collect form web for “Git plumbing command to find out which files have been changed in a given revision”

    How about using the following?

    showrev = "git show --name-status --pretty=format: %s"
    

    git show is porcelain rather than plumbing, but I think this is what you want.

    git whatchanged -1 <rev> might be a good starting point, and has a number of additional options for massaging the output format. Not sure you can get exactly the format you quoted above, but you should be able to get something comparable.

    Git Baby is a git and github fan, let's start git clone.