diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2020-05-20 20:36:07 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-20 20:39:01 +0300 |
commit | d1eb22da09e0ffebbd6c16ef1d0e952ec7b88b8d (patch) | |
tree | 2c31d1bdfaadaea8b93250c5a0f6bceec15543ac /refs.h | |
parent | b34789c0b0d3b137f0bb516b417bd8d75e0cb306 (diff) |
refs.h: clarify reflog iteration order
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r-- | refs.h | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -432,19 +432,35 @@ int delete_refs(const char *msg, struct string_list *refnames, int refs_delete_reflog(struct ref_store *refs, const char *refname); int delete_reflog(const char *refname); -/* iterate over reflog entries */ +/* + * Callback to process a reflog entry found by the iteration functions (see + * below) + */ typedef int each_reflog_ent_fn( struct object_id *old_oid, struct object_id *new_oid, const char *committer, timestamp_t timestamp, int tz, const char *msg, void *cb_data); +/* Iterate over reflog entries in the log for `refname`. */ + +/* oldest entry first */ int refs_for_each_reflog_ent(struct ref_store *refs, const char *refname, each_reflog_ent_fn fn, void *cb_data); + +/* youngest entry first */ int refs_for_each_reflog_ent_reverse(struct ref_store *refs, const char *refname, each_reflog_ent_fn fn, void *cb_data); + +/* + * Iterate over reflog entries in the log for `refname` in the main ref store. + */ + +/* oldest entry first */ int for_each_reflog_ent(const char *refname, each_reflog_ent_fn fn, void *cb_data); + +/* youngest entry first */ int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void *cb_data); /* |