From a330de31d18ca08c773c64e3657b3bafd59cf751 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Thu, 24 Oct 2013 14:01:41 -0400 Subject: revision: allow setting custom limiter function This commit enables users of `struct rev_info` to peform custom limiting during a revision walk (i.e. `get_revision`). If the field `include_check` has been set to a callback, this callback will be issued once for each commit before it is added to the "pending" list of the revwalk. If the include check returns 0, the commit will be marked as added but won't be pushed to the pending list, effectively limiting the walk. Signed-off-by: Vicent Marti Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- revision.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'revision.h') diff --git a/revision.h b/revision.h index e7f1d211b..9957f3c6e 100644 --- a/revision.h +++ b/revision.h @@ -168,6 +168,8 @@ struct rev_info { unsigned long min_age; int min_parents; int max_parents; + int (*include_check)(struct commit *, void *); + void *include_check_data; /* diff info for patches and for paths limiting */ struct diff_options diffopt; -- cgit v1.2.1