Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 441593

Summary: Untracked changes should be visible in stash commits
Product: [ECD] Orion Reporter: Ken Walker <ken_walker>
Component: GitAssignee: Project Inbox <orion.git-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gheorghe, maciej.bendkowski, pwebster
Version: 6.0   
Target Milestone: 7.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Shows a new files and a changed file
none
Shows the stash only containing the changed file none

Description Ken Walker CLA 2014-08-12 09:21:07 EDT
I was trying out the new Stash feature (while on holidays ;-).  But I lost the new files I had created.  Only the changed files were in the stash.  Is this expected?  Will attach two screen shots of before and after.
Comment 1 Ken Walker CLA 2014-08-12 09:21:33 EDT
Created attachment 245913 [details]
Shows a new files and a changed file
Comment 2 Ken Walker CLA 2014-08-12 09:21:56 EDT
Created attachment 245914 [details]
Shows the stash only containing the changed file
Comment 3 Maciej Bendkowski CLA 2014-08-12 10:23:42 EDT
Yes, it should. It actually did that, although the stash commit is empty (as untracked files are *not* included there). There was however a trivial issue with applying such changes - already fixed in master. We should include untracked changes in the commit somehow and make it intuitive which changes are tracked and which are not.
Comment 4 Maciej Bendkowski CLA 2014-08-12 10:26:16 EDT
Changing the summary to be more accurate.
Comment 5 Paul Webster CLA 2014-08-12 10:51:19 EDT
Normally when you stash, it effects the files in the index.  It doesn't effect untracked new files (i.e. they just stay there, and still show up as untracked).

PW
Comment 6 Maciej Bendkowski CLA 2014-08-14 08:59:46 EDT
(In reply to Paul Webster from comment #5)
> Normally when you stash, it effects the files in the index.  It doesn't
> effect untracked new files (i.e. they just stay there, and still show up as
> untracked).

That would certainly resolve the problem of showing them in the stash. If we however want to have the "git stash --untracked" as well, we should have a dedicated view for stashed untracked changes and apply the same approach as for "push" and "push --branch".
Comment 7 Maciej Bendkowski CLA 2014-08-14 11:11:03 EDT
I changed the default stash behavior - untracked changes are now *not* included by default. Until we figure out the presentation of untracked changes in the stash - we should not enable it back.
Comment 8 Bogdan Gheorghe CLA 2014-09-22 22:39:26 EDT
Restored this functionality as we now have a way of showing the different stashes:

1) Stash away your changes
2) Select your stash from the Refs drop down -> you will now see your stashes displayed as incoming commits against your active branch

Note that you will see multiple entries for the same stash. JGit creates 3 commits (same title, different SHA) for a stash: one for the work in progress (ie all of your working dir minus any new files), another one for files that have been staged and another one for any new files.