ghedo / p5-Dist-Zilla-Plugin-GitHub

Plugins to integrate Dist::Zilla with GitHub
http://metacpan.org/release/Dist-Zilla-Plugin-GitHub/
Other
13 stars 18 forks source link

Point to organization's URLs if forked from there #5

Closed ghost closed 13 years ago

ghost commented 13 years ago

Is it possible to check whether the repo was forked from an organization's repo? If so, it'd be nice to point to that instead of the user's individual fork. For example, the org may have issues enabled, but the user may not.

ghedo commented 13 years ago

AFAIK it is possible to check whether a repo is a fork (through the Github API), but not from where it was forked. Alternatively I could add an org option, to be used to generate the API request, but it'll have to be set manually, and won't work with the GitHub::Update plugin unless you have admin (?) access to the org's repository.

This is something I have been thinking about for a while, but never managed to implement, so, if you find this useful, I'll start working on it ASAP.

ghost commented 13 years ago

I'd rather see links point to wherever the repo forked from - this actually isn't specific to organizations, now that I think of it. If it was forked from some other user's repo, then we should point back to that, in all likelihood. I suppose it might make sense to have an option to disable that...

ghedo commented 13 years ago

Ok, I cannot make it point automatically to the original repo. I was thinking about something like a fork option for the GitHub::Meta plugin, with values in the form <user>/<repo> (where user and repo are the original ones) or something similar. What do you think?

ghost commented 13 years ago

That'll do fine.

ghedo commented 13 years ago

Just ignore what I said... it is possible to know from where a repository was forked from, through the API. I just didn't pay enough attention. Working on it right now.

ghedo commented 13 years ago

Pushed, and uploaded to CPAN. It seems to work, but some testing is appreciated (you don't have to do anything fancy, just dzil build and check whether META.{yml,json} have the correct information).

ghost commented 13 years ago

Perfect! Thanks so much

thaljef commented 12 years ago

Just curious -- why would you rather see a link to the original repository? If I want to fork and make a pull request, I would want to do it with the repository that actually produced the dist. The original repository could be dead for all I know.

As I understand the code, GitHub::Meta merely looks for the immediate parent repository, which may not be the "original" repository anyway. A repository could be a fork of a fork (of a fork...). To do this right, I think it would have to be recursive.

But perhaps I don't understand how GitHub really works. Your thoughts?

-Jeff

ghedo commented 12 years ago

@thaljef it is useful, for example, when you are developing a project through an organization but you are doing all the development on your personal fork (e.g. MediaWiki-Bot/MediaWiki-Bot and mikelifeguard/MediaWiki-Bot). This was basically where it all started IIRC.

thaljef commented 12 years ago

Hmm, I guess folks use GitHub differently than I expected. I would have thought that the organizational repository would pull changes from the personal forks, and releases would be made from the organizational repository. I'll have to setup an organization for myself and see how it works. Thanks for enlightening me.