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

[PATCH 0/2] report lock error in write_index

From
Han Young <hanyang.tony@bytedance.com>
Date
May 21, 2025, 08:35 UTC
Message-ID
<20250521083521.6552-1-hanyang.tony@bytedance.com>
In the repo_refresh_and_write_index of read-cache.c, we return -1 to
indicate that writing the index to disk failed.
However, callers do not use this information. Commands such as stash print
  "could not write index"
and then exit, which does not help to discover the exact problem.

We can let repo_hold_locked_index print the error message if the locking failed.

The second commit is to provide a more consistent error message in various commands when writing index failed. Currently, there are 10 uses of "could not write index", two uses of "unable to write index file" and "Unable to write index.". Change them to the most used "could not write index".

Han Young (2):
  read-cache: report lock error when refreshing index
  read-cache: unify write index error message
 builtin/am.c         | 2 +-
 builtin/commit.c     | 2 +-
 builtin/merge.c      | 2 +-
 merge-ort-wrappers.c | 2 +-
 read-cache.c         | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
-- 
2.48.1
Next: Han Young
Message 1 of 4 in “report lock error in write_index”
  1. 0/2 report lock error in write_indexHan Young, May 21, 2025
  2. 1/2 read-cache: report lock error when refreshing indexHan Young, May 21, 2025
  3. 2/2 read-cache: unify write index error messageHan Young, May 21, 2025
  4. Han YoungMay 21, 2025

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.