gitx icon indicating copy to clipboard operation
gitx copied to clipboard

Add support for `git stash`

Open rowanj opened this issue 14 years ago • 27 comments

Should display the list (stack?) of git stash objects that are available, and interfaces to create/apply them

rowanj avatar Jan 06 '12 04:01 rowanj

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:

  • save
  • list (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?)

pipelineoptika avatar Jan 06 '12 04:01 pipelineoptika

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"

rowanj avatar Jan 06 '12 04:01 rowanj

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?

pipelineoptika avatar Jan 06 '12 04:01 pipelineoptika

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

pipelineoptika avatar Jan 06 '12 04:01 pipelineoptika

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.

rowanj avatar Jan 06 '12 04:01 rowanj

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.

RomainMuller avatar Jul 05 '12 08:07 RomainMuller

I would very much like to see this feature. GitX (L) supports this.

killercup avatar Aug 21 '12 09:08 killercup

+1

You could probably just steal the from GitX (L) here. That part is reasonably quick

williscool avatar Oct 26 '12 16:10 williscool

This was a really nice GitX(L) addition. I may move to gitx-dev anyway, but I'll be sad about losing this feature...

jramsdale avatar Dec 31 '12 22:12 jramsdale

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.

claytonrcarter avatar Feb 05 '13 00:02 claytonrcarter

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.

rowanj avatar Feb 05 '13 23:02 rowanj

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.

claytonrcarter avatar Feb 06 '13 03:02 claytonrcarter

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?

rowanj avatar Feb 06 '13 04:02 rowanj

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.

claytonrcarter avatar Feb 06 '13 16:02 claytonrcarter

+1 to this. It's the biggest feature I miss since moving from GitX (L).

rjmunro avatar May 10 '13 11:05 rjmunro

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.

schmurfy avatar Jun 07 '13 10:06 schmurfy

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!

jzillmann avatar Jun 07 '13 10:06 jzillmann

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).

schmurfy avatar Jun 07 '13 12:06 schmurfy

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.

muhqu avatar Jul 29 '13 06:07 muhqu

it would really be awesome if you manage to :)

schmurfy avatar Jul 29 '13 08:07 schmurfy

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?

muhqu avatar Aug 07 '13 20:08 muhqu

+1. Very much wish GitX had this feature.

taoeffect avatar Aug 14 '13 01:08 taoeffect

maybe this issue should be closed since we now have a pull request for this.

schmurfy avatar Aug 14 '13 07:08 schmurfy

Close once fixed. :-)

taoeffect avatar Aug 14 '13 18:08 taoeffect

But where is it ? I am still running GitX(L) because I stash stuff all the time. ;)

codeon-nat avatar Jan 13 '15 16:01 codeon-nat

@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...

digitaljhelms avatar Jan 13 '15 17:01 digitaljhelms

Would be very happy to see "stash" support in GitX dev

dip00dip avatar Sep 22 '15 07:09 dip00dip