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

Trial run of adding newbase back #19970

Merged
merged 2 commits into from
Jan 19, 2017
Merged

Trial run of adding newbase back #19970

merged 2 commits into from
Jan 19, 2017

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Jan 10, 2017

Addresses part of #19839

@kshyatt kshyatt added the libgit2 The libgit2 library or the LibGit2 stdlib module label Jan 10, 2017
@kshyatt kshyatt requested review from simonbyrne and tkelman January 10, 2017 20:00
Nullable{GitAnnotated}()
else
Nullable{GitAnnotated}(GitAnnotated(repo, newbase))
end
Copy link
Member

Choose a reason for hiding this comment

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

This seems stylistically different than what's around elsewhere in Base (or maybe it's just that the else and end aren't in the same column that's bugging me). Perhaps something like

onto_ann = if isempty(newbase)
    Nullable{GitAnnotated}()
else
    Nullable{GitAnnotated}(GitAnnotated(repo, newbase))
end

would be acceptable? Not really a big deal.

Copy link
Member

Choose a reason for hiding this comment

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

or

onto_ann = isempty(newbase) ? Nullable{GitAnnotated}() :
    Nullable{GitAnnotated}(GitAnnotated(repo, newbase))

Copy link
Contributor

Choose a reason for hiding this comment

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

Or even change the onto argument in GitRebase to accept a Union{Void, GitAnnotated}? I don't think the cost of dynamic dispatch is going to be to burdensome.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better now?

Copy link
Contributor

@simonbyrne simonbyrne left a comment

Choose a reason for hiding this comment

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

Maybe add a test as well?

@@ -457,7 +457,7 @@ function merge!(repo::GitRepo;
end

"""
LibGit2.rebase!(repo::GitRepo[, upstream::AbstractString])
LibGit2.rebase!(repo::GitRepo, upstream::AbstractString="", newbase::AbstractString="")

Attempt an automatic merge rebase of the current branch, from `upstream` if provided, or
otherwise from the upstream tracking branch.
Copy link
Contributor

Choose a reason for hiding this comment

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

describe what newbase does here.

Nullable{GitAnnotated}()
else
Nullable{GitAnnotated}(GitAnnotated(repo, newbase))
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Or even change the onto argument in GitRebase to accept a Union{Void, GitAnnotated}? I don't think the cost of dynamic dispatch is going to be to burdensome.

@kshyatt
Copy link
Contributor Author

kshyatt commented Jan 11, 2017

I'm a bit confused about how to test this, honestly.

@simonbyrne
Copy link
Contributor

Ideally, I guess, we could compare the results to command line git.
(to be honest though, I'm still not 100% sure what exactly this option is supposed to do)

@tkelman
Copy link
Contributor

tkelman commented Jan 12, 2017

what does this correspond to in the libgit2 api? if they don't have it documented we can bug them about it

@kshyatt
Copy link
Contributor Author

kshyatt commented Jan 18, 2017

Test added!

@kshyatt
Copy link
Contributor Author

kshyatt commented Jan 18, 2017

@simonbyrne the git docs have a good explanation of what this does. I don't know if we want ASCII art in the docstring?

@ararslan
Copy link
Member

I don't know if we want ASCII art in the docstring?

Since these functions aren't exported from Base, I think they're more for people who know what they're doing. As such, I wouldn't think we need that level of detail in the docstrings. If anything, we could simply link to the relevant page in the Git documentation.


Attempt an automatic merge rebase of the current branch, from `upstream` if provided, or
otherwise from the upstream tracking branch.
`newbase` is the branch to rebase onto, or `NULL` to rebase onto the given `upstream`.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe:

`newbase` is the branch to rebase onto, by default this is `upstream`.

@simonbyrne
Copy link
Contributor

LGTM other than the doc wording.

@kshyatt kshyatt merged commit 970ffbf into master Jan 19, 2017
@kshyatt kshyatt deleted the ksh/onto branch January 19, 2017 21:45
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.

5 participants