warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
20.76k stars 348 forks source link

Issue with git commands on warp terminal #4942

Open thanoskrg opened 3 months ago

thanoskrg commented 3 months ago

Dupe Check

Describe the bug

It's been a while now (~ 1 week) that I am getting failures during git -i rebase commands on warp terminal.

It used to be a flaky behaviour, that after re-trying two or three times it would eventually work.

Since today though, this command constantly fails via warp, while it works via VS code git plugins or even through the pre-installed MacOS Terminal app.

More specifically I'm getting the following error:

git rebase -i --autosquash origin/main
error: Unable to create '.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
hint: Could not execute the todo command
hint:
hint:     pick a5bbc9d2f5ad73c22794229aecc1e7e23c3b6468 docs: add README
hint:
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint:
hint:     git rebase --edit-todo
hint:     git rebase --continue

To reproduce

Steps to reproduce: git rebase -i origin/main

Expected behavior

No response

Screenshots

No response

Operating system

MacOS

Operating system and version

Sonoma 14.4.1

Shell Version

zsh 5.9 (x86_64-apple-darwin23.0)

Current Warp version

v0.2024.05.14.08.01.stable_04

Regression

Yes, this bug started recently or with an X Warp version

Recent working Warp date

Less than a month ago

Additional context

No response

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

vorporeal commented 3 months ago

Hi @thanoskrg - thanks for letting us know! Are you using Warp's default prompt or a custom/PS1-driven prompt?

vorporeal commented 3 months ago

Also, is this a large git repository? We run a git command (configured to avoid taking any unnecessary locks) to display the current branch in the prompt; I'm wondering if it's taking a long time to run for some reason, and so ends up interfering with you running git commands.

thanoskrg commented 3 months ago

Are you using Warp's default prompt or a custom/PS1-driven prompt?

As far as I know I'm using the default settings, apart from some zsh customizations. But these customizations apply also to the Terminal app which I tested and it works.

is this a large git repository?

Yes, it's a huge monorepo. Not sure if it helps but for what's worth here is the output of:

$ git count-objects -vH
count: 180
size: 1.54 MiB
in-pack: 237689
packs: 4
size-pack: 166.01 MiB
prune-packable: 12
garbage: 0
size-garbage: 0 bytes

@vorporeal your assumption for the git command that takes long time to complete might be the case. Because sometimes it works, but most of them it doesn't.

vorporeal commented 3 months ago

Might be worth trying to enable the core.fsmonitor option for git - it vastly improves git performance on large repositories.

See this writeup about it on the GitHub blog: https://github.blog/2022-06-29-improve-git-monorepo-performance-with-a-file-system-monitor/

You may also want to try the feature.manyFiles config flag: https://git-scm.com/docs/git-config#Documentation/git-config.txt-featuremanyFiles

zheng commented 3 months ago

I've been experiencing this issue too! I originally assumed it was a bug with https://github.com/ejoffe/spr but this doesn't happen on iTerm

thanoskrg commented 3 months ago

@vorporeal unfortunately neither of the above fixed the issue. I'd like to highlight here that other terminals work fine with the same commands that Warp fails to complete.

alokedesai commented 3 months ago

@zheng Are you using Warp prompt or your custom PS1? If the former, does this still repro if you change from Warp prompt to "Honor PS1"?

thanoskrg commented 2 months ago

Folks, is there any update on this? Is it something that you can look and try to fix on your side?

zheng commented 2 months ago

@zheng Are you using Warp prompt or your custom PS1? If the former, does this still repro if you change from Warp prompt to "Honor PS1"?

There's a known issue with github codespaces, so my issue isn't specific to warp