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

Include Stash untracked files in the Commit Details View #208

Closed
thmatot opened this issue Nov 7, 2019 · 3 comments
Closed

Include Stash untracked files in the Commit Details View #208

thmatot opened this issue Nov 7, 2019 · 3 comments
Assignees
Labels
improvement An improvement to existing functionality nice to have A feature request that is nice to have (lower priority)
Milestone

Comments

@thmatot
Copy link
Contributor

thmatot commented Nov 7, 2019

It would be nice to add untrack files to stash files list (add with git stash -u)

@thmatot thmatot added the improvement An improvement to existing functionality label Nov 7, 2019
@thmatot thmatot closed this as completed Nov 7, 2019
@thmatot thmatot reopened this Nov 7, 2019
@mhutchie
Copy link
Owner

mhutchie commented Nov 7, 2019

Thanks for raising this improvement request!

Given the below example of how stashes are stored:

*-. 4444444 working changes
|\ \
| | * 3333333 untracked files
| * 2222222 index
|/
* 111111 base

The Commit Details / Comparison View's runs a git diff command to get the diffs between the stash (4444444) & its base (1111111). It's because the untracked files are stored in a commit with no parents (3333333) that it's not included it the git diff output, and consequently in Commit Details / Comparison Views.

git stash show has the same behaviour as git diff, in not including untracked files in its output.

When I originally included stash support in Git Graph, I observed that untracked files weren't being included, which although not ideal, it is consistent with other commands like git stash show, git diff, and other tools like GitKraken & SourceTree. It seems like its a fairly common limitation due to the output of the underlying git commands.

I'll have a look into how best to achieve including the untracked files in the Commit Details View.

@mhutchie mhutchie changed the title Add untrack files to stash files list Include untracked files in Commit Details / Comparison Views Nov 7, 2019
@mhutchie mhutchie added the nice to have A feature request that is nice to have (lower priority) label Nov 7, 2019
@mhutchie mhutchie changed the title Include untracked files in Commit Details / Comparison Views Include untracked files from Stashes in the Commit Details View Nov 7, 2019
@mhutchie mhutchie changed the title Include untracked files from Stashes in the Commit Details View Include Stash untracked files in the Stash Details View Nov 7, 2019
@mhutchie mhutchie added this to the v1.19.0 milestone Nov 7, 2019
@mhutchie mhutchie changed the title Include Stash untracked files in the Stash Details View Include Stash untracked files in the Commit Details View Nov 7, 2019
@mhutchie
Copy link
Owner

mhutchie commented Nov 7, 2019

I've worked out how to achieve including untracked files from Stashes in the Commit Details View, by using information from the reflog and running an additional git diff command (specifically to get the stashes untracked files).

I'll have this available in the next release.

@mhutchie
Copy link
Owner

This will be available in v1.19.0.

If you'd like to use it before the next release, you can download v1.19.0-beta.1, and install it following the instructions provided here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An improvement to existing functionality nice to have A feature request that is nice to have (lower priority)
Projects
None yet
Development

No branches or pull requests

2 participants