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^{barThe 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?