@ -17,7 +17,6 @@ Git commit signature events are used to cryptographically sign git commits using
@@ -17,7 +17,6 @@ Git commit signature events are used to cryptographically sign git commits using
["message", "Fix bug in feature"], // Commit message
@ -30,11 +29,15 @@ Git commit signature events are used to cryptographically sign git commits using
@@ -30,11 +29,15 @@ Git commit signature events are used to cryptographically sign git commits using
### Tag Descriptions
- **`commit`** (required): The final commit hash after the commit is created. This tag is added after the commit is created, as the hash is not known beforehand.
- **`author`** (required, appears twice): First occurrence contains the author name, second contains the author email.
- **`message`** (required): The commit message text.
- **`message`** (required): The commit message text. Used for verification by matching with the actual commit message.
- **`e`** (optional): Reference to a NIP-98 authentication event if the commit was made via HTTP git operations.
**Note:** Commit signature events do not include the commit hash because:
- The commit-msg hook runs **before** the commit is created, so the hash doesn't exist yet
- Nostr events are **immutable** - once created and signed, they cannot be modified
- Verification matches events to commits by comparing the commit message instead
### Usage in GitRepublic
1. **Client-Side Signing**: When users make commits through the web interface, they can sign commits using NIP-07 (browser extension). The signature event is created client-side and keys never leave the browser.
@ -47,8 +50,8 @@ Git commit signature events are used to cryptographically sign git commits using
@@ -47,8 +50,8 @@ Git commit signature events are used to cryptographically sign git commits using
```
4. **Verification**: Commit signatures can be verified by:
- Checking the event signature
- Verifying the commit hash matches
- Checking the event signature (cryptographic verification)
- Matching the commit message in the `message` tag with the actual commit message
- Confirming the author information matches the commit
@ -112,12 +112,13 @@ GitRepublic uses custom event kinds not defined in any standard NIP:
@@ -112,12 +112,13 @@ GitRepublic uses custom event kinds not defined in any standard NIP:
Cryptographically sign git commits using Nostr keys.
**Tags**:
- `commit`: Final commit hash
- `author`: Author name (first occurrence)
- `author`: Author email (second occurrence)
- `message`: Commit message
- `e`: Optional reference to NIP-98 auth event
**Note:** Commit signature events do not include the commit hash because the commit-msg hook runs before the commit is created. Verification matches events to commits by comparing the commit message.
**Status**: Custom implementation (may be proposed as NIP in future)
See [Custom Event Kinds](./CustomKinds.md#kind-1640-commit-signature) for complete documentation.
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772005973,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","update the API"]],"content":"Signed commit: update the API","id":"09329cf7eb8c228e87e365b0d7a4d052ddb08b3cf7f75162b2e9b8dd77e917a0","sig":"1a1b40b18dbd744bd4043f0f18d5945ba7d1f738d36bb8457c4ec806832cd1b44ed36417c24d01511fa7fddfa33c376bf24c2fdf478bf1ab015cf4c524aac7e8"}
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772008194,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","revamp tutoral and ReadMe documentation\nupdate API docs"]],"content":"Signed commit: revamp tutoral and ReadMe documentation\nupdate API docs","id":"9d1fb9db75e26a5fcdcab54253ef1c6126ea1e01e98728554435e655354f6238","sig":"0cfde0ac8a7083479c982c7f212a91eee7e8ed33b43b30291677fe3a126638ae4fde03893aa5d492f8f6fc8e066b7c46bd6f07246376a5d9e56becc73e4e48d8"}