unsigned flags,
const char *prefix,
const char **args);
+/*
+ * Same as parse_pathspec() but uses file as input.
+ * When 'file' is exactly "-" it uses 'stdin' instead.
+ */
+void parse_pathspec_file(struct pathspec *pathspec,
+ unsigned magic_mask,
+ unsigned flags,
+ const char *prefix,
+ const char *file,
+ int nul_term_line);
+
void copy_pathspec(struct pathspec *dst, const struct pathspec *src);
void clear_pathspec(struct pathspec *);
int handle_revision_arg(const char *arg, struct rev_info *revs,
int flags, unsigned revarg_opt);
+ /**
+ * Reset the flags used by the revision walking api. You can use this to do
+ * multiple sequential revision walks.
+ */
void reset_revision_walk(void);
+
+ /**
+ * Prepares the rev_info structure for a walk. You should check if it returns
+ * any error (non-zero return code) and if it does not, you can start using
+ * get_revision() to do the iteration.
+ */
int prepare_revision_walk(struct rev_info *revs);
+
+ /**
+ * Takes a pointer to a `rev_info` structure and iterates over it, returning a
+ * `struct commit *` each time you call it. The end of the revision list is
+ * indicated by returning a NULL pointer.
+ */
struct commit *get_revision(struct rev_info *revs);
-char *get_revision_mark(const struct rev_info *revs,
- const struct commit *commit);
+
+const char *get_revision_mark(const struct rev_info *revs,
+ const struct commit *commit);
void put_revision_mark(const struct rev_info *revs,
const struct commit *commit);