Skip to content

Surface overlapping PRs in pr_file_map.py to ease landing PRs - #15321

Open
priya-sundaram-dev wants to merge 1 commit into
TheAlgorithms:masterfrom
priya-sundaram-dev:improve-pr-file-map-conflicts
Open

Surface overlapping PRs in pr_file_map.py to ease landing PRs#15321
priya-sundaram-dev wants to merge 1 commit into
TheAlgorithms:masterfrom
priya-sundaram-dev:improve-pr-file-map-conflicts

Conversation

@priya-sundaram-dev

Copy link
Copy Markdown
Contributor

Describe your change

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Follow-up to #15317, as suggested by @cclauss, to make scripts/pr_file_map.py more useful for landing pull requests.

What changed

  • Surface overlapping PRs. New first section, "files touched by more than one open PR (possible merge conflicts)", sorted with the most-contested files first. When two or more open PRs edit the same file, they'll likely conflict on merge, so seeing those hot spots at a glance helps decide what to land, batch, or ask to rebase.
  • Two clear file totals instead of one ambiguous count. The old Number of files summed len(pr_files) across every PR, so a file edited by three PRs was counted three times and the total could exceed existing + missing. It now reports:
    • File touches (PR x file) -- every (PR, file) pair, and
    • Distinct files touched -- each path once (this one equals existing + missing).
  • Docstring and stderr status updated to match; the contested count is also logged to stderr.

No new dependencies; only scripts/pr_file_map.py changes.

Checklist

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one file.

Add a 'files touched by more than one open PR' section (sorted with the
most-contested files first) so overlapping PRs -- the likely merge-conflict
hot spots -- are visible at a glance when deciding what to land.

Also report two distinct file totals: 'file touches' (every PR x file pair)
and 'distinct files touched'. Only the distinct total equals existing +
missing, which fixes the earlier single count that double-counted files
edited by multiple PRs.
@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Sep 14, 2026
@cclauss

cclauss commented Sep 14, 2026

Copy link
Copy Markdown
Member

I think we can remove DIRECTORY.md since many PRs torch that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants