Skip to content

Commit 127e75b

Browse files
committed
Rewrite (v2.0.0)
1 parent b8af494 commit 127e75b

8 files changed

Lines changed: 1504 additions & 503 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ on:
55
branches: main
66
paths-ignore:
77
- '.gitignore'
8+
- '.pre-commit-config.yaml'
89
- 'LICENSE'
910
- 'README.md'
1011
pull_request:
1112
branches: main
1213
paths-ignore:
1314
- '.gitignore'
15+
- '.pre-commit-config.yaml'
1416
- 'LICENSE'
1517
- 'README.md'
1618
workflow_dispatch:
@@ -29,6 +31,10 @@ jobs:
2931
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3032
with:
3133
persist-credentials: false
34+
fetch-depth: 0
35+
36+
- name: Fetch
37+
run: git fetch --all --force --tags
3238

3339
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
3440

@@ -59,8 +65,8 @@ jobs:
5965
- name: Check python types
6066
run: uv run mypy .
6167

62-
- name: Install
63-
run: pip install --user --break-system-packages .
68+
- name: Run unit tests
69+
run: uv run pytest -vvv
6470

65-
- name: Run tests
66-
run: bash run_tests.sh
71+
- name: Run integration tests
72+
run: uv run pytest -vvv -m integration

.pre-commit-config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
default_install_hook_types:
22
- pre-commit
3-
- pre-push
43
default_stages:
54
- pre-commit
65
fail_fast: true
@@ -47,7 +46,7 @@ repos:
4746
files: \.py$
4847
- id: py-test
4948
name: pytest
50-
stages: [pre-push]
51-
entry: bash run_tests.sh
49+
description: Run pytest
50+
entry: uv run --frozen -q pytest --ff --exitfirst
5251
language: system
5352
pass_filenames: false

README.md

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ This can,
1212

1313
### Install
1414

15-
Install `git`, then install `git_evtag_py`:
15+
Install `git >= 2.9.0`, then install `git_evtag_py`:
1616

1717
```sh
18-
pip install --user git+https://github.com/bbhtt/git-evtag-py.git@v1.0.9#egg=git_evtag_py
18+
pip install --user git+https://github.com/bbhtt/git-evtag-py.git@v2.0.0#egg=git_evtag_py
1919
```
2020

2121
### Usage
@@ -43,27 +43,21 @@ git evtag --sign TAG
4343
git evtag --sign TAG -m "Tag Message"
4444

4545
# Create a signed and annotated tag 'TAG' from HEAD and append the EVTag
46-
# checksum to it. Uses the message from the file 'FILE' as the tag
47-
# message
48-
git evtag --sign TAG -F FILE
46+
# checksum to it. Opens './TAG-FILE' for the tag message
47+
git evtag --sign TAG -m "./TAG-FILE"
4948
```
5049

5150
```sh
52-
$ git evtag -h
53-
usage: git-evtag [-h] [--rev REV] [--repo REPO] [--verify VERIFY] [--sign SIGN] [-m TAG_MESSAGE | -F TAG_MESSAGE_FILE]
54-
55-
EVTag checksum of a git repository
51+
git_evtag_py EVTag checksum of a git repository
5652

5753
options:
58-
-h, --help show this help message and exit
59-
--rev REV Git revision (default: HEAD)
60-
--repo REPO Path to the git repository (default: PWD)
61-
--verify VERIFY Verify the EVTag checksum of the input tag
62-
--sign SIGN Create a signed and annotated tag from HEAD and append the EVTag checksum
63-
-m, --tag-message TAG_MESSAGE
64-
Use the input message as the tag message
65-
-F, --tag-message-file TAG_MESSAGE_FILE
66-
Use the message from the input file as the tag message
54+
-h, --help Show this help message and exit
55+
--version Show the version number and exit
56+
--rev Git revision (default: HEAD)
57+
--repo Path to the git repository (default: PWD)
58+
--verify Verify the EVTag checksum of the input tag
59+
--sign Create a signed and annotated tag from HEAD and append the EVTag checksum
60+
--tag-msg Use the input as the tag message, or read from a file path
6761
```
6862

6963
### Development
@@ -77,46 +71,54 @@ uv run pytest -vvvs
7771

7872
### Performance
7973

80-
_Compared to the upstream Python implementation._
74+
_Compared to the upstream Python and C implementation(s)._
8175

8276
On `torvalds/linux.git` at the `v6.15` tag:
8377

8478
```sh
8579
# git_evtag_py
8680

87-
/bin/time -p git evtag
81+
/bin/time -p git-evtag --in-place
82+
WARNING: Running in-place checksum computation for 'HEAD'
83+
Git-EVTag-v0-SHA512: e7e3045a3f5b8f9cc538cc37a56143918306282f7200b9c860703bc839e0a7f4c59f36313d34e6ae9b825c2f77081dfe8e2d5f50f70030271ea17161e2e2fe83
84+
real 7.68
85+
user 6.65
86+
sys 1.71
87+
88+
## Average for 10 runs
89+
90+
real 7.78
91+
user 6.72
92+
sys 1.76
93+
94+
/bin/time -p git-evtag
95+
INFO: Cloning repository to a temporary directory to checkout 'HEAD'
8896
Git-EVTag-v0-SHA512: e7e3045a3f5b8f9cc538cc37a56143918306282f7200b9c860703bc839e0a7f4c59f36313d34e6ae9b825c2f77081dfe8e2d5f50f70030271ea17161e2e2fe83
89-
real 14.19
90-
user 8.60
91-
sys 7.21
97+
real 26.19
98+
user 11.94
99+
sys 10.09
92100

93-
# git-evtag-compute-py
101+
# git-evtag-compute-py (Upstream Python implementation)
94102

95103
/bin/time -p git-evtag-compute-py HEAD
96104
# git-evtag comment: submodules=0 commits=1 (262) trees=5895 (3908050) blobs=88843 (1510695775)
97105
Git-EVTag-v0-SHA512: e7e3045a3f5b8f9cc538cc37a56143918306282f7200b9c860703bc839e0a7f4c59f36313d34e6ae9b825c2f77081dfe8e2d5f50f70030271ea17161e2e2fe83
98106
real 152.06
99107
user 46.40
100108
sys 111.18
101-
```
102109

103-
On `mesa/mesa.git` at the `mesa-25.0.0` tag:
110+
# git-evtag (Upstream C implementation)
104111

105-
```sh
106-
# git_evtag_py
107-
108-
/bin/time -p git evtag
109-
Git-EVTag-v0-SHA512: b7a88cbca3c1257855404ab6f16b9efaf1e9b9304f46ad45a5d1a283808e40a96011e9321f0c6a8aacfe3a1be9c3cb971b9169ba21bd1d2ccfeb52041da0475b
110-
real 1.93
111-
user 1.02
112-
sys 1.06
112+
/bin/time -p git-evtag sign --print-only v6.15
113+
# git-evtag comment: submodules=0 commits=1 (262) trees=5895 (3908050) blobs=88843 (1510695775)
114+
Git-EVTag-v0-SHA512: e7e3045a3f5b8f9cc538cc37a56143918306282f7200b9c860703bc839e0a7f4c59f36313d34e6ae9b825c2f77081dfe8e2d5f50f70030271ea17161e2e2fe83
115+
real 8.65
116+
user 8.22
117+
sys 0.39
113118

114-
# git-evtag-compute-py
119+
## Average for 10 runs
115120

116-
/bin/time -p git-evtag-compute-py HEAD
117-
# git-evtag comment: submodules=0 commits=1 (252) trees=714 (510170) blobs=10970 (283895423)
118-
Git-EVTag-v0-SHA512: b7a88cbca3c1257855404ab6f16b9efaf1e9b9304f46ad45a5d1a283808e40a96011e9321f0c6a8aacfe3a1be9c3cb971b9169ba21bd1d2ccfeb52041da0475b
119-
real 18.55
120-
user 5.83
121-
sys 13.45
121+
real 8.73
122+
user 8.28
123+
sys 0.40
122124
```

0 commit comments

Comments
 (0)