Re: [PATCH] New test for preserve merges and squash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jörg Sommer <joerg@xxxxxxxxxxxx> writes:

> Signed-off-by: Jörg Sommer <joerg@xxxxxxxxxxxx>
> ---
>  t/t3404-rebase-interactive.sh |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
>
> The current version of git fails this test. I think it's a bug, because
> the patch is what I expect to happen. Or am I wrong?

Please mark such tests with test_expect_fail.

And also Cc: the guilty parties.

	$ git-blame master -- git-rebase--interactive.sh
        $ git shortlog -n -s master -- git-rebase--interactive.sh

would tell you who they are ;-).

> +test_expect_success 'squash and preserve merges' '
> +	test_tick &&
> +	git checkout -b squash-and-preserve-merges master &&
> +	echo A > file1 &&
> +	git commit -m SaPM-1 file1 &&
> +	echo B > file1 &&
> +	git commit -m SaPM-2 file1 &&
> +	git merge to-be-preserved &&
> +	echo C > file1 &&
> +	git commit -m SaPM-3 file1 &&
> +
> +        EXPECT_COUNT=4 FAKE_LINES="1 2 squash 4 3" \
> +          git rebase -i -p --onto branch1 master &&
> +	test $(git rev-parse HEAD^2) = $(git rev-parse to-be-preserved) &&
> +	test $(git rev-parse HEAD~3) = $(git rev-parse branch1) &&
> +	test $(git show HEAD:file1) = C &&
> +	test $(git show HEAD~2:file1) = A
> +'

Please split such a test into two parts, a part that sets things up (which
would succeed), and the part that runs the command it tries to test
("rebase -i" followed by the validation of the result, which you are
expecting to fail).  That way, somebody who is trying to fix the breakage
can stop the test script by inserting "exit" between the two, run the
rebase command by hand to see what is going on, etc. to diagnose the
issue.
--
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux