altsem / altsem/gitu

8 second hang running gitu - can't find .git/MERGE_HEAD

Open
#271 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.9k
Forks
164
PR merge metrics
No merged PRs in 30d

Description

Hey I ADORE this tool and use it countless times throughout my day

I'm sure there's an easy fix for this issue on my end but figured it was worth flagging here in case others run into it...

I'm seeing an 8s delay when running gitu in one of my repos (blank terminal, but then the interface appears and it works smoothly, though operations like staging & unstaging files take a second or two). Here's the output from gitu --log

[00:00:00.000] (1f2163240) DEBUG  Initializing terminal backend
[00:00:00.000] (1f2163240) DEBUG  Starting app
[00:00:00.000] (1f2163240) DEBUG  Finding git dir
[00:00:00.008] (1f2163240) DEBUG  Opening repo
[00:00:00.009] (1f2163240) DEBUG  Initializing config
[00:00:00.009] (1f2163240) INFO   Loading config file at "/Users/david/.config/gitu/config.toml"
[00:00:00.010] (1f2163240) DEBUG  Creating initial state
[00:00:00.068] (1f2163240) WARN   Couldn't read /Users/david/src/work/console-fe/.git/rebase-merge/onto, due to No such file or directory (os error 2)
[00:00:00.068] (1f2163240) WARN   Couldn't read /Users/david/src/work/console-fe/.git/MERGE_HEAD, due to No such file or directory (os error 2)
[00:00:00.068] (1f2163240) WARN   Couldn't read /Users/david/src/work/console-fe/.git/REVERT_HEAD, due to No such file or directory (os error 2)
[00:00:08.187] (1f2163240) DEBUG  Initial update
[00:00:08.189] (1f2163240) TRACE  registering event source with poller: token=Token(0), interests=READABLE
[00:00:08.190] (1f2163240) TRACE  registering event source with poller: token=Token(1), interests=READABLE

I've check and gitu is working normally in other repos.

Any suggestions about the best way to rectify this without re-cloning the repo? git seems to be working fine 🤔

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the delay with gitu --log in the affected repository and compare its timing with a repository where gitu works normally. Start by examining the .git/rebase-merge/onto, .git/MERGE_HEAD, and .git/REVERT_HEAD warnings and the gap before Initial update. Done means startup and staging or unstaging respond normally without recloning the repository.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.