Display the 'git status' in sub-directories
Project description
git-substatus
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
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
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: it's measured that the container solution is ~70% slower than the native operation due to the overhead; however, the container solution is still useful for portability matters.
Development
This module has no module dependency outside The Python Standard Library.
Development docs
Versioning and release
-
Bump up the
__version__
ingit_substatus/__init__.py
and commit the change in the batch where you changed the files. -
(For the codeowner) Create a version tag with
make tag-create
number. Push the tag to the origin withmake tag-push
. Upon the push, the release workflow will be triggered that distributes the new version to the platforms, like PyPI, DockerHub.
pre-commit
Run pre-commit git hooks on every commit that run checks against the files added to a commit.
Upon cloning the repo, set up pre-commit
:
- Install pre-commit https://pre-commit.com/#installation
- Run
pre-commit install
that installs the hook scripts at.git/hooks
Add tests
- Write/update unit tests (if relevant). You can start by adding/modifying a
case to generator file
tests/gen_test_repos.sh
.
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
- Use the reference to name the functions/methods in the module: https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitglossary.html
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
Built Distribution
Hashes for git_substatus-0.2.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a844e4a4ac95754b617b6ee8a98f97b7cf19305163f4432d77a1e01513ec9427 |
|
MD5 | 1814683db5f2ce37ab8d779ee2219911 |
|
BLAKE2b-256 | ff5e40997f5c1ed5be8cd16bf12ec3a71a253899627088358bddf5b3d2663f4c |