font-v icon indicating copy to clipboard operation
font-v copied to clipboard

Worktree support

Open RickyDaMa opened this issue 1 year ago • 2 comments

Fixes #169

Adds git worktree support to font-v, as well as improving the robustness of .git/ folder detection

Old, out-dated description I'm not saying it's a good implementation, but it's something that works to start this conversation

Unhelpfully, the documentation link @madig recommended was just a page with headings and no actual docs for me to do this properly. I'd be all for using the library's support for this if I could actually see how to :/

RickyDaMa avatar Mar 20 '24 13:03 RickyDaMa

Okay, this implementation I'm actually happy with

I used the Wayback Machine & GitHub to get the actual documentation / source code for GitPython

I changed the test for "is .git a folder?" to use GitPython's provided is_git_dir() so that's more robust

I switched my manual reading/parsing of the .git file for worktrees with GitPython's find_worktree_git_dir (which has pretty similar logic to my original more naive implementation lol)

I also updated the test to use a fixture, as otherwise if get_git_root_path raised then the worktree wouldn't get cleaned up; now it does

As an aside, not sure if the pipeline failure is my fault and/or how to fix it

RickyDaMa avatar Mar 21 '24 16:03 RickyDaMa

Thank you very much Ricky. And thanks for the review Caleb. Let me fix the CI and I'll have a look at this PR this week. I really appreciate it!

chrissimpkins avatar Mar 26 '24 14:03 chrissimpkins