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

Unsupported extension name #205

Open
petrisch opened this issue Jul 28, 2022 · 17 comments
Open

Unsupported extension name #205

petrisch opened this issue Jul 28, 2022 · 17 comments
Milestone

Comments

@petrisch
Copy link

Hi

I'm running into this on 4.0.1 with git version 2.37.0.windows.1.
The stuff befor this looks good, and I can't figure out, which repo issues this,
and if its related to #202

...
[2022-07-28T12:22:46Z DEBUG gfold::report] finalized report collection for repository at path: "\\\\?\\C:\\Users\\**
Error: unsupported extension name extensions.worktreeconfig; class=Repository (6)
   0: <unknown>
   1: git_trace_set
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: git_trace_set
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: BaseThreadInitThunk
  12: RtlUserThreadStart
@nickgerace
Copy link
Owner

Thanks for the report! This looks like a valid bug. I'll take a look when I get the chance.

@petrisch
Copy link
Author

After investing 5min on this, I can only confirm, that the same repo filestructure gives no errors and works on v 1.0.4.
This is going back quite a bit, so I don't know if its of any help. I haven't tested any inbetween, maybe next time, or if you could give me a hint?

@nickgerace
Copy link
Owner

That does help and I am low on free time. I'm taking a look at 1.0.4. Thanks for the follow up!

@nickgerace
Copy link
Owner

nickgerace commented Aug 30, 2022

Usually, I find the most bugs in the "is unpushed" logic. I looked here to start:

gfold/gfold/src/util.rs

Lines 147 to 181 in 9854433

fn is_unpushed(repo: &git2::Repository, head: &git2::Reference) -> bool {
let local = match head.peel_to_commit() {
Ok(local) => local,
Err(e) => {
debug!("[-] error: {}", e);
return false;
}
};
debug!("[+] local commit: {:#?}", local.id());
if let Some(name) = head.name() {
debug!("[+] local ref: {}", name);
}
let upstream = match repo.resolve_reference_from_short_name("origin") {
Ok(reference) => {
if let Some(name) = reference.name() {
debug!("[+] origin ref: {}", name);
}
match reference.peel_to_commit() {
Ok(upstream) => upstream,
Err(e) => {
debug!("[-] error: {}", e);
return false;
}
}
}
Err(e) => {
debug!("[-] error: {}", e);
return false;
}
};
debug!("[+] origin commit: {:#?}", upstream.id());
matches!(repo.graph_ahead_behind(local.id(), upstream.id()), Ok(ahead) if ahead.0 > 0)
}

Another place that could be a problem: path canonicalization. I may be pushing a path and then canonicalizing it rather than canonicalizing the initial path.

What's your command invocation look like? I think I see a wild card (*) in your args. I don't believe you need that, but, I should add it to the integration test regardless.

@petrisch
Copy link
Author

petrisch commented Aug 31, 2022

Hm, funny now that you mention it.
I actually did it on C:\Users\username\repo.
And the command used is simply: gfold .

I like the --classic option, but the result was the same.
No defence about time necessary btw. I'd love to investigate it myself and understand this pretty well.
Just love the tool!

@petrisch
Copy link
Author

Many thanks for the new version!! 🥳
This one is still a thing, thou thats probably no surprise for you 😄

@nickgerace
Copy link
Owner

nickgerace commented Oct 21, 2022

Yep! I am aware :) Thanks for the reminder @petrisch.

I touched up the integration test code. If it can be reproduced in there, then that would help greatly in fixing the issue. Something I plan to do once I find a larger amount of free coding time.

@petrisch
Copy link
Author

Just to show still my interest in this, thoug no way I could help further:
With 4.1.1 the Error message changed, which might help as well. Haven't done a BACKTRACE though.

Error: no reference found for shorthand 'origin/HEAD'; class=Reference (4); code=NotFound (-3)

@nickgerace
Copy link
Owner

Thanks for that! Wondering if we can catch it alongside fixing #202...

@nickgerace
Copy link
Owner

nickgerace commented Dec 20, 2022

I believe #202 was fixed in release 4.1.2. Perhaps, we'll see new behavior relevant to this issue in the new release.

@petrisch
Copy link
Author

Hm, unfortunately we are back at this with 4.1.2:
Error: unsupported extension name extensions.worktreeconfig; class=Repository (6)

@nickgerace
Copy link
Owner

nickgerace commented Dec 21, 2022

Looking into seeing how we can avoid it... This seems to be an upstream issue: libgit2/libgit2#6044

@nickgerace
Copy link
Owner

Okay this is where it is failing. I'm going to investigate.

@nickgerace nickgerace added the Dependent on upstream fix an issue that's dependent on fix(es) to an upstream issue(s) label Dec 21, 2022
@nickgerace nickgerace pinned this issue Dec 21, 2022
@nickgerace
Copy link
Owner

nickgerace commented Dec 21, 2022

Alright, I've pinned this issue and marked it as upstream dependent for now. PR #220 should provide a workaround for the time being.

Reproduction Steps

Tested on macOS Ventura 13.1 with git 2.38.1 and gfold 4.1.2. The OS and binaries are native arm64.

REPRODUCTION_DIR=$(mktemp -d)
cd $REPRODUCTION_DIR
git clone --filter=blob:none https://github.com/nickgerace/gfold.git bug
cd bug
git worktree add ../worktree
cd ../worktree
git config extensions.worktreeConfig true
gfold ..

Workaround

  • Bad news: I believe affected repositories will need to be skipped for the time being
  • Good news: I believe the workaround will prevent gfold from stopping execution

EDIT: the workaround should be available in gfold 4.2.0.

@petrisch
Copy link
Author

petrisch commented Feb 6, 2023

@nickgerace looks like I have never commented on 4.2.0.
I can confirm that it works for me again now 👍
And then there is the next version, will have to check that out first maybe ;-)..... and it does 💯

@nickgerace
Copy link
Owner

Glad to hear! Will keep an eye here: #205 (comment)

@nickgerace
Copy link
Owner

Looks like this was fixed a few months ago. Going to re-investigate.

@nickgerace nickgerace removed the Dependent on upstream fix an issue that's dependent on fix(es) to an upstream issue(s) label Jul 3, 2024
@nickgerace nickgerace added this to the 4.5.1 milestone Jul 3, 2024
@nickgerace nickgerace unpinned this issue Dec 10, 2024
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

No branches or pull requests

2 participants