Code Monkey home page Code Monkey logo

cgs's Introduction

cgs

Description

cgs (check-git-status) is a simple tool for us forgetful people. Namely what the tool does is checks a folder with git repositories for ones that have been changed but not committed. All that to avoid unnecessary merges and conflicts.

Dependencies

Git - obviously

Unix based system

Usage

cgs <flags>

By default cgs assumes that repositories are categorized in one of the following way in a root folder as show by the tree below.

root_folder
├── category1
│   ├── repository1
│   ├── repository2
│   ├── repository3
│   ├── repository4
│   └── repository5
├── category2
│   ├── repository1
│   ├── repository2
│   ├── repository3
│   ├── repository4
│   ├── repository5
│   └── repository6
├── repository1
└── repository2

Repository must be either the first sub-folder in the root folder or the first sub-folder of a categorizing folder (whether it was sorted by language or anything else). Root folder is being determined by the CODE environmental variable and it is recommended to have it set up in your .bashrc file as follows:

export CODE=/path/to/your/repos/folder

Otherwise it will not work as it was designed to require minimal typing in the actual command line to work.

Output of the program is "Everything is up to date" if there are no commits to be made or a listing of all repositories and their respective categorizing folders:

category1             repo5
category4             repo1
repo1
repo3

Additional flags

Few options are available that pretty print the stats:

-l - shows all categories and number of repositories in them. Below that are listed all the uncommitted repositories.

category1           2  1
category2           5
category3          22  3
category4          12
category5           3

category1          repo1  
category3          repo2  
category3          repo5  
category3          repo8  

-ll - shows all categories and their repositories in a tree like form (same as tree linux program) with uncommitted ones being highlighted in red:

.
├── category1 (5)
│   ├── repository1
│   ├── repository2
│   ├── repository3
│   ├── repository4
│   └── repository5
├── category2 (6)
│   ├── repository1
│   ├── repository2
│   ├── repository3
│   ├── repository4
│   ├── repository5
│   └── repository6
├── repository1 (1)
└── repository2 (1)

--no-color - available to disable color output for usage in other command parsing programs like exec/execp command in conky.

-d - outputs the absolute path to the repository. Assumes --no-color. Useful for dmenu scripting.

Build

You can build the program however you like just remember to link pthread. There is a Makefile with predefined recipes and you can just run them with:

make install

Make symlinks the ./build/cgs into /usr/bin.

cgs's People

Contributors

7aske avatar

Watchers

 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.