How can I get a summary similar to git add –interactive?

I am looking for a Bash command (or sequence of commands) that prints a summary of what files are changed in a Git working copy. The summary should include the number of insertions and deletions in each file, and maybe whether they are staged.

The command git add --interactive (which is synonymous with git add -i) gives exactly the summary I want (plus other stuff). The problem is that it doesn’t just print and exit, it starts up a whole non-Bash shell. Here is the part of git add -i that I like:

bash$ git add -i
         staged     unstaged path
1:    unchanged        +3/-0 trunk/src/analyzer.c
2:    unchanged       +5/-13 trunk/src/converter.c

That’s a great summary. Unfortunately, after it prints, you are not back in Bash. To get back to Bash, you need to type q and then enter, to quit. I really want it to just print the summary and then stop.

Here is what I have tried:

  1. Type the following in the Bash terminal: git add -i; q. This doesn’t work, it still needs you to press q manually, and then it gives an error because of the second q.

  2. Put the following in a script gitsummary.sh and then run it: git add -i, with or without ; q at the end. Same problem.

How can I get this summary in a totally non-interactive way? I can think of two possible solutions:

  1. Use a Bash trick that waits a fraction of a second and then simulates a key press.

  2. Use a different Git command that prints the same information but doesn’t start a strange little shell.

My main setup: Mac OS X 10.9 and Terminal (running /bin/bash).

My secondary setup: Windows 7 or 8 and Cygwin running Bash.

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