-
Notifications
You must be signed in to change notification settings - Fork 281
Add stash commands #198
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
Add stash commands #198
Conversation
Conflicts: Classes/GTRepository.h
@@ -62,6 +62,13 @@ enum { | |||
GTRepositoryResetTypeHard = GIT_RESET_HARD | |||
} GTRepositoryResetType; | |||
|
|||
typedef enum : git_stash_flags { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've had to stop specifying the underlying type, due to new Clang warnings and C++ incompatibility. Just leaving it unspecified will be fine.
Can you also add a quick description of this enum, and indicate that the flags can be ORed together? (No need to document the fields individually.)
Looks pretty good! I've added some code review notes above. Can you also add unit tests for this?
It's totally fine with me. That matches other patterns we have in the library.
Yeah, but I don't think it's your fault. I think CC @arrbee |
@tiennou Is this ready for re-review? (Sorry, we only get notifications on comments, not commits.) |
Yeah, sorry, review away. GitX auto-update system built something that doesn't run on 10.7 so the issue tracker is taking some heat ;-). |
I'm still not sure the API's final. It's untested until I write some tests (heh ;-)), and I really would like to implement that first in GitX to have a better "feel". But if this suits you, feel free to merge ;-) |
Ah, no, I'd like to wait on the tests. ⚡ |
Okay, I've started to write some tests and I'm stuck. I added So I added All in all, I need a little help with testing. Is it preferable to build a test repo — I'm not sure how it works atm, apart that it unzips some files somewhere — or use only the API ? |
All new tests should be in a
All of those repositories are in
Hmm, it wouldn't surprise me. You could also test it by making sure the changes are gone from the WD after stashing, then reappear after popping the stash.
Fixtures are generally kind of a pain in the ass, so I'd avoid adding a new one unless you really need it. If you do want to add one:
Yeah… like I said, a pain in the ass. :\ @alanjrogers @dannygreg @joshaber Can one of you guys review this while I'm gone? |
Now I'm getting excited :-) |
The stash tests need access to the contents of the stashed commit.
Sorry, I'm splitting pull requests :-S. I'm merging in #208 for the new Also, I'm building my local TODO list, so would there be interest in :
|
Multiple pull requests is fantastic. It makes it much easier to review. 👍
That would be ✨ but not required. Our philosophy has been to just do tests going forward in specta and convert old tests as needed. Probably best as its own pull request.
Again that would be ✨ |
So many ✨ |
Superseded by #265. |
I'll need this for GitX soon™, but I'm not yet using it, so I'm unsure if that API is final or not. This is based on #163 for the "create stash" part.
Wonderings :
enumerateStashes:
call block format. Right now it's a simple wrapper aroundgit_stash_foreach
. Maybe something more convenient can be whipped up, but since I'm not yet using it I have no idea ;-).const GTSignature.git_signature
pointer. But I'm unsure how to fix that (short of changinggit_stash_save
too). Opinions ?