Skip to content

Unsupported extension name extensions.worktreeconfig #278

Open

Description

@auscompgeek

Description of the bug

Running git sparse-checkout set will cause all git-branchless commands to fail with Git error GenericError: unsupported extension name extensions.worktreeconfig in that repo.

cd /tmp
git init test
cd test
git commit --allow-empty -m 'Initial commit'
git sparse-checkout set
git branchless smartlog

Expected behavior

The smart log should show successfully, e.g.

◆ b1350a3f 12s (master) Initial commit

Actual behavior

The application panicked (crashed).
Message:  A fatal error occurred:
   0: Git error GenericError: unsupported extension name extensions.worktreeconfig

Location:
   src/git/repo.rs:45

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: branchless::git::repo::from_dir with path="/private/tmp/test"
      at src/git/repo.rs:193
   1: branchless::commands::smartlog::smartlog with effects=<Output fancy=true> git_run_info=<GitRunInfo path_to_git="git" working_directory="/private/tmp/test" env=not shown> options=SmartlogOptions { show_hidden_commits: false }
      at src/commands/smartlog.rs:526

Version of git-branchless

git-branchless 0.3.9

Version of git

git version 2.35.1

Version of rustc

No response

Activity

  1. auscompgeek commented on Feb 21, 2022

    @auscompgeek
    ContributorAuthor

    I presume this is related to git config extensions.worktreeConfig but I had trouble simplifying the STR further. Notably from those docs:

    Older Git versions will refuse to access repositories with this extension.

    I'm guessing libgit2 doesn't handle this extension?

  2. martinvonz commented on Feb 21, 2022

    @martinvonz
    Collaborator

    I'm guessing libgit2 doesn't handle this extension?

    Yes, I think this is libgit2/libgit2#6044. I suspect the fix is pretty simple, as someone there commented.

  3. changed the title [-]`git sparse-checkout set` breaks git-branchless[/-] [+]Unsupported extension name extensions.worktreeconfig[/+] on Feb 21, 2022
  4. arxanas commented on Feb 21, 2022

    @arxanas
    Owner

    Thanks for reporting. git-branchless should work fine with sparse checkouts (I use them at work), so most likely the only issue is with the extension.worktreeConfig setting. (If not, please update repro steps.) I'm guessing that we would need to make an upstream libgit2 change and percolate it down to git2 and then git-branchless.

    The obvious workaround would be to disable extension.worktreeConfig, if that's possible for you. Unless this comes up at work, I don't have any plans to work on the upstream change, but if it ends up being done, I can fork the necessary crates and pull them into git-branchless before they're officially released.

  5. arxanas commented on Sep 14, 2022

    @arxanas
    Owner

    I was able to reproduce this in Git v2.35.0. However, it looks like this behavior, at least for the repro case, stops happening in Git v2.36.0 thanks to this commit: git/git@7316dc5. If upgrading Git is an option for you, you should try it to see if it solves your problem.

  6. auscompgeek commented on Sep 14, 2022

    @auscompgeek
    ContributorAuthor

    Ah interesting. Unfortunately the repo I work on already has core.repositoryformatversion set to 1, and I presume downgrading that is unsafe. (I don't want to clone this repo again.)

  7. arxanas commented on Sep 14, 2022

    @arxanas
    Owner

    @auscompgeek you can also consider doing a shallow clone of the repo locally to get a "fresh" copy while hopefully not taking too long.

  8. added
    no-planned-fixI don't plan to work on this. Feel free to ask if there's an update, or try fixing it yourself.
    on Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingno-planned-fixI don't plan to work on this. Feel free to ask if there's an update, or try fixing it yourself.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions