git integration: hide when not listing files in a Git repository
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 510
- PR merge metrics
- No merged PRs in 30d
Description
### Discussed in https://github.com/orgs/lsd-rs/discussions/846
Originally posted by **Jackenmen** May 26, 2023
Right now, enabling git column causes it to show in all directory listings, regardless of whether we're listing files inside a Git repository or not. In comparison, [`exa`](https://github.com/ogham/exa) only shows the Git column when running it inside a directory that is part of a Git repository (i.e. inside `~/git-repo` and `~/git-repo/subdir` but not inside `~`). I think that exa is better in this regard - it minimizes the clutter that isn't relevant when not run in a repository.
One potential edge case that you may want to handle is `tree` display mode where only part of a tree might be part of a Git repository. However, neither exa nor lsd currently shows the proper status on subdirectories that are git repositories so it would be fine to simply not show the git information at all.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the Git column is enabled during directory listings and how the current listing location is identified as part of a Git repository. Compare behavior inside a repository, in its parent directory, and in tree display mode; done means the Git column is hidden outside repositories while remaining available inside them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100