Skip to content

Commit d1eb22d

Browse files
hanwengitster
authored andcommitted
refs.h: clarify reflog iteration order
Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b34789c commit d1eb22d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

refs.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,19 +432,35 @@ int delete_refs(const char *msg, struct string_list *refnames,
432432
int refs_delete_reflog(struct ref_store *refs, const char *refname);
433433
int delete_reflog(const char *refname);
434434

435-
/* iterate over reflog entries */
435+
/*
436+
* Callback to process a reflog entry found by the iteration functions (see
437+
* below)
438+
*/
436439
typedef int each_reflog_ent_fn(
437440
struct object_id *old_oid, struct object_id *new_oid,
438441
const char *committer, timestamp_t timestamp,
439442
int tz, const char *msg, void *cb_data);
440443

444+
/* Iterate over reflog entries in the log for `refname`. */
445+
446+
/* oldest entry first */
441447
int refs_for_each_reflog_ent(struct ref_store *refs, const char *refname,
442448
each_reflog_ent_fn fn, void *cb_data);
449+
450+
/* youngest entry first */
443451
int refs_for_each_reflog_ent_reverse(struct ref_store *refs,
444452
const char *refname,
445453
each_reflog_ent_fn fn,
446454
void *cb_data);
455+
456+
/*
457+
* Iterate over reflog entries in the log for `refname` in the main ref store.
458+
*/
459+
460+
/* oldest entry first */
447461
int for_each_reflog_ent(const char *refname, each_reflog_ent_fn fn, void *cb_data);
462+
463+
/* youngest entry first */
448464
int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void *cb_data);
449465

450466
/*

0 commit comments

Comments
 (0)