Stephan Beyer [off-list ref] writes:
This is one of the sequencer-preparing patches.
(The function is used in sequencer several times, most of the time
with diff_flags set to DIFF_OPT_IGNORE_SUBMODULES.)
Alex is on Cc because he introduced the "Is commitable?" (i.e.
"Is index dirty?") part in builtin-commit.c.
Peff is on Cc because he introduced index_is_dirty() in
builtin-revert.c.
builtin-commit.c | 13 ++-----------
builtin-revert.c | 13 +------------
revision.c | 15 +++++++++++++++
revision.h | 2 ++
4 files changed, 20 insertions(+), 23 deletions(-)
It is a straightforward and clean restructuring, but please do not
contaminate revision.[ch] with this function about "internally running
diff-index".
revision.[ch] is a library for revision/ancestry traversal and it is
already one of the largest library-ish files. It does not know nor care
about the index, and we want to keep it that way. Please keep its focus
to revision traversal.
Perhaps diff-lib.c would be a better home for your helper function.