Skip to content

Teach Remote to transform references using its default fetchspec#349

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

Teach Remote to transform references using its default fetchspec#349
jamill wants to merge 1 commit into
libgit2:vNextfrom
jamill:fetchspec_transform

Conversation

@jamill

@jamill jamill commented Feb 21, 2013

Copy link
Copy Markdown
Member

Expose the refspec transform for a remote's default fetchspec.

@nulltoken

Copy link
Copy Markdown
Member

@jamill Could you please share some information describing when this feature should be used from the consumer standpoint?

@jamill

jamill commented Feb 25, 2013

Copy link
Copy Markdown
Member Author

@nulltoken This can be used to identify the remote branch that a local branch would track when it is pushed up to the server. With the current API to set the upstream tracking branch, you have to pass in the reference to the tracked branch. This means to push up a new branch (refs/heads/new_branch) and set the upstream, you need to know the upstream branch that it will correspond to (through this transformation).

After pushing this up, I think a better way to achieve this is to expose a way to set the upstream remote / merge branch directly on a local branch (so, I could set the merge branch directly as refs/heads/new_branch on a local branch). I will submit a new PR exposing this functionality shortly.

This method still could still be useful if you wanted to check what a local branch's remote branch would be...

@jamill

jamill commented Mar 15, 2013

Copy link
Copy Markdown
Member Author

@nulltoken - with #353, I don't think this functionality is explicity required for my scenario - but it does work and might be useful later on (or to someone else). Howe would you like to proceed? Is this functionality something that might be useful?

@nulltoken

Copy link
Copy Markdown
Member

It looks a little bit low level, but I'd hate ditching this. Can you think about a user scenario which would require such feature?
On a different topic, I'm not a huge fan of the names of the functions. How about something like MapTo[Source|Target]Reference?

/cc @carlosmn @dahlbyk

@yorah yorah mentioned this pull request Apr 5, 2013
2 tasks
@yorah

yorah commented Jul 1, 2013

Copy link
Copy Markdown
Contributor

@jamill I included part of this PR in #385 (Remote.FetchSpecTransformToSource()). Do you see other use cases for which we would need to implement Remote.FetchSpecTransformToTarget() in libgit2sharp?

If the answer is no, maybe we could close this issue :)

@jamill

jamill commented Jul 1, 2013

Copy link
Copy Markdown
Member Author

I don't have other use cases for this at this time. I will close it now. Thanks.

@jamill jamill closed this Jul 1, 2013
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