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

Re: [PATCH v2 2/2] t/t3308-notes-merge.sh: succeed with relaxed notes refs

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 7, 2015, 16:03 UTC
Message-ID
<xmqqiogilgr5.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150107011958.GA3536@peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> On Tue, Jan 06, 2015 at 02:20:33AM -0800, Junio C Hamano wrote:
>
>> The fact that "git notes merge refs/heads/master" fails is a very
>> good prevention of end-user mistakes, and this removal of test
>> demonstrates that we are dropping a valuable safety.
>
> Is it really that valuable? If it were:
>
>   git notes merge master
>
> I could see somebody running that accidentally.
> ...
> But we are talking about
> somebody who is already fully-qualifying a ref (and anything unqualified
> continues to get looked up under refs/notes).

That (specifically 'merge') is not my real worry. It's the other way around, actually.

Because expand_notes_ref() makes sure that any given notes ref is prefixed appropriately to start with refs/notes/,

    git notes --ref=refs/heads/master add ...blah...
    git notes --ref=refs/tag/v1.0 add ...blah...

would be a sensible way when somebody wants to keep a forest of notes refs, one per real ref. Wouldn't they have already been trained to spell "refs/heads/master" when they want to refer to refs/notes/refs/heads/master because of this?

Previous: Jeff KingNext: Jeff King
Message 15 of 16 in “Accept any notes ref”
  1. 0/2 Accept any notes refKyle J. McKay, Jan 6, 2015
  2. 1/2 notes: accept any refKyle J. McKay, Jan 6, 2015
  3. 2/2 t/t3308-notes-merge.sh: succeed with relaxed notes refsKyle J. McKay, Jan 6, 2015
  4. Junio C HamanoJan 6, 2015
  5. Kyle J. McKayJan 6, 2015
  6. Junio C HamanoJan 6, 2015
  7. Kyle J. McKayJan 6, 2015
  8. Junio C HamanoJan 6, 2015
  9. Kyle J. McKayJan 7, 2015
  10. Johan HerlandJan 7, 2015
  11. Kyle J. McKayJan 7, 2015
  12. Junio C HamanoJan 7, 2015
  13. Johan HerlandJan 7, 2015
  14. Jeff KingJan 7, 2015
  15. Junio C HamanoJan 7, 2015
  16. Jeff KingJan 8, 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.