-
Notifications
You must be signed in to change notification settings - Fork 280
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
Pull #464
Conversation
Slightly more elegant than what I had: https://gist.github.com/pietbrauer/b1b3d2c6bd927ac85094 Things with open question marks for me:
|
I also end up with a dirty working copy when trying to pull in 2 commits from the remote: Phone is at pietbrauer/git2go-test-repo@02ed2a3 diff --git a/Test.txt b/Test.txt
index 5948f52..34f55f5 100644
--- a/Test.txt
+++ b/Test.txt
@@ -26,5 +26,3 @@ Test 25
Test 26
Test 27
Test 28
-Test 29
-Test 30 Can you confirm? |
My insights are for raw libgit2 but I will outline how I merge and perhaps this can be applied in objective-git. For me I start out getting merge heads for HEAD and corresponding head on remote tracking branch. These merge heads are fast-forward and unborn HEAD is fixed by pointing to the head commit of the remote tracking branch with The regular merge changes the tree and I use If there are conflicts these need to be resolved by the user somehow and Hope this helps in some small way. Working Copy does not currently do rebase but it should be a matter of applying |
|
||
// Check if merge is necessary | ||
GTBranch *localBranch = [repo currentBranchWithError:error]; | ||
if (*error) { |
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 think you should be checking for the return value, not the error — I fear a nice SEGV if I was to pass NULL
here. There are other cases below.
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.
Good catch. Using the user-supplied error pointer for control flow is messy, and dangerous 💥 .
Wow, great info @palmin! Thanks! |
@phatblat I just added a draft for unborn and fast forward merges. Seems to work. |
Regarding changes after using |
This stays consistent with the project. See https://github.com/libgit2/objective-git/blob/master/ObjectiveGit/GTRepository.m#L173 for example.
@pietbrauer did you create a new |
If libgit2 doesn't support rebase then I think it's clear that's out of scope for this PR. |
targetCommitAndReturnError: is deprecated
@phatblat The core problem is that travis aborts builds if they take longer than 10 minutes and produce no output. They increased it recently (that is why we added Travis again). One possible workaround would be to trigger |
Ah. Those library build scripts could also be changed to inline the output instead of dumping it into architecture-specific log files (perhaps with an optional verbose flag). Those log files have been troubling me since they make it hard to watch the build as it runs. Also, libgit2 build outputs hundreds of warnings for the 32-bit arm architectures (not sure how big an issue that is), but that's not easily visible since it's all tucked away out of sight. I realize there's a lot of output from those builds, but Xcode hides it all as soon as that build step completes successfully. |
Merged a handful of changes from master mostly just to kick off another build |
}); | ||
|
||
/// Conflict During Merge | ||
it(@"fails to merge whene there is a conflict", ^{ |
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.
s/whene/when/g
Oops. Thx @modocache! I guess it wasn't the 🔥 that was causing the |
The build for this PR is finally green! Turns out disabling a test using Ready for review. |
}); | ||
}); | ||
|
||
/* pending tests break build on travis |
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.
lol 😭
Sorry I'm a scumbag and waited too long to review this 😞. It looks good other than needing to be updated. |
# Conflicts: # ObjectiveGitFramework.xcodeproj/project.pbxproj
No worries! I've updated from master. I'd like to request a pull of the Pull pull request. 😆 |
🤘 |
Awesome! 🎉 |
Initial Pull implementation preferring fast-forward merge if possible or a "normal" merge if branches have diverged, depending on the merge analysis. Pull will fail if a conflict is detected.
TODO
Out of scope
--no-ff
)--ff-only
)