Skip to content

GitHub diff files filter

Rob Garrison edited this page Jun 26, 2017 · 30 revisions

A userscript that adds filters that toggle diff & PR files by extension

  • A group of buttons are added above diff & pull request files, each one is set to filter a file name extension.
  • The filters are only visible when there is more than one type of file extension present in the folder.
  • Files with no extension will be labeled as "«no-ext»".
  • Click on one or more buttons to toggle the view of the files.
  • Hovering over the filter will show the number of files of that type.
  • Special Filters:
    • The "«all»" filter button toggles the view of all files.
    • The "«no-ext»" filter button toggles all files that do not have an extension. It is only added if such files exist.
    • The "«dot-files»" filter button toggles all dot-files (e.g. .gitignore, .gitattributes, etc). It is only added if such files exist.
  • Original idea from the Github Pr Filter extension.
  • Click this link to install from GitHub, or install from GreasyFork.
  • After installing, try the userscript on this page: repo inital commit.

Screenshot

github-diff-files-filter

Change Log

Version 0.1.8 (5/16/2017)

  • Change license to MIT.

Version 0.1.7 (4/21/2017)

  • Update mutation url.

Version 0.1.4 - 0.1.6 (4/13/2017)

  • Allow updating of filters.
  • Switch to using mutations.js.
  • Added tooltip showing the number of files for each filter.

Version 0.1.3 (3/25/2017)

  • Use pjax event & fix linting.

Version 0.1.2 (1/11/2017)

  • Clean up "closest" function.

Version 0.1.1 (01/02/2016)

  • Check for empty arrays, then check type length.

Version 0.1.0 (12/31/2016)

  • Initial commit.
Clone this wiki locally