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

Re: [PATCH] stash: show error message when lockfile is present

From
Taylor Blau <me@ttaylorr.com>
Date
Nov 8, 2021, 17:56 UTC
Message-ID
<YYlkumkOWotx6umn@nand.local>
In-Reply-To
<xmqqlf1zunqe.fsf@gitster.g>
On Sun, Nov 07, 2021 at 11:10:17PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> I would think the "fix" should look more like this:
>
>  	read_cache_preload(NULL);
> 	if (refresh_and_write_cache(REFRESH_QUIET, 0, 0))
> - 		return -1;
> + 		return error(_("failed to refresh the index"));
>
> That is, tell the function that the caller will do the error
> reporting (i.e. "QUIET") and do so.

Thanks; this is a much better approach. It makes Birk's change much more direct, and does not require plumbing a new parameter through many function calls.

Doing something like this (with appropriate tests) would look good to me.

Thanks, Taylor

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 5 of 8 in “stash: show error message when lockfile is present”
  1. stash: show error message when lockfile is presentBirk Tjelmeland, Nov 7, 2021
  2. Taylor BlauNov 8, 2021
  3. Taylor BlauNov 8, 2021
  4. Junio C HamanoNov 8, 2021
  5. Taylor BlauNov 8, 2021
  6. Ævar Arnfjörð BjarmasonNov 8, 2021
  7. Junio C HamanoNov 8, 2021
  8. Birk TjelmelandNov 8, 2021

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.