This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224986 - Stash functionality
Summary: Stash functionality
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.2.1
Hardware: PC Linux
: P3 normal with 14 votes (vote)
Assignee: Ondrej Vrabec
URL: http://git-scm.com/book/en/Git-Tools-...
Keywords:
: 230414 245205 (view as bug list)
Depends on: 249326
Blocks: 249458
  Show dependency tree
 
Reported: 2013-01-16 18:29 UTC by solasola
Modified: 2014-12-21 06:07 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description solasola 2013-01-16 18:29:40 UTC
Without the stash functionality it is very hard to work with Git based projects with several branches.

Scenario:
- I am in the middle of a development on BRANCH_A and I get a request to fix something in BRANCH_B
- I cannot easily switch to BRANCH_B without a lot of hassle to save uncommited changes somewhere and then restoring on them onto my working copy after I can start working on BRANCH_A again (after finished work with BRANCH_B).

There is an "Export > Uncommited Changes" function but there is no way on the GUI to restore the created patch.

The only workaround now is to manually stash the changes from the command line and re-apply it after I could switch back to BRANCH_A

This is doable now from the built-in terminal but it is not nice and not comfortable.

Stashing is a very integral part of Git so it should be supported correctly in Netbeans.
Comment 1 Tomas Stupka 2013-01-16 18:46:17 UTC
did you try main menu/team/shelve changes?

> There is an "Export > Uncommited Changes" function but there is no way on the
> GUI to restore the created patch.
to apply a patch go for main menu/tools/apply diff patch (In reply to comment #0)
Comment 2 solasola 2013-01-17 15:07:05 UTC
In my installation (7.2.1, Linux Mint Nadia, x64), the "Shelve Changes" menu item is not visible when I select a Git project (a Maven project but I suppose that doesn't matter).

If I select an SVN project in Projects, the Shelve Changes menu item is visible and seem to be working.
Comment 3 Ondrej Vrabec 2013-01-18 13:03:23 UTC
(In reply to comment #2)
> In my installation (7.2.1, Linux Mint Nadia, x64), the "Shelve Changes" menu
> item is not visible when I select a Git project (a Maven project but I suppose
> that doesn't matter).
True, Shelve Changes is not supported in Git. I'll take a look at it in the next release - bug #225057
Comment 4 creechy 2013-02-13 16:57:50 UTC
+1 to this. Would dramatically improve the usefulness of Git with NetBeans.
Comment 5 Ondrej Vrabec 2013-05-29 07:44:21 UTC
*** Bug 230414 has been marked as a duplicate of this bug. ***
Comment 6 markiewb 2013-05-29 21:26:51 UTC
(In reply to comment #3)
> True, Shelve Changes is not supported in Git. I'll take a look at it in the
> next release - bug #225057

@Ondrej: Shelve changes is solved in bug #225057. So this issue can be resolved as fixed too?
Comment 7 janario 2013-05-29 23:21:41 UTC
(In reply to comment #6)
> (In reply to comment #3)
> > True, Shelve Changes is not supported in Git. I'll take a look at it in the
> > next release - bug #225057
> 
> @Ondrej: Shelve changes is solved in bug #225057. So this issue can be resolved
> as fixed too?

I don't think so.
Shelves is an specific feature from NetBeans. It would be better an integration with git stashes.

I am not an expert in git but I think git would have something more integrated with stashes.

Maybe NetBeans shelves should use git stashes.
Comment 8 turneliusz 2014-03-21 09:31:06 UTC
+1 for git stashes integration
Comment 9 Ondrej Vrabec 2014-03-21 09:36:11 UTC
i agree it would be a fine feature, especially an automatic stash in the pull scenario:
fetch -> stash -> merge/rebase -> stash apply
Comment 10 Ondrej Vrabec 2014-06-25 08:42:19 UTC
*** Bug 245205 has been marked as a duplicate of this bug. ***
Comment 11 Christian Lenz 2014-07-28 21:25:41 UTC
+ 1 for the feature request stash while pulling, I created a ticket for such feature. Scenario is this:

Uncommited files, maybe of some changes which are not for commit and not for ignore because the file is important. When I pull and select rebase, I got the message to revert changes or review them and this is a pain in the ass.

The feature pull or fetch -> stash -> merge/rebase -> stash apply would be very nice. I think this functionality is already implemented in intelliJ :).

Here is the ticket for this: https://netbeans.org/bugzilla/show_bug.cgi?id=246075


Regards

Chris
Comment 12 sebglon 2014-09-24 10:01:24 UTC
+1

This is essential
Comment 13 jaCUBE 2014-10-15 13:54:35 UTC
+1 (I registered myself because of this :) )
Comment 14 Ondrej Vrabec 2014-12-19 20:51:37 UTC
stashing is now supported: currently either by running Stash Changes git action from the quick search or from the popup on Stashes node under the Repository browser.
Applying and dropping stashes is also possible from the repository view: dbl-click on a stash (press Del resp. to drop it).

I will be working on a closer integration with Shelve changes now, so it primarily uses git stashes.

fix: http://hg.netbeans.org/core-main/rev/f6bb21a12077
Comment 15 Quality Engineering 2014-12-21 06:07:48 UTC
Integrated into 'main-silver', will be available in build *201412210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f6bb21a12077
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #224986 - Stash functionality

Stashes are now displayed in the repository browser view under the Stashes node.
Stashes may be saved either from the repo browser when selecting Stash changes from
the popup on the Stashes node or by invoking Stash Changes action from the Quick Search view.
To apply a stash it's enough to dbl-click on its relevant node and to drop the stash simple Del
is available on the node.