Re: [PATCH v5 2/4] format-patch: add '--base' option to record base tree info

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

 



Xiaolong Ye <xiaolong.ye@xxxxxxxxx> writes:

> +test_expect_success 'format-patch --base' '
> +	git checkout side &&
> +	git format-patch --stdout --base=HEAD~~~ -1 >patch &&
> +	grep -e "^base-commit:" -A3 patch >actual &&

The -A3 is GNUism.  To do this portably, perhaps you can do

	sed -n -e "/^base-commit:/,+3p"

or something like that.

But more importantly, grabbing 3 lines (and always 3 lines) will not
catch a future bug that somebody else may introduce to this code
that shows extra "prerequisite-patch-id:" after them.

> +	echo "base-commit: $(git rev-parse HEAD~~~)" >expected &&
> +	echo "prerequisite-patch-id: $(git show --patch HEAD~~ | git patch-id --stable | awk "{print \$1}")" >>expected &&
> +	echo "prerequisite-patch-id: $(git show --patch HEAD~ | git patch-id --stable | awk "{print \$1}")" >>expected &&
> +	test_cmp expected actual
> +'
--
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]