Skip to content
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

Throw error on aborted rebase #19651

Merged
merged 7 commits into from
Jan 6, 2017
Merged

Throw error on aborted rebase #19651

merged 7 commits into from
Jan 6, 2017

Conversation

simonbyrne
Copy link
Contributor

@simonbyrne simonbyrne commented Dec 19, 2016

LibGit2.rebase! will no longer silently abort if an error occurs.

This changes the behaviour of one of the tests: for some reason LibGit2 is unable to automatically rebase this branch (previously it would silently abort).

follows on from #19624

`LibGit2.rebase!` will no longer silently abort if an error occurs.

This changes the behaviour of one of the tests: for some reason LibGit2 is unable to automatically rebase this branch.
@tkelman
Copy link
Contributor

tkelman commented Dec 19, 2016

what's the error? does it need a change in merge options or something?

@tkelman tkelman added the libgit2 The libgit2 library or the LibGit2 stdlib module label Dec 19, 2016
@simonbyrne
Copy link
Contributor Author

It gives EUNMERGED (as it tries to make a commit with unmerged changes).

I'm not sure if it can be fixed by different merge options.

@tkelman
Copy link
Contributor

tkelman commented Dec 19, 2016

any idea why command line git works but libgit2 doesn't then? is this a bug in libgit2?

@simonbyrne
Copy link
Contributor Author

simonbyrne commented Dec 19, 2016

Okay, it seemed to be due to a problem with how we were setting up remote tracking branches in the test case. Unfortunately fixing this exposed another problem with how we handle merge when the tracking branch has no commits. Anyway, this should fix them both.

end
else # try to get tracking remote branch for the head
if !isattached(repo)
if m == nothing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

===

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing is a singleton, so it just cuts out one level of inlining

obj = with(GitReference(repo, "refs/remotes/$remotename/$branchname")) do ref
LibGit2.Oid(ref)
end
with(get(GitCommit, repo, obj)) do cmt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you been able to come up with any scheme or logic for when and what needs management like this?

Copy link
Contributor Author

@simonbyrne simonbyrne Dec 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happens in our tests: basically whenever you clone a repository without any commits.

@StefanKarpinski
Copy link
Member

Bump?

end
end

""" git rebase --merge [--onto <newbase>] [<upstream>] """
function rebase!(repo::GitRepo, upstream::AbstractString="", newbase::AbstractString="")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was newbase not hooked up at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess we should add that to the list in #19839 since it would be a useful feature to have at some point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point.

@simonbyrne simonbyrne mentioned this pull request Jan 4, 2017
42 tasks
@tkelman
Copy link
Contributor

tkelman commented Jan 4, 2017

It should be safe to ignore the travis failures here. It passed last time this ran a few weeks ago, I restarted two of the jobs just in case anything on master would have caused issues when this is merged. The failures on the restarted builds are just that changes to .travis.yml don't always take effect properly on a restart (here for the new LLVM version).

@tkelman tkelman merged commit 45d2fe0 into master Jan 6, 2017
@tkelman tkelman deleted the sb/libgit2/rebaseerr branch January 6, 2017 13:05
Sacha0 added a commit to Sacha0/julia that referenced this pull request Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants