git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/6] refs.h: clarify reflog iteration order

From
Han-Wen Nienhuys via GitGitGadget <gitgitgadget@gmail.com>
Date
May 20, 2020, 17:36 UTC
Message-ID
<15ec202d79cc62dc0a026fbffc41bc6681a50985.1589996173.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.638.git.1589996173.gitgitgadget@gmail.com>
From: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 refs.h | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/refs.h b/refs.h
index a92d2c74c83..e010f8aec28 100644
--- a/refs.h
+++ b/refs.h
@@ -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);
 
 /*
-- 
gitgitgadget
Previous: Han-Wen Nienhuys via GitGitGadgetNext: Han-Wen Nienhuys via GitGitGadget
Message 2 of 8 in “Refs cleanup”
  1. 0/6 Refs cleanupHan-Wen Nienhuys via GitGitGadget, May 20, 2020
  2. 1/6 refs.h: clarify reflog iteration orderHan-Wen Nienhuys via GitGitGadget, May 20, 2020
  3. 2/6 t: use update-ref and show-ref to reading/writing refsHan-Wen Nienhuys via GitGitGadget, May 20, 2020
  4. 3/6 refs: improve documentation for ref iteratorHan-Wen Nienhuys via GitGitGadget, May 20, 2020
  5. 4/6 reftable: file format documentationJonathan Nieder via GitGitGadget, May 20, 2020
  6. 6/6 reftable: define version 2 of the spec to accomodate SHA256Han-Wen Nienhuys via GitGitGadget, May 20, 2020
  7. 5/6 reftable: clarify how empty tables should be writtenHan-Wen Nienhuys via GitGitGadget, May 20, 2020
  8. Junio C HamanoMay 20, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.