Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
branches: main
paths-ignore:
- '.gitignore'
- '.pre-commit-config.yaml'
- 'LICENSE'
- 'README.md'
pull_request:
branches: main
paths-ignore:
- '.gitignore'
- '.pre-commit-config.yaml'
- 'LICENSE'
- 'README.md'
workflow_dispatch:
Expand Down Expand Up @@ -59,8 +61,8 @@ jobs:
- name: Check python types
run: uv run mypy .

- name: Install
run: pip install --user --break-system-packages .
- name: Run unit tests
run: uv run pytest -vvv

- name: Run tests
run: bash run_tests.sh
- name: Run integration tests
run: uv run pytest -vvv -m integration
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
default_install_hook_types:
- pre-commit
- pre-push
default_stages:
- pre-commit
fail_fast: true
Expand Down Expand Up @@ -47,7 +46,7 @@ repos:
files: \.py$
- id: py-test
name: pytest
stages: [pre-push]
entry: bash run_tests.sh
description: Run pytest
entry: uv run --frozen -q pytest --ff --exitfirst
language: system
pass_filenames: false
84 changes: 43 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ This can,

### Install

Install `git`, then install `git_evtag_py`:
Install `git >= 2.9.0`, then install `git_evtag_py`:

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

### Usage
Expand Down Expand Up @@ -43,27 +43,21 @@ git evtag --sign TAG
git evtag --sign TAG -m "Tag Message"

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

```sh
$ git evtag -h
usage: git-evtag [-h] [--rev REV] [--repo REPO] [--verify VERIFY] [--sign SIGN] [-m TAG_MESSAGE | -F TAG_MESSAGE_FILE]

EVTag checksum of a git repository
git_evtag_py EVTag checksum of a git repository

options:
-h, --help show this help message and exit
--rev REV Git revision (default: HEAD)
--repo REPO Path to the git repository (default: PWD)
--verify VERIFY Verify the EVTag checksum of the input tag
--sign SIGN Create a signed and annotated tag from HEAD and append the EVTag checksum
-m, --tag-message TAG_MESSAGE
Use the input message as the tag message
-F, --tag-message-file TAG_MESSAGE_FILE
Use the message from the input file as the tag message
-h, --help Show this help message and exit
--version Show the version number and exit
--rev Git revision (default: HEAD)
--repo Path to the git repository (default: PWD)
--verify Verify the EVTag checksum of the input tag
--sign Create a signed and annotated tag from HEAD and append the EVTag checksum
--tag-msg Use the input as the tag message, or read from a file path
```

### Development
Expand All @@ -77,46 +71,54 @@ uv run pytest -vvvs

### Performance

_Compared to the upstream Python implementation._
_Compared to the upstream Python and C implementation(s)._

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

```sh
# git_evtag_py

/bin/time -p git evtag
/bin/time -p /home/bbhtt/Git/github/git-evtag-py/git-evtag --in-place
WARNING: Running in-place checksum computation for 'HEAD'
Git-EVTag-v0-SHA512: e7e3045a3f5b8f9cc538cc37a56143918306282f7200b9c860703bc839e0a7f4c59f36313d34e6ae9b825c2f77081dfe8e2d5f50f70030271ea17161e2e2fe83
real 7.68
user 6.65
sys 1.71

## Average for 10 runs

real 7.78
user 6.72
sys 1.76

/bin/time -p /home/bbhtt/Git/github/git-evtag-py/git-evtag
INFO: Cloning repository to a temporary directory to checkout 'HEAD'
Git-EVTag-v0-SHA512: e7e3045a3f5b8f9cc538cc37a56143918306282f7200b9c860703bc839e0a7f4c59f36313d34e6ae9b825c2f77081dfe8e2d5f50f70030271ea17161e2e2fe83
real 14.19
user 8.60
sys 7.21
real 26.19
user 11.94
sys 10.09

# git-evtag-compute-py
# git-evtag-compute-py (Upstream Python implementation)

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

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

```sh
# git_evtag_py

/bin/time -p git evtag
Git-EVTag-v0-SHA512: b7a88cbca3c1257855404ab6f16b9efaf1e9b9304f46ad45a5d1a283808e40a96011e9321f0c6a8aacfe3a1be9c3cb971b9169ba21bd1d2ccfeb52041da0475b
real 1.93
user 1.02
sys 1.06
/bin/time -p /usr/bin/git-evtag sign --print-only v6.15
# git-evtag comment: submodules=0 commits=1 (262) trees=5895 (3908050) blobs=88843 (1510695775)
Git-EVTag-v0-SHA512: e7e3045a3f5b8f9cc538cc37a56143918306282f7200b9c860703bc839e0a7f4c59f36313d34e6ae9b825c2f77081dfe8e2d5f50f70030271ea17161e2e2fe83
real 8.65
user 8.22
sys 0.39

# git-evtag-compute-py
## Average for 10 runs

/bin/time -p git-evtag-compute-py HEAD
# git-evtag comment: submodules=0 commits=1 (252) trees=714 (510170) blobs=10970 (283895423)
Git-EVTag-v0-SHA512: b7a88cbca3c1257855404ab6f16b9efaf1e9b9304f46ad45a5d1a283808e40a96011e9321f0c6a8aacfe3a1be9c3cb971b9169ba21bd1d2ccfeb52041da0475b
real 18.55
user 5.83
sys 13.45
real 8.73
user 8.28
sys 0.40
```
Loading
Loading