Coder Social home page Coder Social logo

fcom's Introduction

GitHub tag (latest SemVer pre-release)

fcom ("find commit(s)")

This is a CLI tool that I use to parse the git history of a repo.

For example, if I use fcom to search this repo with fcom "line.(green|red)" --regex --repo davidrunger/fcom, I get this output:

Installation

gem install fcom

Dependencies

This gem assumes that you have git and rg (ripgrep) installed.

Basic usage

$ fcom <search string> [options]

Available options and examples

After installing, execute fcom --help to see usage examples and available options.

$ fcom --help

Usage: fcom <search string> [options]

Examples:
  fcom update
  fcom 'def update'
  fcom "def update" --days 60
  fcom "[Uu]ser.*slug" -d 365 --regex
  fcom options --path spec/
  fcom "line.(green|red)" -d 365 --regex --repo davidrunger/fcom -a "David Runger"

    --repo             GitHub repo (in form `username/repo`)
    -d, --days         number of days to search back
    -r, --regex        interpret search string as a regular expression
    -i, --ignore-case  search case-insensitively
    -p, --path         path (directory or file) used to filter results
    -a, --author       author
    --rg-options       additional options passed directly to `rg` (e.g. `--rg-options "--max-columns 1000"`)
    --debug            print debugging info
    --init             create an `.fcom.yml` config file
    -v, --version      print the version
    -h, --help         print this help information

.fcom.yml config file

We highly recommend that you create an .fcom.yml file in any repository that you plan to search with fcom.

This file can be created automatically by executing fcom --init in the relevant repo/directory.

(You might (or might not) want to add .fcom.yml to your ~/.gitignore_global file, so that this file is not tracked by git.)

Example .fcom.yml config file

repo: githubusername/reponame

The advantage of creating an .fcom.yml config file is that it will make the fcom command execute more quickly, because time will not be wasted parsing the output of git remote [...] in order to determine the URL of the repo's remote repository (which is used to construct links to matching commits).

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run (in this repository's root directory):

$ rm -f pkg/*.gem && rake build && gem install --local pkg/fcom-*.gem

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/davidrunger/fcom.

License

The gem is available as open source under the terms of the MIT License.

fcom's People

Contributors

davidrunger avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.