add--interactive: respect diff.algorithm
commit2cc0f53b53e7d5456ec45713a201142754d69249
authorJohn Keeping <john@keeping.me.uk>
Wed, 12 Jun 2013 18:44:10 +0000 (12 19:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Jun 2013 20:41:19 +0000 (12 13:41 -0700)
tree94418ab8fab56d71df612e36144bfb54a472033f
parentedca4152560522a431a51fc0a06147fc680b5b18
add--interactive: respect diff.algorithm

When staging hunks interactively it is sometimes useful to use an
alternative diff algorithm which splits the changes into hunks in a more
logical manner.  This is not possible because the plumbing commands
called by add--interactive ignore the "diff.algorithm" configuration
option (as they should).

Since add--interactive is a porcelain command it should respect this
configuration variable.  To do this, make it read diff.algorithm and
pass its value to the underlying diff-index and diff-files invocations.

At this point, do not add options to "git add", "git reset" or "git
checkout" (all of which can call git-add--interactive).  If a user
wants to override the value on the command line they can use:

git -c diff.algorithm=$ALGO ...

Signed-off-by: John Keeping <john@keeping.me.uk>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-add--interactive.perl