-
Notifications
You must be signed in to change notification settings - Fork 375
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
A first stab at a pull example. #427
Conversation
I was going to run |
I think this is ready for review if anyone want's to tackle it :-D It builds and runs for the limited set of cases I think I'm handling correctly. |
Thanks @zaphar, I'll try to get to it sometime soon. |
examples/pull.rs
Outdated
extern crate docopt; | ||
extern crate git2; | ||
#[macro_use] | ||
extern crate serde_derive; |
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.
When you rebase on master, the project has been updated to 2018 edition, so you can drop these extern crate
lines. Will still need a use serde_derive::Deserialize;
, though.
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.
I'll do that at the end so I only have to take the hit once. :-D
I think this is ready for another pass |
8596ad8
to
32b0391
Compare
@ehuss Ping |
I used this as an example and it was super helpful. Thanks :) |
super helpful. Why isn't this in the docs? |
1 similar comment
super helpful. Why isn't this in the docs? |
examples/pull.rs
Outdated
// For some reason the force is required to make the working directory actually get updated | ||
// I suspect we should be adding some logic to handle dirty working directory states | ||
// but this is just an example so maybe not. | ||
.force()))?; |
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.
👋Thanks for putting this PR together; it was really helpful.
I ran into this safe vs force problem as well and posted an answer here about what I think is going on. The summary is: safe mode will work if you checkout_branch before setting the head.
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.
Yeah that analysis sounds about right.
@zaphar I apologize for letting this fall through the cracks. Would you be able to rebase on master? Afterwards I'll go ahead and merge it. |
@ehuss, I'll try to get to that this week. Work and such has been a bit crazy with CoVID-19 preparedness and response stuff. |
* unecessary find reference and poor naming * always set head on the merge pathways.
32b0391
to
19f4310
Compare
ea2c047
to
2505054
Compare
I successfully rebased and have updated to |
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.
Thanks!
I'm sure I'm missing edge cases and stuff in here since I had to basically piece this together over a couple weeks but since I've done it I figured other people could learn from my now hard won experience.