"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: got/cvg info: print work tree version
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 14 Aug 2024 14:51:44 +0200

Download raw body.

Thread
On 2024/08/14 14:43:23 +0200, Stefan Sperling <stsp@stsp.name> wrote:
> On Tue, Aug 13, 2024 at 08:27:14PM +0200, Stefan Sperling wrote:
> > While we're at it we could also print the work tree format version,
> > stored in .got/format. So I was thinking we would provide a function
> > which returns two output arguments, the work tree format version and
> > the file index version.
> > 
> > That said, your patch is fine, too. The easiest way to extend the
> > approach you took would be another got_worktree_format_version()
> > function which returns the number stored in .got/format.`
> 
> The patch for this is straightforward. ok?

you beat me to it :P

ok op@

just a tiny question below:

> [...]
> --- lib/worktree_open.c
> +++ lib/worktree_open.c
> @@ -160,7 +160,7 @@ open_worktree(struct got_worktree **worktree, const ch
>  		    "could not parse work tree format version number");
>  		goto done;
>  	}
> -	if (version != GOT_WORKTREE_FORMAT_VERSION) {
> +	if (version > GOT_WORKTREE_FORMAT_VERSION) {
>  		err = got_error(GOT_ERR_WORKTREE_VERS);
>  		goto done;
>  	}

why changing this now?  we only have one version so far for the
worktree, and we don't know what a v2 will be like (if we'll ever have
to do it.)  maybe the files will have a different layout.

So, not really against it, but it seems a little strange to me to change
this while adding the getter for the version.