This tool provides advanced Git feature management, allowing you to associate feature information with commits and files.
-
Install the tool using pip:
- Download the latest release file (currently, the project is not stored in the PIP Index)
- Install the tool using pip
pip install <DownloadPath>/git-tool-<version>-py3-none-any.whl
-
In each Git repository where you want to track feature information, add the hooks provided by this project. This step is essential to ensure the internal state remains up-to-date. Each hook can only exist once. If you already have hooks, you need to manually copy the file contents instead
- Find the tool's installation path:
Output example:
pip show git-feature-tool
Location: /path/to/your/python/site-packages/git_tool
- Set the hooks path:
This sets up Git to use the hooks from the specified directory.
git config core.hooksPath /path/to/your/python/site-packages/git_tool/hooks
- Find the tool's installation path:
Displays the current feature status, including staged, unstaged, and untracked files with their associated features.
Usage:
git feature-status
This command helps to associate feature information with a commit that does not yet exist. You can either add the information while adding the files or add features to the staging area.
If you prefer to keep your workflows as usual and add feature information solely to commits that you already created, you don't need the git hooks and can jump to git feature-commit
.
Associates specified features with staged files. You can stage specific files or all tracked changes.
Options:
--all
,-a
: Stages all tracked changes.--files
,-f
: Specifies a list of files to stage and associate with features.
Usage:
git feature-add by-add --all <feature-names>
git feature-add by-add --files <file>... <feature-names>
Uses staged files to associate them with feature information.
Usage:
git feature-add from-staged
Assign features to a commit retroactively. To find all commits that have not yet features assigned, see --- Usage:
git feature-commit <commit> <features>
Displays the feature associations for each line of a specified file, similar to git blame
.
Usage:
git feature-blame <file>
Displays detailed information about a feature, including associated commits, files, authors, and branches.
Options:
--authors
: Lists the authors who contributed to the feature.--files
: Lists the files associated with the feature.--branches
: Lists the branches where the feature is found.
Usage:
git feature-info <feature>
git feature-info <feature> --authors --files --branches
Lists all commits associated with a feature or shows commits that are missing feature associations.
Options:
--missing
: Lists commits that do not have any associated feature.
Usage:
git feature-commits
git feature-commits --missing
-
Check Feature Status:
git feature-status
-
Add Features to All Files:
git feature-add by-add --all "new-feature"
-
Add Features to Specific Files:
git feature-add by-add --files src/main.py "feature-x"
-
Use Staged Files for Feature Information:
git feature-add from-staged
-
Show Feature Associations for a File:
git feature-blame src/main.py
-
Display Feature Information:
git feature-info feature-x --authors --files --branches
-
List All Commits With and Without Features:
git feature-commits git feature-commits --missing
For further details or to explore more usage options, refer to the Typer Documentation.
- Create a virtual environment and install both requirement-files.