Re: Bugreport
"Kristoffer Haugsbakk" <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Aug 12, 2026, at 19:03, Junio C Hamano wrote: > "Kristoffer Haugsbakk" <[email protected]> writes: >>[snip] >> >> They are Git notes. They form their own connected graph. That’s why they >> are not connected with the “actual commits” like from some branch. >> >> The `--all` will include all refs, including Git notes like >> `refs/notes/commits`. >> >> This doesn’t look like a bug. > > Wow, I 100% agree with your conclusions, but it was unexpected even > to me that "git log --all" crawled anything outside branches, > remote-tracking branches, and tags. I can sort-of understand why > the "rev-list" command at the plumbing layer may want to include > everything under refs/ hierarchy, but it is unexpected for the > end-user facing "git log". Maybe `--all` was added before Git notes and that was the intent? Well, they would known that it would include whatever custom refs that people wanted. But then maybe they thought of it as: • branches, remote-tracking branches, tags (from git(1)) • (git-stash(1) is an old command; I think it might have been an oversight to include it with `--all`? (see end of this message)) • whatever custom refs the repo uses; these you should know (?) and shouldn’t get surprised by The custom refs would have been added by third-party programs, but someone would have thought that it was worth going through the effort of pushing out these refs to other people. Although, people could still be surprised by mere bookkeeping data showing up with `--all`.[1] *** Note for others: One doesn’t end up with Git notes added by git(1)[1] *by others* that easily. ;) Branches and tags can be pushed out easily, but you need an explicit refspec to push Git notes. And I don’t think git-notes(1) mentions this. I would venture to bet that most people who have learned to push out Git notes have learned it from StackOverflow or some other not-Git project site. And after someone has gone through the trouble of pushing them, other people also need to fetch them with an explicit refspec. † 1: By other programs is a different matter. Git notes are a great way to attach metadata to commits, so many third-party tools use that. And it might not matter to the end-user whether data about which commit messages have typos in them is stored in Git notes or in some Sqlite database, but `--all` will reveal that implementation detail if Notes are used. > > Not that we want to or we can change it this late in the game, > though. I wonder if "git log --all -p" also goes through the stash > refs as well as notes. It does show the commits from `refs/stash`.