From: Junio C Hamano Date: Tue, 10 Feb 2009 05:16:23 GMT Subject: Re: [PATCH] Generalize and libify index_is_dirty() to index_differs_from(...) Message-ID: <7v63jirhw8.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1234222843-15577-1-git-send-email-s-beyer@gmx.net> Stephan Beyer 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.