-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add an option to choose oldest associated PR with a commit vs newest #1913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
GitLens currently asks GitHub for the two most recently updated PRs, and if there is more than one result, then it sorts them first by matching repo owner (to deal with PRs on forks), then open PRs first, and then by updated date/time. The goal is to return the most recently updated PR. Are you looking for the oldest PR? |
Ok, sounds like some though has been put into it already, so maybe my opinion / use case is a bit unusual.
Yeah, I guess so – usually, I'm interested in reading the PR description and/or finding related issues, which in my org are found most easily by the original (oldest) PR where the change was first proposed + merged. Also worth noting is that, in cases where I'm using Based on your description of the issue, it sounds like maybe a configuration option would make sense, since perhaps my preferred heuristic for linking a PR is different from other users'. |
Interesting -- I'll have to look a bit more into this scenario to better understand what I can do here. I'm not sure I can reasonably tell the "branch" when using the But as for picking the oldest vs the newest, I think it makes sense to offer an option here. |
…given commit Currently, the pull request selected for a commit is the most recently updated one. As mentioned in gitkraken#1913, this is not always desired, for example when a feature merges to one branch, and then that branch is merged into additional branches. This adds a setting to order by updated or created time, ascending or descending. It preserves the other behavior, of preference based on owner and merged status.
…given commit Currently, the pull request selected for a commit is the most recently updated one. As mentioned in gitkraken#1913, this is not always desired, for example when a feature merges to one branch, and then that branch is merged into additional branches. This adds a setting to order by updated or created time, ascending or descending. It preserves the other behavior, of preference based on owner and merged status.
…given commit Currently, the pull request selected for a commit is the most recently updated one. As mentioned in gitkraken#1913, this is not always desired, for example when a feature merges to one branch, and then that branch is merged into additional branches. This adds a setting to order by updated or created time, ascending or descending. It preserves the other behavior, of preference based on owner and merged status.
…given commit Currently, the pull request selected for a commit is the most recently updated one. As mentioned in gitkraken#1913, this is not always desired, for example when a feature merges to one branch, and then that branch is merged into additional branches. This adds a setting to order by updated or created time, ascending or descending. It preserves the other behavior, of preference based on owner and merged status.
First, let me set some context – my organization maintains a number of active branches for backporting fixes to older versions of software. In most cases, the fix is delivered to an old branch, then merged forward in a later pull request. I believe this is part of the root cause of the problem.
Steps to Reproduce:
Open File At Revision From...
and choose the branch the first PR was originally targeted to (maybe not necessary? just how I reproduce it)via PR#
message.In my case, the resulting PR number seemed to the be the second-lowest numbered PR associated with the commit, but that might just be change. I think it would be preferable to use the lowest-numbered PR associated with the commit, although perhaps others would prefer something else, so maybe this would need to be configurable if there is a use-case for higher numbered PRs?
Alternatively, show all the PRs associated with a commit, but that seems more difficult to integrate in the UI etc., and is probably not very helpful anyway.
Unfortunately, the repo I saw this in is private, but please let me know if there's anything else I can provide to help. If necessary I can probably reproduce in a new public repository as well.
The text was updated successfully, but these errors were encountered: