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

Antw: [EXT] Re: bug in "git fsck"?

From
UWUlrich Windl <ulrich.windl@rz.uni-regensburg.de>
Date
Jul 5, 2021, 07:20 UTC
Message-ID
<60E2B2AF020000A100042296@gwsmtp.uni-regensburg.de>
In-Reply-To
<xmqqczs0popg.fsf@gitster.g>
>>> Ulrich Windl schrieb am 05.07.2021 um 09:10 in Nachricht <60E2B04B.461 :

161 : 60728>:

>>>> Junio C Hamano <gitster@pobox.com> schrieb am 02.07.2021 um 20:15 in
Nachricht
Show 19 quoted lines
> <xmqqczs0popg.fsf@gitster.g>:
> > "Ulrich Windl" <Ulrich.Windl@rz.uni‑regensburg.de> writes:
> > 
> >> I was wondering whether git fsck should be able to cleanup
> >> orphaned branches ("HEAD points to an unborn branch") as described
> >> in https://stackoverflow.com/q/68226081/6607497 It seems I can fix
> >> it be editing files in the repository, but I feed that's not the
> >> way it should be.
> > 
> > HEAD pointing at an unborn branch is not even a corruption, isn't
> > it?
> > 
> >    $ rm ‑rf trash && git init trash
> > 
> > would point HEAD at an unborn one, ready to be used.
> 
> 
> OK, so maybe I was just confused by "fsck". At it seems after committing, 
> fsck no longer complains.

Sorry, I didn't think (still pre-coffeine time): The problem is gone in the workspace so far, not in the repository, and I think the problem never was present in the workspace. Also "git branch" dispalys three branches in addition to "master", while the "branches" directory of the repository is empty. So when I try to delete a branch displayed by "git branch", I get: fatal: Couldn't look up commit object for HEAD

It seems the delete command reads those refs from HEAD: ref: refs/heads/name_of_branch_to_be_deleted

but in refs/heads/ that name does not exist

Last command before error message is: lstat("./objects/00/00000000000000000000000000000000000000", 0x7fff76d9a180) = -1 ENOENT (No such file or directory) write(2, "fatal: Couldn't look up commit o"..., 47fatal: Couldn't look up commit object for HEAD ) = 47

Show 10 quoted lines
> As "EXTRACTED DIAGNOSTICS" In man git-fsck (Git 2.26.2) does not mention 
> "unborn" (and as it's not a common IT phrase), one could probably explain 
> what it means.
> 
> Regards,
> Ulrich
> 
> 
> 
> 
Previous: Ævar Arnfjörð Bjarmason
Message 13 of 13 in “bug in "git fsck"?”
  1. Ulrich WindlJul 2, 2021
  2. Junio C HamanoJul 2, 2021
  3. René ScharfeJul 3, 2021
  4. Antw: [EXT] Re: bug in "git fsck"?Ulrich Windl, Jul 5, 2021
  5. René ScharfeJul 5, 2021
  6. Ulrich WindlJul 6, 2021
  7. René ScharfeJul 6, 2021
  8. Ulrich WindlJul 8, 2021
  9. René ScharfeJul 8, 2021
  10. Junio C HamanoJul 5, 2021
  11. Antw: [EXT] Re: bug in "git fsck"?Ulrich Windl, Jul 5, 2021
  12. Ævar Arnfjörð BjarmasonJul 5, 2021
  13. Antw: [EXT] Re: bug in "git fsck"?Ulrich Windl, Jul 5, 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.