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

Re: [PATCH v4 3/4] git-cherry-pick: Add test to validate new options

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 11, 2012, 21:06 UTC
Message-ID
<7vwr5mhtb9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1334175716-11391-4-git-send-email-nhorman@tuxdriver.com>
Neil Horman <nhorman@tuxdriver.com> writes:
> Since we've added the --allow-empty and --keep-redundant-commits
> options to git cherry-pick we should also add a test to ensure that its working
> properly
Missing full-stop at the end of the sentence
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Show 9 quoted lines
> +test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
> +	git checkout master &&
> +	echo fourth >> file2 &&
> +	git add file2 &&
> +	git commit -m "fourth" && {
> +		git cherry-pick empty-branch2
> +		test "$?" = 1 
> +	}
> +'
Do we _deeply_ care that it fails with status 1, or should this be test_must_fail?
Show 6 quoted lines
> +test_expect_success 'cherry pick an empty non-ff commit with --allow-empty' '
> +	git checkout master && {
> +		git cherry-pick --allow-empty empty-branch2
> +		test "$?" = 0
> +	}
> +'
Lose the 'test "$?" = 0' here.
> +test_expect_success 'cherry pick with --keep-redundant-commits' '
> +	git checkout master && {
> +		git cherry-pick --keep-redundant-commits HEAD^
> +		test "$?" = 0
Likewise.
> +	}
> +'
> +
>  test_done
Thanks.
Previous: Neil HormanNext: Neil Horman
Message 11 of 16 in “Enhance git-rebases flexibiilty in handling empty commits”
  1. 0/4 Enhance git-rebases flexibiilty in handling empty commitsNeil Horman, Apr 11, 2012
  2. 1/4 git-cherry-pick: add allow-empty optionNeil Horman, Apr 11, 2012
  3. 2/4 git-cherry-pick: Add keep-redundant-commits optionNeil Horman, Apr 11, 2012
  4. Junio C HamanoApr 11, 2012
  5. Neil HormanApr 11, 2012
  6. Junio C HamanoApr 11, 2012
  7. Neil HormanApr 11, 2012
  8. Junio C HamanoApr 12, 2012
  9. Neil HormanApr 12, 2012
  10. 3/4 git-cherry-pick: Add test to validate new optionsNeil Horman, Apr 11, 2012
  11. Junio C HamanoApr 11, 2012
  12. 4/4 git-rebase: add keep_empty flagNeil Horman, Apr 11, 2012
  13. Junio C HamanoApr 11, 2012
  14. Neil HormanApr 11, 2012
  15. Junio C HamanoApr 12, 2012
  16. Neil HormanApr 12, 2012

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.