Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support extensions.worktreeconfig for repositoryformatversion=1 #6044

Closed
Whirlwind opened this issue Sep 10, 2021 · 4 comments
Closed

Comments

@Whirlwind
Copy link

$ git clone --filter=blob:none git@xxx:xx/xx.git
$ cd xx
$ git worktree add ../worktree
$ cd ../worktree
$ git config extensions.worktreeConfig true

I have a origin repository with --filter=blob:none, and a worktree repository. Then I enable the worktree config in the worktree.

In the libgit2, it could not support the worktree config with filter:

unsupported extension name extensions.worktreeconfig

I check the libgit2:

static int check_valid_extension(const git_config_entry *entry, void *payload)
{
	GIT_UNUSED(payload);

	if (!strcmp(entry->name, "extensions.noop"))
		return 0;

	git_error_set(GIT_ERROR_REPOSITORY, "unsupported extension name %s", entry->name);
	return -1;
}

static int check_extensions(git_config *config, int version)
{
	if (version < 1)
		return 0;

	return git_config_foreach_match(config, "^extensions\\.", check_valid_extension, NULL);
}

And I check the version: repositoryformatversion = 1, So all extension configs will failed.

@vermiculus
Copy link
Contributor

vermiculus commented Feb 6, 2022

Is there a to-do list or anything of the sort for this? Or is this as simple as updating git_config_level_t to insert some GIT_CONFIG_LEVEL_WORKTREE and updating users of that type?

I'm also assuming the new value will need to be ordered between _LOCAL and _APP, which could potentially introduce issues (but would maintain the likely expectation that 'values closer to zero' => 'more general').

@frankcbliu
Copy link

the same problem, is there any support plan for this?

@vermiculus
Copy link
Contributor

@frankcbliu I've got a PR in progress mentioned above, though it's having some as-yet-unknown test failures on some platforms. Any help for this would be welcomed.

nickgerace added a commit to nickgerace/gfold that referenced this issue Dec 21, 2022
Ignore "extensions.worktreeconfig" error until the upstream issue is
resolved and git2-rs receives the fix.

Issue: libgit2/libgit2#6044

Signed-off-by: Nick Gerace <nickagerace@gmail.com>
nickgerace added a commit to nickgerace/gfold that referenced this issue Dec 21, 2022
- Ignore "extensions.worktreeconfig" error until the upstream issue is
  resolved and git2-rs receives the fix.
  - Issue: libgit2/libgit2#6044
- Split crate imports from external ones in gfold crate

Signed-off-by: Nick Gerace <nickagerace@gmail.com>
nickgerace added a commit to nickgerace/gfold that referenced this issue Dec 21, 2022
- Ignore "extensions.worktreeconfig" error until the upstream issue is
  resolved and git2-rs receives the fix.
  - Issue: libgit2/libgit2#6044
- Add unknown status with red color
- Change unpushed status to use blue color
- Split crate imports from external ones in gfold crate

Signed-off-by: Nick Gerace <nickagerace@gmail.com>
nickgerace added a commit to nickgerace/gfold that referenced this issue Dec 21, 2022
- Ignore "extensions.worktreeconfig" error until the upstream issue is
  resolved and git2-rs receives the fix.
  - Issue: libgit2/libgit2#6044
- Add unknown status with red color
- Change unpushed status to use blue color
- Split crate imports from external ones in gfold crate

Signed-off-by: Nick Gerace <nickagerace@gmail.com>
JohnFredok added a commit to JohnFredok/gfold that referenced this issue Oct 24, 2023
- Ignore "extensions.worktreeconfig" error until the upstream issue is
  resolved and git2-rs receives the fix.
  - Issue: libgit2/libgit2#6044
- Add unknown status with red color
- Change unpushed status to use blue color
- Split crate imports from external ones in gfold crate

Signed-off-by: Nick Gerace <nickagerace@gmail.com>
@ethomson
Copy link
Member

ethomson commented Apr 2, 2024

Fixed via #6756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants