gitui-org / gitui-org/gitui

Flag --file not working on sub directories

Offen
#2,871 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Rust
Sterne
22.5k
Forks
773
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Describe the bug**
`--file` only works when `gitui` is started from the repository root.

If `gitui` is launched from a subdirectory inside the same repository, the file is not resolved correctly, regardless of whether the path is passed relative to the current directory or relative to the repository root.

**To Reproduce**
Steps to reproduce the behavior:

1. Assume a repository with this file:
- `frontend/src/index.html`
2. From the repository root, run:
- `gitui --file frontend/src/index.html`
3. Observe that GitUI opens the Files tab and selects the file correctly.
4. Move into a subdirectory, for example:
- `cd frontend`
5. Run:
- `gitui --file src/index.html`
6. Run:
- `gitui --file frontend/src/index.html`
7. Observe that neither command selects the file correctly.

**Expected behavior**
`--file` should work from any directory inside the Git repository, not only from the repository root.

**Context (please complete the following information):**
- OS/Distro + Version: `Ubuntu 14 on WSL2`
- GitUI Version: `gitui nightly 2026-03-11 ()`
- Rust version: `cargo 1.89.0`

**Additional context**
This looks like a path resolution issue when the current working directory is not the repository root.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, das `--file`-Argument vom CLI-Einstiegspunkt durch seine Pfadauflösung zu verfolgen. Führe dann die Befehle aus dem Repository-Root und aus `frontend` erneut aus. Erledigt ist die Aufgabe, wenn sowohl repository-relative als auch vom aktuellen Verzeichnis ausgehende Pfade `frontend/src/index.html` auswählen, wenn GitUI aus einem Unterverzeichnis gestartet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git, rust
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.