1

Is there a way to search GitHub but constrain the search to a commit or range of commits. I often find myself navigating via blame or history to a specific commit, then wanting to search around the repo at this specific point in time:

enter image description here

I'm surprised I can't find any similar questions on SO, maybe I'm missing something obvious or its not possible?

I tried filtering by date but that seems to only operate on commits and won't show me any "Code" results

Christian
  • 4,902
  • 4
  • 24
  • 42
chanban
  • 480
  • 1
  • 4
  • 19
  • Could these feature requests be related? https://github.com/gitextensions/gitextensions/issues/8448 or https://github.com/sourcegraph/sourcegraph/issues/2307 – Christian Nov 02 '22 at 21:46
  • If you can use git, this could be helpful: https://stackoverflow.com/questions/9658110/git-diff-on-date or https://stackoverflow.com/questions/37311494/how-to-get-git-to-show-commits-in-a-specified-date-range-for-author-date – Christian Nov 02 '22 at 21:47

1 Answers1

0

You can use the standard/advanced search by adding commit: 3A+a5494cb144af5d3b6d1854c2dbe3f3fae3050b2d, for example: https://github.com/search?q=commit%3A+a5494cb144af5d3b6d1854c2dbe3f3fae3050b2d&type=commits

Related? How can I search for a commit message on GitHub?

&type=code also works, see https://github.com/cadamini/cadamini.github.io/search?q=regex&type=code but it doesn't seem to be available in the UI (simple/advanced search). You can click Code on the search results page or edit the URL.

Christian
  • 4,902
  • 4
  • 24
  • 42
  • This only seems to search for commits with a given SHA. I want to search the repo (aka "&type=code") at a given commit – chanban Nov 02 '22 at 06:08
  • &type=code works but not the date range, in GitHub there is only the option to set specific dates in the advanced search. See my comments under your original post for further ideas/refs. – Christian Nov 02 '22 at 21:48