Bug 402425 - Pull Request task only sees Github repo when it is 'origin'
Summary: Pull Request task only sees Github repo when it is 'origin'
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: GitHub (show other bugs)
Version: 2.3   Edit
Hardware: PC Linux
: P3 minor with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-05 07:03 EST by Nevik Rehnel CLA
Modified: 2018-09-22 15:10 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nevik Rehnel CLA 2013-03-05 07:03:08 EST
When opening a Git Commit from within a pull request (the Mylyn task for a pull request as provided by the Github connector), Egit tries to find out which (local) repo belongs to that Github repo.

It seems that it only checks remotes named 'origin' for this.

This is annoying when maintaining or contributing to more than one fork (e.g. an "official" origanization repo and one's own fork), because that way you'd have to maintain two clones to be able to connect Issues from both Github repos.

I would have looked into the code to suggest a concrete fix, but I have no idea from where this check "Do I know of a clone of this Github repo?" is done, and from where it is answered.


Reproduction steps:
a) Add a Mylyn task (and query) repository for a repo's pull requests (there should be an existing PR to test this)
b) Clone that repo (using Egit or using Git and then "Add local repo" in Egit)
c) Open a PR task from that repo in the Eclipse Task viewer, double-click one of the commits; it will find the corresponding clone, and open the commit (if you have it) or ask if you want to fetch it (if you dont have it yet); this is correct behavior
d) Rename the remote "origin" to something else (afaik this is not possible in Egit, you can use `git remote rename origin github` to rename it to "github")
e) refresh the repository view in eclipse, and try to double-click the same commit in the task view; Egit tells you "The Git repository for 'USER/REPO' was not found. Please add or clone it using the Git Repositories view."


Suggestion:
1) Egit should check all remotes
OR
2) add a per-task-repo setting in which you can explicitly tell Egit which Git repo corresponds to that task repo.