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

Re: [PATCH 1/3] Add "partial commit" tests during a conflicted merge

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jan 23, 2009, 07:09 UTC
Message-ID
<49796D0C.5070408@viscovery.net>
In-Reply-To
<7vbpty4kby.fsf_-_@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 22 quoted lines
> +test_expect_success 'setup merge commit with paths test' '
> +	git reset --hard &&
> +	git checkout HEAD^0 &&
> +	echo frotz >file &&
> +	test_tick &&
> +	git add file &&
> +	git commit -a -m "one side says frotz" &&
> +	git tag one-side-says-frotz &&
> +	git reset --hard HEAD^ &&
> +	echo nitfol >file &&
> +	test_tick &&
> +	git add file &&
> +	git commit -a -m "the other side says nitfol" &&
> +	git tag the-other-side-says-nitfol
> +'
> +
> +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.

Show 21 quoted lines
> +	git reset --hard
> +'
> +
> +test_expect_success 'allow --include 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-include >file &&
> +	git commit -m merge --include file &&
> +	git reset --hard
> +'
> +
> +test_expect_failure 'assume --include 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-assumed >file &&
> +	git add file &&
> +	git commit -m merge file &&
> +	git reset --hard
> +'

If I read the test case correctly, there is only 'file' that is different from HEAD, and it had a conflict. But IMO, the test should stress the point that after the conflicted merge there are at least two files that are different from HEAD, one was trivially merged, and the other had a conflict.

-- Hannes
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 17 in “Short "git commit $file" syntax fails in the face of a resolved conflict”
  1. Asheesh LaroiaJan 21, 2009
  2. Michael J GruberJan 21, 2009
  3. Nathan YerglerJan 21, 2009
  4. Johannes SixtJan 22, 2009
  5. Nanako ShiraishiJan 23, 2009
  6. Asheesh LaroiaJan 23, 2009
  7. Junio C HamanoJan 23, 2009
  8. 1/3 Add "partial commit" tests during a conflicted mergeJunio C Hamano, Jan 23, 2009
  9. Johannes SixtJan 23, 2009
  10. Junio C HamanoJan 23, 2009
  11. Johannes SixtJan 23, 2009
  12. Junio C HamanoJan 23, 2009
  13. 2/3 builtin-commit: shorten eye-sore overlong linesJunio C Hamano, Jan 23, 2009
  14. 3/3 git commit: pathspec without -i/-o implies -i semantics during a mergeJunio C Hamano, Jan 23, 2009
  15. Pieter de BieJan 23, 2009
  16. Junio C HamanoJan 23, 2009
  17. Michael J GruberJan 22, 2009

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.