Skip to main content

Display the 'git status' in sub-directories

Project description

git-substatus

CI status PyPI version hub.docker.com

A command-line tool to inspect the status of git repositories from a directory, like a projects folder keeping the git projects. You can therefore view:

  • status

    • added, removed, modified, renamed

    • merge conflicts

    • etc.

  • stash

  • worktree

Usage

See more at git-substatus --help

Installation

Install from the PyPI:

pip install git-substatus

Install from the repo:

pip install git+https://github.com/strboul/git-substatus.git

Alternatively, the Docker image can be used:

docker run --rm -t -v "$(pwd)":/"$(pwd)" -w "$(pwd)" strboul/git-substatus:latest <optional-path>

To shorten the command, it's also possible to add an alias in the .bashrc or .zshrc, e.g.:

_git_substatus() {
  docker run --rm -t -v "$(pwd)":/"$(pwd)" -w "$(pwd)" strboul/git-substatus:latest "$@"
}
alias git-substatus="_git_substatus"

Benchmark: I measured that the container solution is about 70% slower than the native operation, most likely due to the overhead; however, the container is still useful when portability matters.

Development

This module has no module dependency outside The Python Standard Library.

Development docs

Run tests && debugging

virtualenv venv
source venv/bin/activate # deactivate
pip install -r dev-requirements.txt # pip freeze > dev-requirements.txt
make all

Put a breakpoint() at a relevant place and run:

make test

Add new methods

Sending a PR

  • Bump up the version - major.minor.path (depends on the change) Change the version in the file git_substatus/__init__.py.

  • Write/update unit tests (where relevant). You can start by adding/modifying a case to generator file tests/gen_test_repos.sh.

Release

(needs credentials)

  • Release to PyPi
make release-pypi
  • Release to Docker Hub
make docker-build
make docker-release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-substatus-0.2.8.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

git_substatus-0.2.8-py3-none-any.whl (25.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page