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

Re: [PATCH v3 4/5] Always check `parse_tree*()`'s return value

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2024, 17:17 UTC
Message-ID
<xmqq4jdzw15r.fsf@gitster.g>
In-Reply-To
<883087b8-b013-7b30-5485-719a1c310608@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 8 quoted lines
> Right. I had used
>
>   $ git grep 'unable to read tree .*%s' | sed -n 's/.*_("\([^"]*\).*/\1/p' | sort | uniq -c
>        11 unable to read tree %s
>         3 unable to read tree (%s)
>
> only to realize that the 11 were the ones I added.🤦 Re-running the same
> command on v2.43.0 reports only the 3 parenthesized ones.

I think we probably should discuss what format is the easiest to understand and most logical to readers, and unify to such a format, not necessarily the current majority, in the longer term. But for now, let's pick one that costs less to unify to.

We may also want to cast a wider net to make things consistent. For example, we learn that the parenthesized one is not necessarily more prevalent in a larger picture.

Let me annotate the output from this command:
    $ git grep -h -E \
      -e '(unable to|not) (read|find|acccess) (blob|tree|commit|tag) .*%s' master po/ |
      sort -u
1. msgid "cannot find commit %s (%s)"
   The first one is a textual refname, the next one is oid-to-hex.
2. msgid "cannot read blob %s for path %s"
   The first one is oid-to-hex, the other is a pathname.
3. msgid "could not find commit %s"
   oid-to-hex (in commit-graph.c)
4. msgid "could not read commit message of %s"
   oid-to-hex (in sequencer.c)
5. msgid "could not read commit message: %s"
   This is irrelevant to the topic, as %s is for strerror().
6. msgid "unable to access commit %s"
   oid-to-hex (in builtin/pull.c)
7. msgid "unable to read commit message from '%s'"
   This message is in po/ but it seems that it no longer is used
   anywhere in the source.
8. msgid "unable to read tree %s"
9. msgid "unable to read tree (%s)"
   We know about these two already.

We seem to just use unadorned %s for many messages when talking about commit objects, some are inside a pair of 'single quotes', When we are giving a long hexadecimal string, especially without doing any abbreviation, I personally think it is a waste to enclose it in any punctuation pair, so if I were to vote today, I would probably support standardizing on "tree %s", "blob %s", etc., but I think that is just a personal preference (not even a "taste" thing).

In any case, all of the above is clearly outside the scope of this series.

Previous: Johannes SchindelinNext: Johannes Schindelin via GitGitGadget
Message 38 of 48 in “merge-tree: handle missing objects correctly”
  1. 0/4 merge-tree: handle missing objects correctlyJohannes Schindelin via GitGitGadget, Feb 6, 2024
  2. 1/4 merge-tree: fail with a non-zero exit code on missing tree objectsJohannes Schindelin via GitGitGadget, Feb 6, 2024
  3. Patrick SteinhardtFeb 7, 2024
  4. 2/4 merge-ort: do check `parse_tree()`'s return valueJohannes Schindelin via GitGitGadget, Feb 6, 2024
  5. 3/4 t4301: verify that merge-tree fails on missing blob objectsJohannes Schindelin via GitGitGadget, Feb 6, 2024
  6. 4/4 Always check `parse_tree*()`'s return valueJohannes Schindelin via GitGitGadget, Feb 6, 2024
  7. Junio C HamanoFeb 6, 2024
  8. Patrick SteinhardtFeb 7, 2024
  9. Junio C HamanoFeb 6, 2024
  10. Patrick SteinhardtFeb 7, 2024
  11. 0/5 merge-tree: handle missing objects correctlyJohannes Schindelin via GitGitGadget, Feb 7, 2024
  12. 1/5 merge-tree: fail with a non-zero exit code on missing tree objectsJohannes Schindelin via GitGitGadget, Feb 7, 2024
  13. Eric SunshineFeb 7, 2024
  14. Johannes SchindelinFeb 22, 2024
  15. 2/5 merge-ort: do check `parse_tree()`'s return valueJohannes Schindelin via GitGitGadget, Feb 7, 2024
  16. 3/5 t4301: verify that merge-tree fails on missing blob objectsJohannes Schindelin via GitGitGadget, Feb 7, 2024
  17. Eric SunshineFeb 7, 2024
  18. Junio C HamanoFeb 7, 2024
  19. Eric SunshineFeb 8, 2024
  20. Johannes SchindelinFeb 22, 2024
  21. 4/5 Always check `parse_tree*()`'s return valueJohannes Schindelin via GitGitGadget, Feb 7, 2024
  22. Eric SunshineFeb 7, 2024
  23. Johannes SchindelinFeb 22, 2024
  24. Junio C HamanoFeb 22, 2024
  25. 5/5 cache-tree: avoid an unnecessary checkJohannes Schindelin via GitGitGadget, Feb 7, 2024
  26. Junio C HamanoFeb 7, 2024
  27. 0/5 merge-tree: handle missing objects correctlyJohannes Schindelin via GitGitGadget, Feb 22, 2024
  28. 1/5 merge-tree: fail with a non-zero exit code on missing tree objectsJohannes Schindelin via GitGitGadget, Feb 22, 2024
  29. Junio C HamanoFeb 22, 2024
  30. 2/5 merge-ort: do check `parse_tree()`'s return valueJohannes Schindelin via GitGitGadget, Feb 22, 2024
  31. Junio C HamanoFeb 22, 2024
  32. 3/5 t4301: verify that merge-tree fails on missing blob objectsJohannes Schindelin via GitGitGadget, Feb 22, 2024
  33. Junio C HamanoFeb 22, 2024
  34. Junio C HamanoFeb 22, 2024
  35. 4/5 Always check `parse_tree*()`'s return valueJohannes Schindelin via GitGitGadget, Feb 22, 2024
  36. Junio C HamanoFeb 22, 2024
  37. Johannes SchindelinFeb 23, 2024
  38. Junio C HamanoFeb 23, 2024
  39. 5/5 cache-tree: avoid an unnecessary checkJohannes Schindelin via GitGitGadget, Feb 22, 2024
  40. Junio C HamanoFeb 22, 2024
  41. 0/6 merge-tree: handle missing objects correctlyJohannes Schindelin via GitGitGadget, Feb 23, 2024
  42. 1/6 merge-tree: fail with a non-zero exit code on missing tree objectsJohannes Schindelin via GitGitGadget, Feb 23, 2024
  43. 2/6 merge-ort: do check `parse_tree()`'s return valueJohannes Schindelin via GitGitGadget, Feb 23, 2024
  44. 3/6 t4301: verify that merge-tree fails on missing blob objectsJohannes Schindelin via GitGitGadget, Feb 23, 2024
  45. 4/6 Always check `parse_tree*()`'s return valueJohannes Schindelin via GitGitGadget, Feb 23, 2024
  46. 5/6 cache-tree: avoid an unnecessary checkJohannes Schindelin via GitGitGadget, Feb 23, 2024
  47. 6/6 fill_tree_descriptor(): mark error message for translationJohannes Schindelin via GitGitGadget, Feb 23, 2024
  48. Junio C HamanoFeb 23, 2024

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.