Hacker News new | past | comments | ask | show | jobs | submit login
How to search for a commit message in GitHub? (stackoverflow.com)
50 points by nkurz on Aug 7, 2015 | hide | past | favorite | 10 comments



I post this because I was astonished to find that GitHub did not provide a way to search commit messages. I was even more astonished to find that they once had supported this seemingly essential search but no longer do. Even with "billions" of commits across the entire site, this doesn't seem like a particularly difficult task, since the searches typically are restricted to a particular project.

So instead of dealing with a single very large, very rapidly changing index, one can reduce the problem to maintaining a large number of small to medium size indexes, most of which change very slowly. Is this somehow more difficult than it seems? Or perhaps an opportunity for a third party to step in and provide a useful service that GitHub might be wise to acquire?


As someone who has developed a product that will let you search a Git repository, I can say there is a lot of moving parts. And I can see why Bitbucket, GitHub, and others don't support it. Working at their scale does present a lot of challenges.

The biggest challenge is knowing what to consider and I solve this by enforcing a context for every search. For example, if I know you are looking at 7 different branches, as the image below shows:

http://i.imgur.com/L7aHr2r.png

I will only consider these branches when you do a search.

http://i.imgur.com/JYHgB6I.png

Searching code presents a unique challenge since your code base is constantly changing. And without the user giving you hints about what to consider, you'll just end up generating a lot of noise.

Another example of how context simplifies things, is in the image below, I know you are looking at a tree

http://i.imgur.com/l8Y0oLA.png

so I will only search that tree

http://i.imgur.com/CIxHPjr.png

When searching code, you really can't guess what is important or not since what mattered in the morning may not in the evening. You really need the user to guide you and as you can see in my screenshots, I had to implement a new way of exploring Git. The current way of browsing one repository at a time will not work in a lot of enterprise environments since a product is usually a combination of branches from different repositories from different time lines.


For the record, BitBucket (and the on-premises equivalent, Stash) offer even less searching.

I do believe advanced code searching across repositories could be a viable product (e.g. like FishEye which offers really advanced searching) but I struggle to see how it could be monetized.


Fwiw, I think BitBucket is slow in this regard (according to the ticket) because they're worried you can just search AWS keys up that were accidentally committed (which has historically been an issue on github)


This is such a pain in the butt for us on a weekly basis. Being able to search commit messages would make my life a lot easier.


I use SourceTree almost exclusively for this feature. They allow you to search any commit message in a repo. Such a hidden gem.


across ALL repos or just a central repo and its branches?


My preferred method, if the needle is really deep in the gitstack, clone with hg-git and use revsets:

https://selenic.com/hg/help/revsets

Any hgweb instance allows revsets, e.g.

http://lists.gnu.org/archive/html/octave-maintainers/2014-02...


the simplest way is "git --no-pager" log | grep "the message you are looking for"


or just git log --grep "the message you are looking for"? But that doesn't solve the problem of multiple repositories though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: