Add support for `git stash`
Should display the list (stack?) of git stash objects that are available, and interfaces to create/apply them
Looking at the manual, stashes are always pushed to the end of the list, but can be popped (or applied -- no removal) from any stash in the list.
It can be used as a stack by issuing only git stash and git stash pop commands, but it's most certainly a list or queue implementation.
In terms of supported features, we should probably support:
savelist(implicit in the UI display - lefthand frame display?)show(also implicit in the UI - review in top half of main window?)pop(from dropdown on stash item in lefthand list?)apply(ditto)drop(ditto)clear(from dropdown on overall stash list header in lefthand frame?)
The major feature of this that I had in mind doesn't need much of an interface at all; when an operation (i.e. pull) fails because of local changes, provide a button to "Stash and retry"
Roger that.
Query: looking at libgit2, I can't quite figure out what the status of git stash support is. Is it that stash is simply another index and set of objects that one can access with the existing set of APIs under libgit2?
A button on the failure dialog, or similar?
On 06/01/2012, at 3:26 PM, Rowan [email protected] wrote:
The major feature of this that I had in mind doesn't need much of an interface at all; when an operation (i.e. pull) fails because of local changes, provide a button to "Stash and re-try"
Reply to this email directly or view it on GitHub: https://github.com/rowanj/gitx/issues/14#issuecomment-3380729
Yeah, that was the idea. The current workaround is to command-line stash it or actually commit it and ammend/rebase that out after the fact.
I second that request. I would like to see all existing stashes of my repos right below the "branches" list. Being able to drop them from context menu is probably good as well. In my opinion, save, pop, apply are not priorities as long as the visibility is there. Also, from my point of view, a dropdown for stashes wouldn't be any improvement over using CLI (too many clicks involved) - everything should be context-menu available from the lefthand frame.
I would very much like to see this feature. GitX (L) supports this.
+1
You could probably just steal the from GitX (L) here. That part is reasonably quick
This was a really nice GitX(L) addition. I may move to gitx-dev anyway, but I'll be sad about losing this feature...
So maybe I'm being overly ambitious here, but I decided to see if I could port this over from GitX(L) (along w/ a couple other things I like from GitX(L)) and I simply couldn't get this GitX to build. I'm using XCode 4.5.2 on 10.8; I installed CMake, cloned this project from the URL specified, init'ed and updated submodules and ran into a few CMake errors (couldn't find CMakeLists.txt for one) and libgit2 errors (can't find git2/oid.h) and such. I'm still fairly new to XCode, but is the project pretty involved to get up and running to build? Any assistance to get this setup would be great since I have a little time and a lot of desire to being in stash support. Thanks.
The objective-git submodule itself has submodules (libgit2); did you recursively init them?
I use git submodule update --init --recursive at the top-level GitX directory.
Thank you, yes, that fixed it. (Along with changing the code signing settings and a build clean.) Of course, now that I got it to build I realize I'm in way over my head. Alot of the changes look like they can be copied between files, but that was too tedious to do manually, and the organizational structure is too different for me to be able to figure out how to do a format-patch | am. Thanks for the help, but sorry I couldn't be more of one.
Fortunately Git handles moved files pretty well; but yes, some of the changes I've made are quite intrusive to the project structure.
@claytoncarter If you've isolated the changes (and/or the commits they happened in on GitX (L)), that's a long way toward getting it done. Can you list them here easily?
Keeping in my that I'm in over my head and also very poor in ObjC, here's what it looks like to me:
There were two main efforts to get stashes working. The first happened on a branch starting with SHA 0a3b60066c and was merged back after SHA 33e21e2604, although it looks like there's a bunch of other stuff in that branch and most of the stash action happened in commits 0a3b60066c, cc5c93c2b6, be507c8230 and cb59e86a81.
The second effort was done on a branch starting with SHA 2158f1e6c7 and was merged into master after SHA ba51ae810b.
After that, it looks like there were bug fix commits at b4557ebb67, 76c0a97298, 5fde8e8ec3, 12ca779de9.
+1 to this. It's the biggest feature I miss since moving from GitX (L).
If having a full stash list with actions is long to do it would be nice to have a list of the existing stashes like the branches list.
I tend to always forget what I have stashed since that's one of the last thing that is not clearly sown in gitx-dev.
Same with me. There was this other gitx clone having a visual stash representation. Liked that very much. Just the speed wasn't awesome, thats why i switched to your version and now looking after every update if the stash thing is now there ;)
Keep on the good work!
the other must be GitX(L), I think we all took the same path ;) GitX(L) has really nice fatures but performance was clearly not the main focus (if a focus at all).
Looks like GitX(L) 's stashes feature was introduced by @krasnyk. He still has a separate 'stashes' branch in his repository. unfortunately it is based on nathan's experimental branch... https://github.com/krasnyk/gitx/compare/stashes
Could be a challenging task to rebase/cherry-pick the relevant changes to gitx-dev but I may give it a try.
it would really be awesome if you manage to :)
Guys I tried hard to rebase the GitX(L)'s isolated stash commits. But It pretty quick turned out to be very hard to do, so I decided to go the easier way and implement it from scratch. see #239
To show the list of stashes in the sidebar I have directly used the libgit2 as objective-git doesn't support stashes at the moment. But there's already a pull request to add support, yay! Anyway, I have implemented this with the objective in mind to replace all stash functionality with the objective-git equivalent once its available.
What do you think?
+1. Very much wish GitX had this feature.
maybe this issue should be closed since we now have a pull request for this.
Close once fixed. :-)
But where is it ? I am still running GitX(L) because I stash stuff all the time. ;)
@codeon-nat the #239 PR has conflicts that require a branch rebase, however, it doesn't appear that @muhqu is supporting the PR any longer...
Would be very happy to see "stash" support in GitX dev