"GOT", but the "O" is a cute, smiling sun Index | Thread

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Sort options
To:
gameoftrees@openbsd.org
Date:
Tue, 25 Oct 2022 09:11:20 +0200

Download raw body.

On Mon, Oct 24, 2022 at 01:56:07PM -0400, Josiah Frentsos wrote:
> diff 7b09cbf48c1c29492011bc248ecfc91a9b657829 d2258f100ceff2fbb631455086e8e1864ba49e0d
> commit - 7b09cbf48c1c29492011bc248ecfc91a9b657829
> commit + d2258f100ceff2fbb631455086e8e1864ba49e0d
> blob - 49dd805c03a534e38d4a01d90a18f868676a58b6
> blob + b7d27d4a96c9c37ed708dbf7ffc94d5031c51eec
> --- got/got.c
> +++ got/got.c

This patch is fine overall, but there is a small mistake here:

> @@ -8219,14 +8219,14 @@ cmd_revert(int argc, char *argv[])
>  
>  	TAILQ_INIT(&paths);
>  
> -	while ((ch = getopt(argc, argv, "pF:R")) != -1) {
> +	while ((ch = getopt(argc, argv, "Fp:R")) != -1) {
>  		switch (ch) {
> -		case 'p':
> -			pflag = 1;
> -			break;
>  		case 'F':
>  			patch_script_path = optarg;
>  			break;
> +		case 'p':
> +			pflag = 1;
> +			break;
>  		case 'R':
>  			can_recurse = 1;
>  			break;

Which was caught by the tests:

==== revert ====
./revert.sh -q -r "/tmp"
got: /tmp/got-test-revert_patch-LdlSJ8gH/patchscript: bad path
got revert command failed unexpectedly
test failed; leaving test data in /tmp/got-test-revert_patch-LdlSJ8gH
got: /tmp/got-test-revert_patch_added-tAZvGRqW/patchscript: bad path
--- /tmp/got-test-revert_patch_added-tAZvGRqW/stdout.expected   Tue Oct 25 09:04:38 2022
+++ /tmp/got-test-revert_patch_added-tAZvGRqW/stdout    Tue Oct 25 09:04:38 2022
@@ -1,2 +0,0 @@
-A  epsilon/new
-revert this addition? [y/n] n
test failed; leaving test data in /tmp/got-test-revert_patch_added-tAZvGRqW
got: /tmp/got-test-revert_patch_removed-L6SUPaCv/patchscript: bad path
--- /tmp/got-test-revert_patch_removed-L6SUPaCv/stdout.expected Tue Oct 25 09:04:38 2022
+++ /tmp/got-test-revert_patch_removed-L6SUPaCv/stdout  Tue Oct 25 09:04:38 2022
@@ -1,2 +0,0 @@
-D  beta
-revert this deletion? [y/n] n
test failed; leaving test data in /tmp/got-test-revert_patch_removed-L6SUPaCv
got: /tmp/got-test-revert_patch_one_change-QMfVk1wi/patchscript: bad path
got revert command failed unexpectedly
test failed; leaving test data in /tmp/got-test-revert_patch_one_change-QMfVk1wi
got: /tmp/got-test-revert_patch_symlink-Pq1OpGvK/patchscript: bad path
got revert command failed unexpectedly
test failed; leaving test data in /tmp/got-test-revert_patch_symlink-Pq1OpGvK
*** Error 1 in regress/cmdline (Makefile:46 'revert')
FAILED