![]() ![]() (Be warned that if your search term appears in hundreds of commits, this may well crash your browser and eat your PC's CPU for a while. Then, from anywhere in your Git repository, just do this at the terminal: githubsearch "what you want to search for"Īnd any commits that match your (case insensitive) search term will have their corresponding GitHub pages opened in your browser. as githubsearch.sh, make it executable ( chmod +x githubsearch.sh) and then add the following alias to your ~/.bashrc file: alias githubsearch='/path/to/githubsearch.sh' Just replace with the actual GitHub URL of your repository, save the script somewhere (e.g. Python -mwebbrowser $sha1 >/dev/null 2>/dev/null If you have a local version of the repository, you might want to try this crude shell script I wrote to open the GitHub pages for all commits matching your search term in new tabs in your default browser: #!/bin/shįor sha1 in $(git rev-list HEAD -i -grep="$1") do (More options at " How to search a Git repository by commit message?") Note that it isn't impossible to get one's own elasticsearch local indexing of a local clone: see " Searching a git repository with ElasticSearch"īut for a specific repo, the easiest remains to clone it and do a: git log -all -grep='my search' That all means not all the branches of all the repo would be indexed with that approach.Ī global commit message search isn't available for now.Īnd Tim Pease himself confirms commit messages are not indexed. We need to add these files, and all that.” It’s self-healing and that’s the approach that we have taken with pretty much all of the architecture. You can just say, “Okay, we need to remove these files. You do a git diff and you get all the files that have been updated, deleted, or added. If we missed, just happen to miss three commits where those jobs fail, the next commit that comes in, we’re still looking at the diff between the previous commit that we indexed and the one that we’re seeing with this new push. We have that repository document which keeps track of the last indexed commit. Tim Pease: With indexing source code on push, it’s a self-healing process. It’s only the head of the master branch that you’re going to get in there and still that’s a lot of data, two billion documents, 30 terabytes.Īndrew Cholakian: That is awesomely huge. We don’t have to re-index the entire source code tree every time someone pushes.Īndrew Cholakian: So, you guys only index, I’m assuming, the master branch. Then we can go ahead and just update those documents which have been changed. We then see the most recently indexed commit and then we get a list of all the files that had been modified, or added, or deleted between this recent push and what we have previously indexed. When a user pushes a new commit up to Github, we then pull that repository document from elasticsearch. Repository documents keep track of the most recent commit for that particular repository that has been indexed. The way that git works is you have commits and you have a branch for each commit. Tim Pease: We have two document types in there: One is a source code file and the other one is a repository. You can now search for commit messages! (still only in the master branch)įebruary 2015: Not sure that could ever be possible, considering the current search infrastructure base on Elasticsearch (introduced in January 2013).Īs an answer "drawing from credible and/or official sources", here is an interview done with the GitHub people in charge of introducing Elasticsearch at GitHub (August 2013) # search commits committed by user "monalisa" # search commits matching phrase "bug fix" 2023), you can search from within your local cloned GitHub repository:Įxamples: # search commits matching set of keywords "readme" and "typo" This project exists thanks to all the people who contribute.īrowserStack for letting open source projects use their services for free.With the GitHub CLI gh v2.22.0 (Jan. Your logo will show up here with a link to your website. Support this project by becoming a sponsor. The resulting timeline allows paging into the older history, each commit could be clicked for details. ![]() You can use Git History for local git repos with the CLI or with the VS Code extension. In GitHub theres a path /commits to see the a sequential list of commits leading up to a given commit or a branch. For example, if you want to see some abbreviated stats for each commit, you can use the -stat option: git log -stat commit. You can also use a series of summarizing options with git log. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |