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

Re: BUG: refs.c:1933: reference backend is unknown

From
shejialuo <shejialuo@gmail.com>
Date
Sep 22, 2024, 06:51 UTC
Message-ID
<Zu--coU4qv6Z1SmD@ArchLinux>
In-Reply-To
<9bf5c254-4d87-4f6f-b278-d9df4d7897b5@web.de>
On Sat, Sep 21, 2024 at 11:22:04PM +0200, René Scharfe wrote:
[snip]
Show 7 quoted lines
> I wonder if the BUG at refs.c:1933 should just be turned into a die().
> Or should ref_store_init() return NULL (or some other value indicating
> an error) and all callers need to be changed to deal with that?
> 
> Simply checking whether --git-dir points to an actual repo earlier is
> tempting, but would leave the case of it disappearing after the check
> unhandled.

From my perspective, it is not suitable to change the "refs.c". I guess the reason why Patrick uses the "BUG()" is that it's an internal implementation and we should tell the developer something is wrong.

In this case, because we use "include.onbranch" configuration, the "config.c::include_by_branch" will use "refsc::get_main_ref_store" to get the refname.

However, the repo does not exist, so we cannot find any ref backend. The main problem is that we never check whether "the_repository->gitdir" is a git directory in "config.c::include_by_branch". So, we do not need to check the value of the option "--git-dir".

Thanks, Jialuo

Previous: René ScharfeNext: shejialuo
Message 5 of 13 in “BUG: refs.c:1933: reference backend is unknown”
  1. Ronan PigottSep 20, 2024
  2. shejialuoSep 21, 2024
  3. Ronan PigottSep 21, 2024
  4. René ScharfeSep 21, 2024
  5. shejialuoSep 22, 2024
  6. shejialuoSep 22, 2024
  7. 0/2 config: fix evaluating "onbranch" with nonexistent git dirPatrick Steinhardt, Sep 24, 2024
  8. 1/2 t1305: exercise edge cases of "onbranch" includesPatrick Steinhardt, Sep 24, 2024
  9. Junio C HamanoSep 24, 2024
  10. 2/2 config: fix evaluating "onbranch" with nonexistent git dirPatrick Steinhardt, Sep 24, 2024
  11. shejialuoSep 24, 2024
  12. Junio C HamanoSep 24, 2024
  13. shejialuoSep 24, 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.