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

Re: [PATCH] fsck: avoid misleading variable name

From
Jeff King <peff@peff.net>
Date
Jun 29, 2023, 19:04 UTC
Message-ID
<20230629190421.GA592842@coredump.intra.peff.net>
In-Reply-To
<20230629181333.87465-1-ericsunshine@charter.net>
On Thu, Jun 29, 2023 at 02:13:33PM -0400, Eric Sunshine wrote:
Show 20 quoted lines
> From: Eric Sunshine <sunshine@sunshineco.com>
> 
> When reporting a problem, `git fsck` emits a message such as:
> 
>     missing blob 1234abcd (:file)
> 
> However, this can be ambiguous when the problem is detected in the index
> of a worktree other than the one in which `git fsck` was invoked. To
> address this shortcoming, 592ec63b38 (fsck: mention file path for index
> errors, 2023-02-24) enhanced the output to mention the path of the index
> when the problem is detected in some other worktree:
> 
>     missing blob 1234abcd (.git/worktrees/wt/index:file)
> 
> Unfortunately, the variable in fsck_index() which controls whether the
> index path should be shown is misleadingly named "is_main_index" which
> can be misunderstood as referring to the main worktree (i.e. the one
> housing the .git/ repository) rather than to the current worktree (i.e.
> the one in which `git fsck` was invoked). Avoid such potential confusion
> by choosing a name more reflective of its actual purpose.
This looks good to me. Thanks for following up!
-Peff
Previous: Eric Sunshine
Message 2 of 2 in “fsck: avoid misleading variable name”
  1. fsck: avoid misleading variable nameEric Sunshine, Jun 29, 2023
  2. Jeff KingJun 29, 2023

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.