git grep wrapper for arguments re-ordering, that can use options after filenames
Project description
Git grep wrapper for arguments re-ordering, that can use options after filenames.
This is “gErp”, not “gRep”.
Description
Original git grep command is sensitive to the order of arguments. For example, you use git grep, and you want to add option -l in tail, but you must type in the correct order.
# original git grep git grep pattern target -l # NG `fatal: bad flag '-l' used after filename` git grep -l pattern target # OK
git-gerp is allow to use options after patterns and filenames.
# use `g(e)rp`, instead of `g(r)ep` git gerp pattern target -l # OK, you can add option '-l' in tail
git-gerp is replace arguments, and execute git grep.
Replacement rules:
Find option arguments (and option’s parameters), move these to ahead.
Move rest plain arguments to behind.
If find double-dash --, treat after arguments as plain.
Requirements
Python 2.6+ or Python 3
Installation
Install this package using pip:
pip install git-gerp
and you can run under your repository:
git gerp ...
Define git alias (optional):
# define alias `g` git config --global alias.g gerp
and you can run:
git g ...
Usage
git gerp [<git-grep-argument>...]
Examples:
# simple
git gerp pattern
git gerp pattern path
# tail options
git gerp pattern path -l -A5 --max-depth 2
# support boolean expressions, and '(', ')'
git gerp \( -e pattern1 --and -e pattern2 \) --or -e pattern3 path -l
# support '--'
git gerp pattern -l -- path1 path2 -i # pathspecs is ['path1', 'path2', '-i']
Licence
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git-gerp-0.1.1.tar.gz.
File metadata
- Download URL: git-gerp-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f3b17ef55e083361a1e8704be49715a8d7fd88b10e157134c9dff8e1794f3e2
|
|
| MD5 |
d5733d8cd222966deba0cc660c01e535
|
|
| BLAKE2b-256 |
93828ac33448d8853998aa42b67298b73bb3f645c458a43394b22d4ed679d937
|
File details
Details for the file git_gerp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: git_gerp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
220fb5741e3e2258ed7750044bf84c1744137e8ed226660f0628fadb91251af8
|
|
| MD5 |
a6aa2e88ff52f8409adb5d0dd8142797
|
|
| BLAKE2b-256 |
a269b96efed307719f3c01fd3388e3aac174a62b4db81a144a88f90ae6e72d1c
|