Giter Site home page Giter Site logo

badele / gitcheck Goto Github PK

View Code? Open in Web Editor NEW
173.0 20.0 38.0 111 KB

Check multiple git repository in one pass / Vérifiez vos dépôt git en une seule passe

Home Page: http://bruno.adele.im/projets/gitcheck

License: GNU General Public License v3.0

Makefile 2.87% Python 97.13%

gitcheck's Introduction

https://travis-ci.org/badele/gitcheck.svg?branch=unittest

gitcheck

When working simultaneously on several git repositories, it is easy to loose the overview on the advancement of your work. This is why I decided to write gitcheck, a tool which reports the status of the repositories it finds in a file tree. This report can of course be displayed on the terminal but also be sent by email.

Now you can also check your host git from an docker container. See the docker section

Installation

pip install git+git://github.com/badele/gitcheck.git

Examples

Simple report

In a simple invocation, gitcheck shows for each repository found in the file tree rooted at the current working directory if they have changes to be committed or commits to be pushed.

$ gitcheck.py
Gitcheck simple report

Gitcheck simple report

Detailed report

This invocation is substantially identical to the previous one, but the generated report also enumerates modified files and pending commits.

$ gitcheck.py -v
Gitcheck detailed report

Gitcheck detailed report

Gitcheck customization

You can customize the output color, the gitcheck try to find ~/mygitcheck.py if it found, it is imported, see the mygitcheck.py.sample

Docker container

You can check your git repositories from an docker container (from your host)

From the host, you can use this command

$ docker run --rm -v `pwd`:/files:ro badele/alpine-gitcheck

or

$ docker run --rm -v `pwd`:/files:ro badele/alpine-gitcheck cd /files && gitcheck OPTIONS

You can also create a shell function into the host, exemple for ZSH

gitcheck (){
    docker run --rm -v `pwd`:/files:ro badele/alpine-gitcheck
}
#
$ gitcheck

More info about the gitcheck container https://registry.hub.docker.com/u/badele/alpine-gitcheck/

Options

-v, --verbose                        Show files & commits
--debug                              Show debug message
-r, --remote                         force remote update(slow)
-u, --untracked                      Show untracked files
-b, --bell                           bell on action needed
-w <sec>, --watch=<sec>              after displaying, wait <sec> and run again
-i <re>, --ignore-branch=<re>        ignore branches matching the regex <re>
-d <dir>, --dir=<dir>                Search <dir> for repositories
-m <maxdepth>, --maxdepth=<maxdepth> Limit the depth of repositories search
-q, --quiet                          Display info only when repository needs action
-e, --email                          Send an email with result as html, using mail.properties parameters
--init-email                         Initialize mail.properties file (has to be modified by user using JSON Format)

French version

A French version of this document is available here: http://bruno.adele.im/projets/gitcheck/

gitcheck's People

Contributors

agateau avatar badele avatar brorfred avatar christiantremblay avatar glennular avatar itarozzi avatar kynikos avatar ludovic-gasc avatar sdelafond avatar stormbrew avatar tessus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitcheck's Issues

Colors...

HI :)
There are any chance to customize the output colors?
In my terminal I must hack the gitcheck.py to change the colors because they
don't fit quite well in my color scheme....
Perhaps this could be added into a ".rc" file in the user's home directory...

Another thing, I think if the above did enter in consireration another thing
that could be changed is the the way that colored output is coded.
Why not use something like termcolor?

If there are any chance of those thing happen I'm very willing to make them :)

Thanks :)

Dependency Missing - ModuleNotFoundError: No module named 'colored'

I don't use Python so I installed everything from scratch

sudo apt install python3-pip
pip3 install git+git://github.com/badele/gitcheck.git

Now when I run it I get an error:

~/.local/bin/gitcheck
Traceback (most recent call last):
File "/home/me/.local/bin/gitcheck", line 5, in <module>
from gitcheck.gitcheck import main
File "/home/me/.local/lib/python3.8/site-packages/gitcheck/gitcheck.py", line 23, in <module>
from colored import fg, bg, attr
ModuleNotFoundError: No module named 'colored'

Obviously I can do pip3 install colored to fix this but you should include it as a dependency so this extra step is not required.

Add support for running within a single git repository

Thanks for gitcheck, it's awesome!

If I get super-used to the gitcheck output for my list of N repositories, I'd like to be able to drill into just one (cd repo_i_care_about_now), run gitcheck again, and see the same very nicely formatted results.

Seems like it shouldn't be too hard to add an "am I running in a git repo" check, assuming you think that's an acceptable usage.

Only shows develop branches on Ubuntu 14.04

Thank you for making this script - it has been very helpful. However, I just switched from Ubuntu 12.04 to 14.04 and noticed one big issue: it seems to only show repositories that are on develop branches. I checked out a feature branch for one repo and it disappeared from the gitcheck list. I switched back to develop, and it reappeared. The same thing happened when I checked out the master branch too. One of my colleagues also confirmed that he is seeing the same thing, so I don't think it is specific to my setup.

I hope you can look into this soon. I do not know what other information I can provide to help debug this, but let me know if there is anything I should try.

modified terminal colors persist after calling gitcheck

gitcheck on the command line leaves pink as the terminal's text color. This is with gitcheck == 0.3.22 within GNU bash, version 4.4.11(1)-release (x86_64-pc-linux-gnu) on a Debian 4.9.18-1 (2017-03-30) x86_64 GNU/Linux (Stretch).

Serious unicode issue on Python 2.7 with subprocess.popen

gitExec function doesn't work anymore with folder having unicode caracters in them

There's also a few lines missing specific unicode encoding/deconding to 'utf-8' (like the os.walk function to browse directories)

Probably problems due to Python 2.7

Thoughts about --auto-pull --auto-push flags?

Hey ;D

I'm a "heavy" user of gitcheck... and I love it ;D

I work on multiple computers everyday - my laptop, my desktop, the company desktop,
and every once in a while, a remote server. Since I'm working at same projects
in all of them I constantly have to push all my changes and pull as well.

So, I run gitcheck --remote --quiet just to discover the repos that
have changed and after that I need go to every repo and push/pull accordingly.
That's sucks a lot... I mean the gitcheck is doing its job great but yet I
need do a lot of manual stuff :/

With that in mind, I implemented a crude --auto-push and --auto-pull flags.
They work like that:

  1. Check if repo has something to pull.
  2. Check if repo has something to push.
  3. If only pull is true - make a pull.
  4. If only push is true - make a push.

Yep, that's it... nothing fancy at this stage. But something interesting can
be worked out... like:

  • try to pull first and if no merge conflicts occurs then push.
  • if a merge conflict happened revert the merge.
  • etc...

I don't know if it's very specific to my work flow, or other ppl might
have similar "issues" with that - and if do you want something like that
in gitcheck at first place.

If it's something that sounds good to you I can refine my work in about 3,4 days
and submit a pull request ;D

Tell me what you think about it!

Cheers and thanks for gitcheck!

Doesn't show if local needs to pull

I just updated a readme for a repo and then ran gitcheck and the log didn't tell me if the project needed to be pulled or not. Is there any way I can log if I need to pull?

Readme is not very clear, and I had the greatest trouble installing it

Hi,

I'm running debian testing. Have both python 2.7 and 3.2 installed.

when I tried to install it, it spit out a trace log. Somewhere it said something about permissions, but the output is long and it is not very obvious.

Now I installed with sudo. >garchdeps.py doesn't seem to exist on my system, nor does it appear in the repo. python gitcheck/gitcheck.py says "file does not exist".

It installed to /usr/local/lib/python2.7/dist-packages. That is not in the path for python. I tried adding that to PYTHONPATH to no avail.

I ended up getting it to work by doing:
git config --global alias.check "!python /usr/local/lib/python2.7/dist-packages/gitcheck.py"

I think it would be good to give a little more guidance in the readme and explain what garchdeps.py is if it is needed.

upload distribution to PyPI?

The README reads pip install git+git://github.com/badele/gitcheck.git. A PyPI entry for gticheck exists, but without distribution files. As a result, an ordinary attempt to install with pip == 9.0.1 produces the message:

~:pip install gitcheck
Collecting gitcheck
  Could not find a version that satisfies the requirement gitcheck (from versions: )
No matching distribution found for gitcheck

It would be convenient to upload a distribution of gitcheck to PyPI, and also tag releases in the repository. Currently, in order to download only a specific version (and not clone the repository via pip), one has to use the commit hash.

Of course, git+git://github.com/badele/gitcheck.git can be used when calling pip, and within requirements files, but packages are usually made available on PyPI and mentioned by name and version, for example gitcheck == 0.3.22.

Relevant also to #33.

text file as configuration

The color theme appears to be loaded from the python file ~/mygitcheck.py. This means execution of arbitrary code from outside site-packages (which could be a root installation). It seems to be a security concern. Since only the color theme is loaded from that file, wouldn't a text or json file work?

Alphabetize repository listing

It doesn't really matter, but from an OCD perspective, it'd be nice if the repositories that were found were listed in sorted order (at least within a single directory; I get that if there are multiple levels of directories, then sorting across all of them might be annoying).

gitcheck installation with pip doesn't install 'colored' automatically

Just for your information, maybe it is the way it should be.
For example:

# Python 3.5
virtualenv gitcheck
. gitcheck/bin/activate
pip install git+git://github.com/badele/gitcheck.git
gitcheck
     ....
    ImportError: No module named 'colored'
pip install colored

I think that the pip does't install colored automatically from base.txt.

Multiple dirs

What do you think about the possibility to add param something like a --from-list file
where the file is:

/home/user/data/projects
/home/user/.confgis/dotfiles
/home/user/.configs/sublime-text-3/Packages/User
/home/user/.vim
/mount/point/some_repo
/mount/point/another_repo

Scan /home takes a lot of time, not to mention the Scan / and flag --maxdepth will not help here.
...or at least-d /path/to/repo -d /path/to/another/repo. Now gitcheck with -d takes only last dir

Of course, I can make a script

for i in `cat list`;do gitcheck -d $i;done

and i can even run it in parallel with xargs or parallelbut it would be nice if it was part of gitcheck

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.