jesseduffield / jesseduffield/lazygit
How to get relative paths in File panel
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Is your feature request related to a problem? Please describe.**
Context: I work on a repo with many nested folders, but only work in one of those. With vanilla `git status`, all the modified files are reported relative to the repo root dir. I can change this with `git config status.relativePaths true`. This option is particularly handy for repos with long folder names. E.g., if you work only in the `$repo_root/long_string/another_long_string/maybe_a_third_one` folder.
**Describe the solution you'd like**
I am not sure what command lazygit runs to get the list of unstaged files in the `Files` panel. I suspect it's not `git status`, or else it should honor my global git config (right) for the output of status. But in general, I might want relative paths for lazygit even if I don't have them in my global/repo git config, since lazygit has panels, and the horiz space is limited, so shorter file names can be useful. To this end, it would be nice if lazygit had a config option to allow paths in the File panel that are relative to the current folder. This option could be under `gui` (something like `showFilesRelativePath`) or under `git`, but I don't know exactly what git command is run to retrieve that list (as I said, I suspected it was `git status`, but then it should have honored my configs, so maybe it's `git ls-files`)?
**Describe alternatives you've considered**
I don't have a clear idea of how to achieve this result. I would have to go check what git command lazygit uses to retrieve the diffing files, but that's intrusive, since it requires knowledge of internal lazygit impl details. It would be best for lazygit to offer a config option in its config.yml file.
**Additional context**
See screenshot for an example of this issue. I work 99.9% inside the `components/scream/src` folder of the repo; being able to remove that common prefix would allow to see the filenames more easily.

Contributor guide
Assessment
This issue has not been assessed yet.