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

[PATCH v3 1/2] revision: document get_reference()

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Jan 11, 2020, 22:34 UTC
Message-ID
<6dce9c79be3b9264f832852e9068347f42cf3ee0.1578781770.git.jonathantanmy@google.com>
In-Reply-To
<cover.1578781770.git.jonathantanmy@google.com>
In particular, document the behavior when the object is corrupt. The
existing behavior when parse_object() encounters a hash mismatch has
been there since cc243c3ceb ("show: --ignore-missing", 2011-05-19), and
the existing behavior when the code disagrees on whether an object is a
commit has been there since ec0c5798ee ("revision: use commit graph in
get_reference()", 2018-12-28).
---
 revision.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/revision.c b/revision.c
index 8136929e23..91ca194388 100644
--- a/revision.c
+++ b/revision.c
@@ -355,6 +355,16 @@ void add_head_to_pending(struct rev_info *revs)
 	add_pending_object(revs, obj, "HEAD");
 }
 
+/*
+ * Returns the object corresponding to "oid" and sets the given flags on
+ * it.
+ *
+ * If that object is missing or corrupt, this function returns NULL if
+ * "revs" permits it (that is, if revs->ignore_missing is true or if
+ * revs->exclude_promisor_objects is true and the object is a promisor
+ * object), and dies otherwise. Note that corrupt objects are treated
+ * like missing objects, to preserve existing behavior.
+ */
 static struct object *get_reference(struct rev_info *revs, const char *name,
 				    const struct object_id *oid,
 				    unsigned int flags)
-- 
2.25.0.rc1.283.g88dfdc4193-goog
Previous: Jonathan TanNext: Emily Shaffer
Message 9 of 12 in “revision: allow missing promisor objects on CLI”
  1. revision: allow missing promisor objects on CLIJonathan Tan, Dec 28, 2019
  2. Junio C HamanoDec 28, 2019
  3. Jonathan TanDec 30, 2019
  4. Junio C HamanoDec 30, 2019
  5. revision: allow missing promisor objects on CLIJonathan Tan, Dec 30, 2019
  6. Jonathan NiederDec 31, 2019
  7. Jonathan TanJan 2, 2020
  8. 0/2 Un-regress rev-list --exclude-promisor-objectsJonathan Tan, Jan 11, 2020
  9. 1/2 revision: document get_reference()Jonathan Tan, Jan 11, 2020
  10. Emily ShafferMar 25, 2020
  11. 2/2 revision: un-regress --exclude-promisor-objectsJonathan Tan, Jan 11, 2020
  12. Emily ShafferMar 25, 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.