#define SYMMETRIC_LEFT (1u<<8)
#define PATCHSAME (1u<<9)
#define BOTTOM (1u<<10)
-#define USER_GIVEN (1u<<25) /* given directly by the user */
+/*
+ * Indicates object was reached by traversal. i.e. not given by user on
+ * command-line or stdin.
+ * NEEDSWORK: NOT_USER_GIVEN doesn't apply to commits because we only support
+ * filtering trees and blobs, but it may be useful to support filtering commits
+ * in the future.
+ */
+#define NOT_USER_GIVEN (1u<<25)
#define TRACK_LINEAR (1u<<26)
-#define ALL_REV_FLAGS (((1u<<11)-1) | USER_GIVEN | TRACK_LINEAR)
+#define ALL_REV_FLAGS (((1u<<11)-1) | NOT_USER_GIVEN | TRACK_LINEAR)
#define DECORATE_SHORT_REFS 1
#define DECORATE_FULL_REFS 2
-struct rev_info;
struct log_info;
+struct repository;
+struct rev_info;
struct string_list;
struct saved_parents;
define_shared_commit_slab(revision_sources, char *);
/* Starting list */
struct commit_list *commits;
struct object_array pending;
+ struct repository *repo;
/* Parents of shown commits */
struct object_array boundary_commits;
line_level_traverse:1,
tree_blobs_in_commit_order:1,
+ /*
+ * Blobs are shown without regard for their existence.
+ * But not so for trees: unless exclude_promisor_objects
+ * is set and the tree in question is a promisor object;
+ * OR ignore_missing_links is set, the revision walker
+ * dies with a "bad tree object HASH" message when
+ * encountering a missing tree. For callers that can
+ * handle missing trees and want them to be filterable
+ * and showable, set this to true. The revision walker
+ * will filter and show such a missing tree as usual,
+ * but will not attempt to recurse into this tree
+ * object.
+ */
+ do_not_die_on_missing_tree:1,
+
/* for internal use only */
exclude_promisor_objects:1;
struct setup_revision_opt {
const char *def;
void (*tweak)(struct rev_info *, struct setup_revision_opt *);
- const char *submodule;
+ const char *submodule; /* TODO: drop this and use rev_info->repo */
int assume_dashdash;
unsigned revarg_opt;
};
-void init_revisions(struct rev_info *revs, const char *prefix);
+#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
+#define init_revisions(revs, prefix) repo_init_revisions(the_repository, revs, prefix)
+#endif
+void repo_init_revisions(struct repository *r,
+ struct rev_info *revs,
+ const char *prefix);
int setup_revisions(int argc, const char **argv, struct rev_info *revs,
struct setup_revision_opt *);
void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
const struct commit *commit);
void mark_parents_uninteresting(struct commit *commit);
-void mark_tree_uninteresting(struct tree *tree);
+void mark_tree_uninteresting(struct repository *r, struct tree *tree);
void show_object_with_name(FILE *, struct object *, const char *);