Skip to content

Merge #608

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
Jan 16, 2014
Merged

Merge #608

merged 1 commit into from
Jan 16, 2014

Conversation

jamill
Copy link
Member

@jamill jamill commented Jan 15, 2014

This is a PR based off of #579 - but rebased on latest and including an extra commit to tweak the merge logic. This PR would supersede #579.

@jamill
Copy link
Member Author

jamill commented Jan 15, 2014

/cc @nulltoken, @ethomson, @CrumblyCake

@jamill
Copy link
Member Author

jamill commented Jan 15, 2014

As @CrumblyCake did most of the work here, I suggest we squash this into a single commit (with credit going to @CrumblyCake ), as long as he agrees (both with where this pull request has landed and to have his name attached with the final result).

@ethomson
Copy link
Member

This is looking awesome to me. Giant thanks to @jamill and @CrumblyCake !

+1

[Fact]
public void CanMergeRepos()
{
string firstBranchFileName = "first branch file.txt";
Copy link
Member

Choose a reason for hiding this comment

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

Maybe make those variables and the other ones in the tests below as const?

@nulltoken
Copy link
Member

@CrumblyCake @jamill I ❤️ this ‼️

Tiny proposal: how about adding small ASCII graphs in the tests to show the state of the branches before the merge?

{
var firstBranch = repo.CreateBranch("FirstBranch");
firstBranch.Checkout();
var originalTreeCount = firstBranch.Tip.Tree.Count;
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't seem this variable is used in the assertions.

@nulltoken
Copy link
Member

applause


/// <summary>
/// The resulting commit of the merge. For fast-forward merges, this is the
/// commit that merge was fast forwared to.
Copy link
Member

Choose a reason for hiding this comment

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

forwar d ed :trollface:

@angusbjones
Copy link
Contributor

@jamill Definitely happy with both and very much hope I can be of more use in the libraries future!
Also thanks for guidance on the changes @nulltoken @ethomson @jamill @dahlbyk (and anyone I missed among the many comments :S)

@nulltoken
Copy link
Member

@jamill 👍
Squash?

[Fact]
public void IsUpToDateMerge()
{
string sharedBranchFileName = "first+second branch file.txt";
Copy link
Member

Choose a reason for hiding this comment

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

const?

Bring initial merge functionality to LibGit2Sharp.
@jamill
Copy link
Member Author

jamill commented Jan 16, 2014

@nulltoken squashed, added the const modifier to the rest of the strings, and moved to a single merger param.

@nulltoken nulltoken merged commit cc4bb2d into libgit2:vNext Jan 16, 2014
@nulltoken
Copy link
Member

@jamill @CrumblyCake Merged. Amazing job! Thanks thousands to both of you ✨

This was referenced Jan 16, 2014

Assert.Equal(MergeStatus.FastForward, mergeResult.Status);
Assert.Equal(repo.Branches["FirstBranch"].Tip, mergeResult.Commit);
Assert.Equal(repo.Branches["FirstBranch"].Tip, repo.Head.Tip);
Copy link
Contributor

Choose a reason for hiding this comment

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

@jamill @nulltoken
Hi guys,
I'm implementing a bit of the merge stuff now and on fast forwards the head is being detached onto the merged commit. The reason these tests pass is because I must've screwed up on these lines. They should be checking the SecondBranch as it's the one that has been merged up to FirstBranch.

Assert.Equal(repo.Branches["SecondBranch"].Tip, mergeResult.Commit);
Assert.Equal(repo.Branches["SecondBranch"].Tip, repo.Head.Tip);

The change I made to pass the tests with is below:
https://github.com/libgit2/libgit2sharp/pull/608/files#r9262152

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.

5 participants