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

Re: [PATCH] notes: allow merging from arbitrary references

From
Jacob Keller <jacob.keller@gmail.com>
Date
Nov 16, 2015, 19:41 UTC
Message-ID
<CA+P7+xqGwb6yejh+HZMt8cwx=4arR6+YKCNVdftuQe5SBY_X9w@mail.gmail.com>
In-Reply-To
<CALKQrgdDH2WZc-xi3ROLUBxdk=yVqfFGN3jN1GjQq4qJj_K+-A@mail.gmail.com>
On Sun, Nov 15, 2015 at 11:55 PM, Johan Herland <johan@herland.net> wrote:
Show 7 quoted lines
> Additionally, if we suspect that passing non-notes trees to read-only
> operations will be a common error, we could add a simple heuristic to
> the notes code, to warn (or even abort) if we strongly suspect that we
> are reading in a non-notes tree. For example, if the ratio of
> non-notes to notes entries goes above, say, 1:1 (or even 10:1), then
> what we're reading is probably not a proper notes tree...
>

I agree here for this part, a possible heuristic check would maybe be valuable.. but not sure it's super worth the effort. I doubt it would be a common error, and I don't think the issues above would actually cause too many problems.

The main other issue is how to get notes DWIM things to work for all cases where we want to use notes refs, since right now the DWIM is basically done at the top level and only handles notes like things. The problem with it is that if you specify a full ref that *isn't* refs/notes, you will always prefix it with refs/notes, like so:

refs/remote-notes/origin => refs/notes/refs/remote-notes/origin,

This makes it really difficult to expand a ref. However, Julio seemed to think this was a possibly valuable expansion under normal circumstances. The current solution is to try to do a normal lookup first and only use the notes DWIM after we fail a lookup, which I think is what the above patch attempts to do. This seems ok enough to me.

Regards, Jake

>
> ...Johan
>
Previous: Johan HerlandNext: Johan Herland
Message 5 of 12 in “notes: allow merging from arbitrary references”
  1. notes: allow merging from arbitrary referencesJacob Keller, Nov 13, 2015
  2. Johan HerlandNov 15, 2015
  3. Jacob KellerNov 15, 2015
  4. Johan HerlandNov 16, 2015
  5. Jacob KellerNov 16, 2015
  6. Johan HerlandNov 18, 2015
  7. Jacob KellerNov 18, 2015
  8. Jeff KingNov 24, 2015
  9. Jeff KingNov 24, 2015
  10. Jacob KellerNov 26, 2015
  11. Junio C HamanoDec 11, 2015
  12. Jacob KellerDec 11, 2015

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.