[GH-ISSUE #285] Stats head in worktree doesn't pull from the right commit #103

Open
opened 2026-03-02 04:11:50 +03:00 by kerem · 2 comments
Owner

Originally created by @svarlamov on GitHub (Dec 11, 2025).
Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/285

➜  git-ai-post-commit-subdir git:(fix/post-commit-subdir) git-ai stats head                                    
[git-ai] Stats command found commit: 6e19780339cedaa1fd79aadee0be132be7b825cf refname: head
you  ████████████████████████████████████████ ai
     100%                                   0%
➜  git-ai-post-commit-subdir git:(fix/post-commit-subdir) git-ai stats 5e7f56d90a4698fde038f2e78e7a240fa52f2bd1    
[git-ai] Stats command found commit: 5e7f56d90a4698fde038f2e78e7a240fa52f2bd1 refname: 5e7f56d90a4698fde038f2e78e7a240fa52f2bd1
you  ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ai
     7%             mixed   2%             90%
     97% AI code accepted | waited 2s for ai
➜  git-ai-post-commit-subdir git:(fix/post-commit-subdir) git log | head -1                                    
commit 5e7f56d90a4698fde038f2e78e7a240fa52f2bd1
➜  git-ai-post-commit-subdir git:(fix/post-commit-subdir) 

It appears to pull HEAD from the main repo instead of the current worktree. The 6e19... commit is from my main repo, while the worktree head is at 5e7f...

Originally created by @svarlamov on GitHub (Dec 11, 2025). Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/285 ``` ➜ git-ai-post-commit-subdir git:(fix/post-commit-subdir) git-ai stats head [git-ai] Stats command found commit: 6e19780339cedaa1fd79aadee0be132be7b825cf refname: head you ████████████████████████████████████████ ai 100% 0% ➜ git-ai-post-commit-subdir git:(fix/post-commit-subdir) git-ai stats 5e7f56d90a4698fde038f2e78e7a240fa52f2bd1 [git-ai] Stats command found commit: 5e7f56d90a4698fde038f2e78e7a240fa52f2bd1 refname: 5e7f56d90a4698fde038f2e78e7a240fa52f2bd1 you ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ai 7% mixed 2% 90% 97% AI code accepted | waited 2s for ai ➜ git-ai-post-commit-subdir git:(fix/post-commit-subdir) git log | head -1 commit 5e7f56d90a4698fde038f2e78e7a240fa52f2bd1 ➜ git-ai-post-commit-subdir git:(fix/post-commit-subdir) ``` It appears to pull `HEAD` from the main repo instead of the current worktree. The `6e19...` commit is from my main repo, while the worktree head is at `5e7f...`
Author
Owner

@svarlamov commented on GitHub (Dec 12, 2025):

Probable related #287

<!-- gh-comment-id:3647923236 --> @svarlamov commented on GitHub (Dec 12, 2025): Probable related #287
Author
Owner

@acunniffe commented on GitHub (Jan 2, 2026):

We fixed this at that hackathon right?

<!-- gh-comment-id:3705365221 --> @acunniffe commented on GitHub (Jan 2, 2026): We fixed this at that hackathon right?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#103
No description provided.