Junio C Hamano schrieb: > Johannes Sixt <j.sixt@xxxxxxxxxxxxx> writes: > >>> +test_expect_success 'reject --only during a merge' ' >>> + git checkout HEAD^0 && >>> + git reset --hard the-other-side-says-nitfol && >>> + test_must_fail git merge one-side-says-frotz && >>> + echo yomin-only >file && >>> + test_must_fail git commit -m merge --only file && >> I don't see why this must fail: 'file' is the only file that is different >> from HEAD. Yes, currently we fail; but if something is about to be >> changed, then this can change as well. > > Not at all. Read again what I said: 'file' is the *ONLY* file that is different from HEAD. Why should an explicit --only not work in this case? > Avoiding --only is to prevent a much more dangerous glitch. [...] We are in total agreement about what you said in the rest of the message. I'm proposing that, during a merge, if --only was given (or remains the implicit choice), then we compare the index with HEAD, and if nothing outside the given pathspec differs from HEAD, then allow the commit. -- Hannes -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html