Skip to content

Introduce Repository.CherryPick. #756

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

Merged
merged 1 commit into from
Jun 11, 2014
Merged

Conversation

Therzok
Copy link
Member

@Therzok Therzok commented Jun 10, 2014

Okay so, this is pretty weird, but from the looks of it, CherryPick has lots of copied stuff from RevertOptions and GitRevertOpts (basically a 1:1 mirror.)

Also, the unit test are not yet complete. Imo, they should include almost the same tests as RevertFixture. But using MergeRepo as the test repo since it is already branched.

@Therzok
Copy link
Member Author

Therzok commented Jun 10, 2014

I've only ported 3 of the tests to be sure this is the proper approach. I'd rather have this merged as-is and tests be improved on the way, since I'm totally out of time for emulating a new repo and adding tests.

public CheckoutNotifyHandler OnCheckoutNotify { get; set; }

/// <summary>
/// Commit the revert if the revert is successful.
Copy link
Member

Choose a reason for hiding this comment

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

Update comment for cherry-pick (instead of revert)?

Copy link
Member Author

Choose a reason for hiding this comment

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

And done.

@Therzok
Copy link
Member Author

Therzok commented Jun 11, 2014

@nulltoken fixed the passing of null. I'd rather let libgit2 handle FastForward first, then implement cherry-pick fast forward.

@@ -148,4 +149,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Copy link
Member

Choose a reason for hiding this comment

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

Could you please revert the removal of this trailing newline?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was automagically added by VS. I can remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@nulltoken
Copy link
Member

@jamill Any additional remarks?

@nulltoken
Copy link
Member

Thanks! Could you please rebase on top of latest vNext?

/// <returns>The result of the cherry pick.</returns>
public CherryPickResult CherryPick(Commit commit, Signature committer, CherryPickOptions options = null)
{
Ensure.ArgumentNotNull(commit, "commit");
Copy link
Member

Choose a reason for hiding this comment

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

I might Ensure that committer is not null here. We also appear to be missing this check in Commit, but I think it would eventually get caught in ObjectDatabase.CreateCommit

Copy link
Member Author

Choose a reason for hiding this comment

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

I forgot about this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added it.

@jamill
Copy link
Member

jamill commented Jun 11, 2014

I think this looks pretty good - thanks! My only concern are the tests - which I see is being tracked by #757.

@nulltoken nulltoken merged commit b399005 into libgit2:vNext Jun 11, 2014
@Therzok Therzok deleted the cherryPick branch June 11, 2014 20:57
@nulltoken nulltoken added this to the v0.19.0 milestone Jun 12, 2014
@nulltoken
Copy link
Member

💥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants