Skip to content
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

Show untracked files in stash #832

Open
tjwelde opened this issue May 11, 2020 · 7 comments
Open

Show untracked files in stash #832

tjwelde opened this issue May 11, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@tjwelde
Copy link

tjwelde commented May 11, 2020

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.

@tjwelde tjwelde added the enhancement New feature or request label May 11, 2020
@jesseduffield
Copy link
Owner

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

@tjwelde
Copy link
Author

tjwelde commented May 11, 2020

yes. git show stash@{0}^3

@tjwelde
Copy link
Author

tjwelde commented May 11, 2020

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

@EdricChan03
Copy link

EdricChan03 commented Mar 20, 2022

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:

filenames, err := self.cmd.New(fmt.Sprintf("git diff --submodule --no-ext-diff --name-status -z --no-renames %s %s %s", reverseFlag, from, to)).DontLog().RunWithOutput()

@veremenko-y
Copy link
Contributor

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
Copy link
Collaborator

mark2185 commented Apr 9, 2024

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

@veremenko-y
Copy link
Contributor

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

Nope...

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants