jesseduffield / lazygit

simple terminal UI for git commands
MIT License
53.67k stars 1.87k forks source link

Show untracked files in stash #832

Open tjwelde opened 4 years ago

tjwelde commented 4 years ago

Is your feature request related to a problem? Please describe. Sometimes I stash a bunch of untracked files, to get them out of the way. When viewing such a stash in lazygit, I unfortunately can't see, if there are untracked ones and what they contain.

Describe the solution you'd like If I click on a stash, it could change to a view of indexed and untracked files, like I can do on commits.

Describe alternatives you've considered An alternative would be to just display the diff in the Stash view on the right.

jesseduffield commented 4 years ago

Do you know of a flag that can be passed to the git command on the command line that would enable this behaviour?

tjwelde commented 4 years ago

yes. git show stash@{0}^3

tjwelde commented 4 years ago

if you only want to have the filename: git show stash@{0}^3 --pretty='' --name-only

EdricChan03 commented 2 years ago

As of recently (Git 2.32, released on May 2021), a --include-untracked/-u flag can be used to include untracked files as documented in this StackOverflow answer.

It also mentions that you can specify this flag by default with the stash.showIncludeUntracked property which you can set in your Git config:

git config --global stash.showIncludeUntracked true

EDIT: This doesn't appear to affect the list of files from viewing a stash entry though

EDIT (again): Enabling debug mode eventually pointed me to this line which is used to retrieve the files changed:

https://github.com/jesseduffield/lazygit/blob/91dab7fef9cffaead9925d22bfb18b1f6c73aa2c/pkg/commands/loaders/commit_files.go#L31

veremenko-y commented 7 months ago

I would also like to be able to see untracked files in stash window. Especially if you have a feature to stash untracked files, they otherwise become invisible.

mark2185 commented 7 months ago

@veremenko-y does it not show up even with stash.showIncludeUntracked set to true?

veremenko-y commented 7 months ago

@veremenko-y does it not show up even with stash.showIncludeUntracked set to true?

Nope...

# cat ~/.gitconfig
...
[stash]
    showIncludeUntracked = true