Re: [BUG] `git gc` or `git pack-refs` wipes all notes for `git notes` command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 03, 2023 at 05:22:01AM +0200, Andrew Hlynskyi wrote:

> Steps to reproduce:
> 1. Create some notes with the `git notes add` command.
> 2. Run `git notes` to list stored notes.
> 3. Run any of `git gc  --prune=now` or `git pack-refs --all` commands.
> 4. Run `git notes` again and see that there are no more seen notes.

This doesn't reproduce for me at all. Running:

  git init repo
  cd repo

  git commit --allow-empty -m "this is the commit message"
  git notes add -m "this is the note"

  git notes
  git pack-refs --all
  git notes

Shows the same output before and after packing the refs.

> The reason is that all commands like `git notes` or `git log --notes`
> expect to find notes head as unpacked ref in .git/refs/notes/commits.
> But the gc or the pack-refs command packs .git/refs/notes/commits ref
> into .git/packed-refs file.

That would be very surprising. The lookup of the ref in the notes code
uses the same generic ref code that the rest of Git uses, which
understands packed-refs and so on.

Can you share the .git directory of a repository that exhibits this
behavior? It's possible there's a bug or something in the packed-refs
code, though I find it pretty unlikely, as it's fairly well exercised in
normal use.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux