sindresorhus/refined-github

`pr-branches` doesn't show the branches when they're from a fork #2943

jack1142 posted onGitHub

I'm sorry that I don't have anything more specific, the branches just don't show on the pull requests list. pr-branches is showing in the console but none of the PRs have info about their head branch below them and there's 20 PRs on that page and all of them are mine.

URL: https://github.com/Cog-Creators/Red-DiscordBot/pulls?q=is%3Apr+sort%3Aupdated-desc+author%3Ajack1142+is%3Aopen Screenshot: image

Maybe this will help a little - on refined-github's closed PRs list, the branch is showing for PRs made from the sindresorhus/refined-github repo, but it doesn't show for my PRs (made from the fork): image


It only shows if the branch is a local branch

posted by yakov116 about 5 years ago

It only shows if the branch is a local branch

Well, yes, that's the bug I'm reporting here, I guess I should have made the title more clear.

I'm rather sure that is not intended behaviour, as there's an if that depending on whether the repo's head is on same repo or fork will add (or not) the repo's owner: https://github.com/sindresorhus/refined-github/blob/6cd2344a487baca79dfea1bb918705f0e069fdd3/source/features/pr-branches.tsx#L45-L49

posted by jack1142 about 5 years ago

The exact situations in which to display the branch name was discussed in the original PR.

This was done because often this piece of information isn’t useful, e.g. I don’t care what branch user-x created the PR from, especially on the list, which is already crowded.

I’m guessing in this case that again it’s due to the case, rather than our logic.

posted by fregante about 5 years ago

I’m guessing in this case that again it’s due to the case, rather than our logic.

@fregante sorry to bother, but I don't quite get what you meant to say in this sentence? Maybe it's just late but figured I'll ask.


As for the issue, I don't quite get what's the use case of "From branch-name" that shows for source repo that isn't common with use cases of showing user's own branch names from a fork. You're right that user doesn't care what branch user-x created the PR from but I do think that when user is in fact user-x this changes cause it can become quite useful for managing your branches.

My use case is mostly the same as #190 which the original PR was supposed to solve too. I'm guessing that having #2914 instead would be enough but I didn't get any feedback there and I was pretty sure that I saw pr-branches showing for my PRs from a fork before so I'm actually surprised to hear it isn't a bug.

posted by jack1142 about 5 years ago

@fregante sorry to bother, but I don't quite get what you meant to say in this sentence? Maybe it's just late but figured I'll ask.

As your previous issues, they're because your organization and repo are not in lower case, so we have troubles matching it.

posted by fregante about 5 years ago

I checked, this is working as intended, it's in the logic:

  • only show local branches.

As shown by:

https://github.com/sindresorhus/refined-github/blob/6cd2344a487baca79dfea1bb918705f0e069fdd3/source/features/pr-branches.tsx#L122-L124

We do have some code that appears to support cross-repo branches, but it was probably left behind.

https://github.com/sindresorhus/refined-github/blob/6cd2344a487baca79dfea1bb918705f0e069fdd3/source/features/pr-branches.tsx#L47-L49


Honestly it's not a feature I find particularly useful in the first place, it's mostly just clutter to me, except the non-default base part.


Why do you need this information in the list?

posted by fregante about 5 years ago

I would love for to work on forks

posted by yakov116 about 5 years ago

Why do you need this information in the list?

My use cases involve branch management of both local repo and remote repo:

  • when I have list of all (both open and closed/merged) PRs
    • check what some branch is for (but I probably would need that rarely)
  • when I have list of closed/merged PRs
    • removing branches on both local and remote (I can't use git branch --merged cause we're using squash merging)

As I mentioned earlier though, for my use cases #2914 would work quite great too, but I don't know if it's something that could be added to refined-github.

posted by jack1142 about 5 years ago

Both of those would be better solved by auto-deletion, which Refined GitHub already provides (and GitHub too, if you set it in your fork’s settings)

As for the local branches, I usually just delete everything locally and pull again.

Your current situation requires a lot of manual work that you could skip altogether with these 2 suggestions.

posted by fregante about 5 years ago

If you mean the "Automatically delete head branches" in repo's settings, it does not work if the PR is not done in same repository

posted by jack1142 about 5 years ago

@jack1142 was #3116 enough. I think this solved the issue.

posted by yakov116 almost 5 years ago

The reasons I listed here before are solved, however I sometimes (not sure if it's that often but I once wanted to comment about it before) do wish to see the branch name on open PRs list (though I think more often I wish it for milestone view, I would need to make a separate feature request for that, if this issue gets resolved). The feature seems completely useless (and I don't mean to offend anyone here by this statement, the bolded part is the key here) to me in workflow I use where the people from the organisation make the branches on their forks and create PRs from those, instead of creating the branches on "source" repo. I only wish to see my branches, not everyone in the organisation but this right now is not fulfilled by this feature.

I have asked for several things that improve that workflow: #2810, #2812, #2815, #2914 and I've been happy so far with all the things you guys added for this :)

I understand if you don't want to pursue this one, though I must say that I think that what I'm requesting here would have same purpose as showing local branches so I don't really agree that this shouldn't be part of pr-branches feature.

posted by jack1142 almost 5 years ago

Fund this Issue

$0.00
Funded

Pull requests