GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DiUw/gitlab-global-code-search

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
README.md
README.md
 
 
config.yml.example
config.yml.example
 
 
gitlab_global_code_search.rb
gitlab_global_code_search.rb
 
 

Repository files navigation

General

Will search through all known Gitlab projects on YOUR own instrance of GitLab.

Projects permisson must be set to public for script to work

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

Script was tested on Gitlab community version 11.8.1

GITLAB_URL: https://your.gitlab.uri   (What is your Gitlab url, use http:// if https:// isn't configured)
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

Note below bundle isn't needed, because the script seems to only dependt on have ruby installed.

Script was tested with:

ruby: 2.5.5p157
gem: 2.7.6.2

If errors occours with json, try installing bundle with the code below. The code might need sudo permissons for installations, check the erorrs for permisson errors. run this code within this repo, to locate the gemfile

$ gem install bundler:1.11.2

$ gem install json


$ bundle install

# if json fails, try

$ gem 'json', '>= 1.8' or $ gem install json -v '1.8.3'

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 'azure' in all found project code
./gitlab_global_code_search.rb -s azure -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

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

7 stars

Watchers

1 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.