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

Re: [PATCH 1/2] fsck: HEAD is part of refs

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 1, 2009, 00:53 UTC
Message-ID
<7v3aez3rlz.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<4982C7FA.20107@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 19 quoted lines
> Junio C Hamano schrieb:
>> By default we looked at all refs but not HEAD.  The only thing that
>> made fsck not lose sight of comments that are only reachable from a
>> detached HEAD was the reflog for the HEAD.
>> 
>> This fixes it, with a new test.
> [...]
>> +test_expect_success setup '
>> +	test_commit A &&
>> +	git checkout HEAD^0 &&
>> +	test_commit B &&
>> +	git reflog expire --expire=now --all
>> +'
>> +
>> +test_expect_success 'HEAD is part of refs' '
>> +	test 0 = $(git fsck | wc -l)
>
> I'm scratching my head over this. This test succeeds even without the
> change... (Tested with a34a9db.)
You are right.  I forgot that test_commit creates an extra tag.  By adding
	git tag -d B &&
after "test_commit B &&", you would expose the issue in the existing code.
Previous: Johannes SixtNext: Johannes Schindelin
Message 21 of 25 in “Something weird is happening...”
  1. H. Peter AnvinJan 29, 2009
  2. Junio C HamanoJan 29, 2009
  3. Sverre RabbelierJan 29, 2009
  4. Junio C HamanoFeb 1, 2009
  5. Ingo MolnarJan 29, 2009
  6. Ingo MolnarJan 29, 2009
  7. Junio C HamanoJan 29, 2009
  8. H. Peter AnvinJan 29, 2009
  9. Ingo MolnarJan 29, 2009
  10. Ingo MolnarJan 29, 2009
  11. H. Peter AnvinJan 29, 2009
  12. Ingo MolnarJan 29, 2009
  13. René ScharfeJan 29, 2009
  14. Daniel BarkalowJan 29, 2009
  15. merge: fix out-of-bounds memory accessRené Scharfe, Jan 31, 2009
  16. H. Peter AnvinJan 29, 2009
  17. Junio C HamanoJan 29, 2009
  18. Linus TorvaldsJan 29, 2009
  19. 1/2 fsck: HEAD is part of refsJunio C Hamano, Jan 30, 2009
  20. Johannes SixtJan 30, 2009
  21. Junio C HamanoFeb 1, 2009
  22. Johannes SchindelinJan 30, 2009
  23. Nanako ShiraishiJan 31, 2009
  24. Junio C HamanoFeb 1, 2009
  25. 2/2 fsck: check loose objects from alternate object stores by defaultJunio C Hamano, Jan 30, 2009

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.