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 6, 2015, 10:20 UTC
Message-ID
<xmqq8uhgqkge.fsf@gitster.dls.corp.google.com>
In-Reply-To
<e514c72c481c66f9808f1dd09117a16@74d39fa044aa309eaea14b9f57fe79c>
"Kyle J. McKay" <mackyle@gmail.com> writes:
Show 16 quoted lines
> Now, however, since refs/heads/master exists and the new,
> more relaxed notes refs rules leave it unchanged, the merge
> succeeds. ...
> ...
> diff --git a/t/t3308-notes-merge.sh b/t/t3308-notes-merge.sh
> index 24d82b49..f0feb64b 100755
> --- a/t/t3308-notes-merge.sh
> +++ b/t/t3308-notes-merge.sh
> @@ -90,7 +90,6 @@ test_expect_success 'fail to merge various non-note-trees' '
>  	test_must_fail git notes merge refs/notes/ &&
>  	test_must_fail git notes merge refs/notes/dir &&
>  	test_must_fail git notes merge refs/notes/dir/ &&
> -	test_must_fail git notes merge refs/heads/master &&
>  	test_must_fail git notes merge x: &&
>  	test_must_fail git notes merge x:foo &&
>  	test_must_fail git notes merge foo^{bar

The test title reads "fail to merge non-note trees", and I am assuming that the tree-ish refs/heads/master (aka 'master' branch) represents does not look anything like a typical note tree where pathnames are 40-hex with fan-out.

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.

Arguably, not being able to save notes tree anywhere outside of refs/notes/ hierarchy may be too high a price to pay in order to prevent refs/heads/master from being considered (hence to avoid such end-user mistakes), but at the same time, losing this safetly may also be too high a price to pay in order to allow people to store their notes in somewhere outside e.g. refs/remote-notes/origin/foo. "Somewhere outside" does not mean "Including other hierarchies like refs/heads and refs/tags that have long established meaning".

Although I am not fundamentally against allowing to store notes outside refs/notes/, it is different from "anywhere is fine". Can't we do this widening in a less damaging way?

Previous: Kyle J. McKayNext: Kyle J. McKay
Message 4 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.