Git Product home page Git Product logo

gitlab-global-code-search's Introduction

General

Will search through all known Gitlab projects on YOUR own instrance of GitLab. Currently doesn't seem to be supported feature on GitLab itself.

Code is tested with GitLab Community Edition 8.6.6. It is really fitted to work with this specific version, never tested it with any other.

Before the first run, please replace 4 params in config.yml:

GITLAB_URL: https://your.gitlab.uri   (What is your Gitlab url)
PRIVATE_TOKEN: YOUR_TOKEN (Token to use to talk to gitlab. Needs to be admin token)
REMEMBER_USER_TOKEN: YOUR_COOKIE_TOKEN (Your gitlab login cookie token)
COLOUR: true (if 'false', results are printed in monochrome)

You can safely copy config.yml.example to config.yml and edit.

Usage

$ bundle install

Usage: ./gitlab_global_code_search [options]
    -d, --dryrun
    -r, --recache
    -s SEARCH_STRING,                [REQUIRED]
        --search-string
    -n, --namespaces NAMESPACES      [REQUIRED] Comma separated list of namespaces (you can set namespaces=all to search through all Gitlab repos, but mind the Load on the server

First time project runs it will need to create local cache, so don't wonder why it loads 100 projects per GitLab page.

Next time you need to recache use --recache option

Examples

  • Locate word 'curl' in all found project code
./gitlab_global_code_search.rb -s curl -n all
  • Locate word 'findme' in projects with namespaces namespace1 and namespace2
./gitlab_global_code_search.rb -s findme -n namespace1,namespace2
  • Locate word 'foo' in project with namespace namespace1 and print results to foo.txt
./gitlab_global_code_search.rb -s foo -n namespace1 | tee result/foo.txt

gitlab-global-code-search's People

Contributors

opt9 avatar diuw avatar

Watchers

James Cloos avatar jianfree avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.