dduan / tre

Tree command, improved.
MIT License
848 stars 16 forks source link

tre does not show files untracked by git #83

Closed jantari closed 2 years ago

jantari commented 3 years ago

Using tre version 0.3.6 (msvc) on Windows 10 Build 10.0.21364.1000.

I get the following behavior:

jantari@AMDESKTOP:~\Nextcloud\Programmieren\PowerShell\lsuclient
└─ PS> git status
On branch feat-customrepository
Untracked files:
(use "git add <file>..." to include in what will be committed)
        private/Test-LSUPackageFiles.ps1

nothing added to commit but untracked files present (use "git add" to track)
jantari@AMDESKTOP:~\Nextcloud\Programmieren\PowerShell\lsuclient
└─ PS> ls .\private

    Directory: C:\Users\jantari\Nextcloud\Programmieren\PowerShell\lsuclient\private

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        28.12.2020     20:53           1598 Compare-Array.ps1
-a----        18.04.2021     14:42           2553 Compare-VersionStrings.ps1
-a----        19.10.2020     19:19           1003 Expand-LSUpdate.ps1
-a----        28.02.2021     00:56           3181 Install-BiosUpdate.ps1
-a----        18.04.2021     14:42           5275 Invoke-PackageCommand.ps1
-a----        28.02.2021     00:56           1194 New-WebClient.ps1
-a----        28.02.2021     00:56           2135 Remove-CmdEscapeCharacter.ps1
-a----        19.10.2020     19:19            668 Resolve-CmdVariable.ps1
-a----        25.03.2021     20:52           2186 Resolve-XMLDependencies.ps1
-a----        19.10.2020     19:19            714 Set-BIOSUpdateRegistryFlag.ps1
-a----        25.03.2021     20:52           1692 Show-DownloadProgress.ps1
-a----        28.02.2021     00:56           1306 Split-ExecutableAndArguments.ps1
-a----        19.04.2021     23:09           1660 Test-LSUPackageFiles.ps1
-a----        18.04.2021     14:42          13699 Test-MachineSatisfiesDependency.ps1
-a----        19.10.2020     19:19            236 Test-RunningAsAdmin.ps1
-a----        25.03.2021     20:52           6233 Test-Wflash2ForSCCMParameter.ps1

jantari@AMDESKTOP:~\Nextcloud\Programmieren\PowerShell\lsuclient
└─ PS> tre .\private
.\private
├── New-WebClient.ps1
├── Resolve-XMLDependencies.ps1
├── Show-DownloadProgress.ps1
├── Test-Wflash2ForSCCMParameter.ps1
├── Test-RunningAsAdmin.ps1
├── Resolve-CmdVariable.ps1
├── Set-BIOSUpdateRegistryFlag.ps1
├── Compare-Array.ps1
├── Remove-CmdEscapeCharacter.ps1
├── Test-MachineSatisfiesDependency.ps1
├── Invoke-PackageCommand.ps1
├── Install-BiosUpdate.ps1
├── Split-ExecutableAndArguments.ps1
├── Expand-LSUpdate.ps1
└── Compare-VersionStrings.ps1

As you can see, tre does not show my newly created file Test-LSUPackageFiles.ps1. Presumably because it is untracked by git, but this is very irritating because newly created untracked files tend to be the ones I am currently working on :)

I know I can use -a to show all files, but that spams my terminal with all the unwanted content from the .git directory. I also personally like that the .gitignore file is respected, but in this case such a file does not exist and the only thing special or different about this file is that it is untracked by git.

ghost commented 2 years ago

yesterday I opened an issue #85 I have the same problem as you have, I think an -I option like normal tree -I <directory or file> for excluding directory or file would be useful something like tre -a -I ".git|.venv"

jantari commented 2 years ago

@dduan Would it be possible to take a look at this? I still use tre all the time but this really makes it a worse experience. I feel like untracked files should definitely be shown by default. Thanks!