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

[gin]: Not a directory (os error 20): stat '{repo-name}/{worktree-name}/.git/MERGE_HEAD' with action: chaperon on a git-worktree #146

Closed
aiya000 opened this issue Sep 13, 2024 · 7 comments · Fixed by #147

Comments

@aiya000
Copy link

aiya000 commented Sep 13, 2024

Hi :D
I have an issue of SSIA.

I'm using git worktrees.
e.g.

$ git clone {repo-name}
$ cd {repo-name}
$ git worktree add develop develop
$ cd

In above worktee, when opening with GinStatus, and choise action: chaperon,
then the title issue is shown.

Will you help me? Thanks!

@aiya000 aiya000 changed the title [gin]: Not a directory (os error 20): stat '{repo-name}/{worktree-name}/.git/MERGE_HEAD' with action: chaperon on git-worktree [gin]: Not a directory (os error 20): stat '{repo-name}/{worktree-name}/.git/MERGE_HEAD' with action: chaperon on a git-worktree Sep 13, 2024
@lambdalisue
Copy link
Owner

lambdalisue commented Sep 14, 2024

Could you share me an example git repository that can reproduce this issue and exact steps to reproduce the situation? I seldom use git's worktree feature so there might be something I don't realize.

@aiya000
Copy link
Author

aiya000 commented Sep 17, 2024

This issue can reproduce from git init 🙋
Below is actual reproduction.


NOTE: These are my aliases :)

$ alias gaacm
gaacm='git add -A && git commit -m'

$ which gwab
gwab () {
        : Makes the new branch basing on a base branch.
        base_branch=$1
        new_branch=$2
        git worktree add -b "$new_branch" "${new_branch//\#/}" "$base_branch"
}

$ alias ..
..='cd ../'

The reproduction.

# Making repository
$ mkdir foo
$ cd foo
$ git init
$ touch a
$ gaacm a

# Making 'b' branch
$ gwab main b
$ cd b
$ echo b >> a
$ gaacm b

# Making 'c' branch
$ gwab main c
$ cd c
$ echo c >> a
$ gaacm c

# Making a conflict
$ ..
$ cd b
$ git merge c

# Final
$ vim
: GinStatus
(action: chaperon)
[gin]: Not a directory (os error 20): stat '/home/aiya000/.tmp/foo/b/.git/MERGE_HEAD'

@lambdalisue
Copy link
Owner

lambdalisue commented Sep 20, 2024

I'm sorry but could you rewrite it without your aliases so that I can test it in my environment?

@aiya000
Copy link
Author

aiya000 commented Sep 20, 2024

Alright :)

$ mkdir foo
$ cd foo
$ git init
$ touch a
$ git commit -m a

$ git worktree add -b b b main
$ cd b
$ echo b >> a
$ git commit -m b

$ git worktree add -b c c main
$ cd c
$ echo c >> a
$ git commit -m c

$ cd ..
$ cd b
$ git merge c

$ vim
:GinStatus
(action: chaperon)
[gin]: Not a directory (os error 20): stat '/home/aiya000/.tmp/foo/b/.git/MERGE_HEAD'

@lambdalisue
Copy link
Owner

Reproduced with a bit modified steps

$ mkdir foo
$ cd foo
$ git init
$ touch a
$ git add .
$ git commit -m a

$ git worktree add -b b b main
$ cd b
$ echo b >> a
$ git add .
$ git commit -m b

$ git worktree add -b c c main
$ cd c
$ echo c >> a
$ git add .
$ git commit -m c

$ cd ../
$ cd b
$ git merge c

$ vim
:GinStatus
(action: chaperon)
[gin]: Not a directory (os error 20): stat '/home/aiya000/.tmp/foo/b/.git/MERGE_HEAD'

@lambdalisue
Copy link
Owner

@aiya000 Please test #147

@aiya000
Copy link
Author

aiya000 commented Sep 24, 2024

@lambdalisue
It seems working correctly!
Thanks!

image

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.

2 participants