Skip to content

Unnecessary root level in changed files tree view #4531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KnapSac opened this issue May 3, 2025 · 2 comments
Closed

Unnecessary root level in changed files tree view #4531

KnapSac opened this issue May 3, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@KnapSac
Copy link

KnapSac commented May 3, 2025

Describe the bug
If there is more than 1 root folder in the repository with changes, you now get an additional root level in the tree.

To Reproduce

mkdir repro
cd repro
mkdir a
touch a/a.txt
mkdir b
touch b/b.txt
lazygit

Expected behavior
The additional / root level doesn't show up, as was the case before (at least in 0.48, I skipped 0.49 and upgraded straigth to 0.50).

Screenshots
Image

Version info:
commit=66caa25dcd4c247589e6adc71a6bc088678f3212, build date=2025-05-03T02:30:12Z, build source=binaryRelease, version=0.50.0, os=windows, arch=amd64, git version=2.49.0.windows.1
git version 2.49.0.windows.1

@KnapSac KnapSac added the bug Something isn't working label May 3, 2025
@stefanhaller
Copy link
Collaborator

This is not a bug, it is very intentional (see #4346). The reason we added this (in 0.49) is because this allows you to see the combined diff of all your working copy changes, which wasn't possible before.

With 0.50 this has become even more useful, because you can now focus the main view in order to search it (using /), so you can now search in all your current unstaged or staged changes, which wouldn't be possible without the root item.

I know I said I would add a config option to disable this soon as the first user complains (#4346 (comment)), but before I do that I'd like to understand better why you think this is a problem.

@KnapSac
Copy link
Author

KnapSac commented May 3, 2025

Ah, I should have searched more thoroughly in which case I'd have found that PR 🙈.

I don't really have a problem with it, I was just very surprised to see it suddenly appear.

I usually navigate through the file tree to review the diffs, but I might try out using the main view for a bit. Without a different pager I find the combination of all the diffs a bit unclear, you can't clearly see the distinction between the different files. (This is blocked by #1453)

I'll close this for now, as this is indeed not a bug.

@KnapSac KnapSac closed this as completed May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants