Skip to content

Teach BranchUpdater to set merge branch directly#353

Closed
jamill wants to merge 1 commit into
libgit2:vNextfrom
jamill:branch_updater
Closed

Teach BranchUpdater to set merge branch directly#353
jamill wants to merge 1 commit into
libgit2:vNextfrom
jamill:branch_updater

Conversation

@jamill

@jamill jamill commented Feb 25, 2013

Copy link
Copy Markdown
Member

This PR lets us set the upstream remote and merge branch onto a local branch directly.

This is useful when we are pushing a new local branch to a remote and want to set the upstream tracking info. Instead of performing the refspec transform to identify the name of the tracked branch in the refs/remotes namespace, we can set the merge branch directly (e.g., using the transforms exposed in #349)

Comment thread LibGit2Sharp.Tests/BranchFixture.cs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of exposing a method, how about exposing two properties (maybe RemoteName and MergeBranchName)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hmm... and pass each one seperately through the branch updater? we could do it that way.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could define SetUpstreamTo() as an extension method for convenience, but expose all the possible mutations for BranchUpdater as properties.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could define SetUpstreamTo() as an extension method for convenience

Actually, I'd rather not. At least, for now.

I'd like to try and settle a property based access only for xxxUpdaters in order to see how far we can stretch this out while keeping it usable. Adding methods in the mix may blur the picture a little bit.

@jamill

jamill commented Mar 15, 2013

Copy link
Copy Markdown
Member Author

Updated - I added two properties UpstreamRemote and UpstreamMergeBranch - I could change these to @nulltoken 's proposed names RemoteName and MergeBranchName if people feel that is more appropriate.

@nulltoken

Copy link
Copy Markdown
Member

Updated - I added two properties UpstreamRemote and UpstreamMergeBranch

Perfect! And... merged 💥

@nulltoken nulltoken closed this Mar 17, 2013
@jamill

jamill commented Mar 18, 2013

Copy link
Copy Markdown
Member Author

@nulltoken Thanks!

@jamill
jamill deleted the branch_updater branch March 18, 2013 13:59
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