Skip to content

Commit 301deee

Browse files
committed
chore: merge full history for git-metadata
The `git-metadata` package has moved repositories. With this merge, we still have access to all old commits!
2 parents 0578e54 + dc47c1b commit 301deee

6 files changed

Lines changed: 168 additions & 24 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"crates/git-metadata": "0.1.0"
2+
"crates/git-metadata": "0.2.0"
33
}

.rules

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# Project Rules
22

33
## Behavior
4-
- Be concise. No filler, no restating the task, no summaries of what you just did.
5-
- Do not explain code unless asked. Just write it.
6-
- Do not narrate your diffs or describe what you changed. I can read the diff.
4+
5+
- Be concise.
6+
No filler, no restating the task, no summaries of what you just did.
7+
- Do not explain code unless asked.
8+
Just write it.
9+
- Do not narrate your diffs or describe what you changed.
10+
I can read the diff.
711
- Ask before making changes outside the scope of what was requested.
812
- Never refactor surrounding code unless explicitly asked.
9-
- If you hit an error, stop and report it. Do not loop trying fixes without asking.
10-
- Prefer minimal, targeted diffs. Do not rewrite entire files when a small edit suffices.
13+
- If you hit an error, stop and report it.
14+
Do not loop trying fixes without asking.
15+
- Prefer minimal, targeted diffs.
16+
Do not rewrite entire files when a small edit suffices.
1117
- If a task will touch more than 3 files, state your plan in one sentence and wait for confirmation before proceeding.
1218
- Do not add dependencies without asking.
1319

1420
## Code Style
1521

16-
1722
- Match existing patterns in the codebase; do not introduce new conventions.
1823
- Keep imports organized per existing project convention.
1924
- Before creating a new utility or helper, check if one already exists in the codebase.

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
## [0.2.0](https://github.com/git-ents/git-metadata/compare/git-metadata-v0.1.0...git-metadata-v0.2.0) (2026-03-12)
4+
5+
6+
### Features
7+
8+
* Add MetadataIndex::metadata ([fd7b179](https://github.com/git-ents/git-metadata/commit/fd7b1793465cfb167187c8d558dc61a35a3e1a28))
9+
* Add MetadataIndex::metadata_commit ([fd7b179](https://github.com/git-ents/git-metadata/commit/fd7b1793465cfb167187c8d558dc61a35a3e1a28))
10+
11+
## 0.1.0 (2026-03-11)
12+
13+
14+
### ⚠ BREAKING CHANGES
15+
16+
* metadata_remove no longer takes MetadataOptions
17+
18+
### Features
19+
20+
* Add executor (exe) and CLI implementation ([10d9c07](https://github.com/git-ents/git-metadata/commit/10d9c0749bdfa7abfe0c4f14af528e4c91a43e51))
21+
* Add initial trait method and accompanying implementation ([c4ed9f8](https://github.com/git-ents/git-metadata/commit/c4ed9f85753443685fbaa63b13ffb1501f4d92d1))
22+
* Add man generation to CLI ([275207f](https://github.com/git-ents/git-metadata/commit/275207f1b6c7b7aad9bdda1ccfb3b18f2d0fc2ac))
23+
* Add metadata trait method definitions ([30ef2eb](https://github.com/git-ents/git-metadata/commit/30ef2eb67582dcceae1a88f6819802370dd00947))
24+
* Add metadata trait method implementations ([30ef2eb](https://github.com/git-ents/git-metadata/commit/30ef2eb67582dcceae1a88f6819802370dd00947))
25+
* Auto-detect fanout depth on read and remove ([bd86065](https://github.com/git-ents/git-metadata/commit/bd860650b8471215ad5f131f28666d613648178c))
26+
* Glob matching for remove patterns (*, **, prefix match) ([4cf0d90](https://github.com/git-ents/git-metadata/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
27+
* Path-based metadata API following git-notes semantics ([4cf0d90](https://github.com/git-ents/git-metadata/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
28+
* Resolve revisions (HEAD, refs, short OIDs) in all object arguments ([4cf0d90](https://github.com/git-ents/git-metadata/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
29+
30+
31+
### Bug Fixes
32+
33+
* Auto-detect fanout depth and correct shard level semantics ([bd86065](https://github.com/git-ents/git-metadata/commit/bd860650b8471215ad5f131f28666d613648178c))
34+
* Correct release-please manifest package key ([88f4ec1](https://github.com/git-ents/git-metadata/commit/88f4ec128b8c7a6544a612ae5a673e9462be7b8b))
35+
* Remove cargo-workspace plugin for single-crate repo ([1d19a7d](https://github.com/git-ents/git-metadata/commit/1d19a7de740e6d637f7bc7751604d3deab244643))
36+
* Shard-level default changed from 2 to 1 (git-notes compatible) ([bd86065](https://github.com/git-ents/git-metadata/commit/bd860650b8471215ad5f131f28666d613648178c))

README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# 📋 `git-metadata`
2+
3+
*Porcelain for adding metadata to any object without rewriting history.*
4+
5+
<!-- rumdl-disable MD013 -->
6+
[![CI](https://github.com/git-ents/git-metadata/actions/workflows/CI.yml/badge.svg)](https://github.com/git-ents/git-metadata/actions/workflows/CI.yml) [![CD](https://github.com/git-ents/git-metadata/actions/workflows/CD.yml/badge.svg)](https://github.com/git-ents/git-metadata/actions/workflows/CD.yml)
7+
<!-- rumdl-enable MD013 -->
8+
9+
> [!CAUTION]
10+
> This project is in active development.
11+
> There are surely bugs and misbehaviors that have not yet been discovered.
12+
> Please file a [new issue] for any misbehaviors you find!
13+
14+
[new issue]: https://github.com/git-ents/git-metadata/issues/new
15+
16+
## Overview
17+
18+
To support a more expansive usage of the Git object database — as is the goal for other projects within the [`git-ents`](https://github.com/git-ents) organization — new tooling is needed.
19+
This project provides a command that allows users to associate arbitrary data to any object in Git's store.
20+
The `metadata` command follows `notes` semantics.
21+
22+
[Notes] are a tragically underutilized feature of Git.
23+
For more information about `git notes` entries, Tyler Cipriani's [blog post] is an excellent introduction, and some highly-motivating examples.
24+
One such example is Google's open-source [`git-appraise`] project, which stores code review metadata as structured entries in a note blob.
25+
While impressive, that design highlights a limitation of notes: structured data, or data that does not map cleanly onto UTF-8 text, is difficult to represent in a blob format.
26+
The `git-metadata` project provides a structured alternative to the notes-blob design using Git trees objects.
27+
Just like notes, metadata added to an object does not alter the object's history.
28+
29+
> [!TIP]
30+
> Unlike notes, `metadata` is not added to `git log`.
31+
32+
[Notes]: https://git-scm.com/docs/git-notes
33+
[blog post]: https://tylercipriani.com/blog/2022/11/19/git-notes-gits-coolest-most-unloved-feature/
34+
[`git-appraise`]: https://github.com/google/git-appraise
35+
36+
## Usage
37+
38+
Metadata entries are paths (with optional blob content) stored in a Git tree object, associated with any target object (blob, tree, or commit) via a fanout ref.
39+
The command follows `git notes` semantics: `list`, `show`, `add`, `remove`, `copy`, `prune`, and `get-ref`.
40+
41+
<!-- rumdl-disable MD013 -->
42+
43+
```shell
44+
# Add a path entry to HEAD's metadata tree
45+
git metadata add labels/bug
46+
git metadata add review/status -m approved
47+
48+
# Add metadata to a specific object
49+
git metadata add labels/urgent abc1234
50+
51+
# Show all metadata entries for an object
52+
git metadata show # defaults to HEAD
53+
git metadata show abc1234
54+
55+
# List all targets that have metadata
56+
git metadata list
57+
58+
# Remove entries by glob pattern
59+
git metadata remove 'labels/*'
60+
git metadata remove 'labels/bug' -o abc1234
61+
62+
# Keep only matching entries (remove everything else)
63+
git metadata remove --keep 'review/**'
64+
65+
# Copy metadata from one object to another
66+
git metadata copy abc1234 def5678
67+
68+
# Remove metadata for objects that no longer exist
69+
git metadata prune
70+
git metadata prune -n # dry run
71+
72+
# Print the metadata ref name
73+
git metadata get-ref
74+
75+
# Use a custom ref
76+
git metadata --ref refs/metadata/custom add labels/bug
77+
```
78+
79+
<!-- rumdl-enable MD013 -->
80+
81+
For more information, see `git metadata --help`.
82+
83+
## Installation
84+
85+
### CLI
86+
87+
The `git-metadata` plumbing command can be installed with `cargo install`.
88+
89+
```shell
90+
cargo install --locked git-metadata
91+
```
92+
93+
If `~/.cargo/bin` is on your `PATH`, you can invoke the command with `git`.
94+
95+
```shell
96+
git metadata -h
97+
```
98+
99+
### Library
100+
101+
The `git-metadata` library can be added to your Rust project via `cargo add`.
102+
103+
```shell
104+
cargo add git-metadata
105+
```

crates/git-metadata/CHANGELOG.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22

33
## 0.1.0 (2026-03-11)
44

5-
65
### ⚠ BREAKING CHANGES
76

87
* metadata_remove no longer takes MetadataOptions
98

109
### Features
1110

12-
* Add executor (exe) and CLI implementation ([10d9c07](https://github.com/git-ents/git-metadata/commit/10d9c0749bdfa7abfe0c4f14af528e4c91a43e51))
13-
* Add initial trait method and accompanying implementation ([c4ed9f8](https://github.com/git-ents/git-metadata/commit/c4ed9f85753443685fbaa63b13ffb1501f4d92d1))
14-
* Add man generation to CLI ([275207f](https://github.com/git-ents/git-metadata/commit/275207f1b6c7b7aad9bdda1ccfb3b18f2d0fc2ac))
15-
* Add metadata trait method definitions ([30ef2eb](https://github.com/git-ents/git-metadata/commit/30ef2eb67582dcceae1a88f6819802370dd00947))
16-
* Add metadata trait method implementations ([30ef2eb](https://github.com/git-ents/git-metadata/commit/30ef2eb67582dcceae1a88f6819802370dd00947))
17-
* Auto-detect fanout depth on read and remove ([bd86065](https://github.com/git-ents/git-metadata/commit/bd860650b8471215ad5f131f28666d613648178c))
18-
* Glob matching for remove patterns (*, **, prefix match) ([4cf0d90](https://github.com/git-ents/git-metadata/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
19-
* Path-based metadata API following git-notes semantics ([4cf0d90](https://github.com/git-ents/git-metadata/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
20-
* Resolve revisions (HEAD, refs, short OIDs) in all object arguments ([4cf0d90](https://github.com/git-ents/git-metadata/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
21-
11+
* Add executor (exe) and CLI implementation ([10d9c07](https://github.com/git-ents/git-data/commit/10d9c0749bdfa7abfe0c4f14af528e4c91a43e51))
12+
* Add initial trait method and accompanying implementation ([c4ed9f8](https://github.com/git-ents/git-data/commit/c4ed9f85753443685fbaa63b13ffb1501f4d92d1))
13+
* Add man generation to CLI ([275207f](https://github.com/git-ents/git-data/commit/275207f1b6c7b7aad9bdda1ccfb3b18f2d0fc2ac))
14+
* Add metadata trait method definitions ([30ef2eb](https://github.com/git-ents/git-data/commit/30ef2eb67582dcceae1a88f6819802370dd00947))
15+
* Add metadata trait method implementations ([30ef2eb](https://github.com/git-ents/git-data/commit/30ef2eb67582dcceae1a88f6819802370dd00947))
16+
* Auto-detect fanout depth on read and remove ([bd86065](https://github.com/git-ents/git-data/commit/bd860650b8471215ad5f131f28666d613648178c))
17+
* Glob matching for remove patterns (*, **, prefix match) ([4cf0d90](https://github.com/git-ents/git-data/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
18+
* Path-based metadata API following git-notes semantics ([4cf0d90](https://github.com/git-ents/git-data/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
19+
* Resolve revisions (HEAD, refs, short OIDs) in all object arguments ([4cf0d90](https://github.com/git-ents/git-data/commit/4cf0d90c56bed7188db4511eb0132d475286435c))
2220

2321
### Bug Fixes
2422

25-
* Auto-detect fanout depth and correct shard level semantics ([bd86065](https://github.com/git-ents/git-metadata/commit/bd860650b8471215ad5f131f28666d613648178c))
26-
* Correct release-please manifest package key ([88f4ec1](https://github.com/git-ents/git-metadata/commit/88f4ec128b8c7a6544a612ae5a673e9462be7b8b))
27-
* Remove cargo-workspace plugin for single-crate repo ([1d19a7d](https://github.com/git-ents/git-metadata/commit/1d19a7de740e6d637f7bc7751604d3deab244643))
28-
* Shard-level default changed from 2 to 1 (git-notes compatible) ([bd86065](https://github.com/git-ents/git-metadata/commit/bd860650b8471215ad5f131f28666d613648178c))
23+
* Auto-detect fanout depth and correct shard level semantics ([bd86065](https://github.com/git-ents/git-data/commit/bd860650b8471215ad5f131f28666d613648178c))
24+
* Correct release-please manifest package key ([88f4ec1](https://github.com/git-ents/git-data/commit/88f4ec128b8c7a6544a612ae5a673e9462be7b8b))
25+
* Remove cargo-workspace plugin for single-crate repo ([1d19a7d](https://github.com/git-ents/git-data/commit/1d19a7de740e6d637f7bc7751604d3deab244643))
26+
* Shard-level default changed from 2 to 1 (git-notes compatible) ([bd86065](https://github.com/git-ents/git-data/commit/bd860650b8471215ad5f131f28666d613648178c))

crates/git-metadata/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
*Porcelain for adding metadata to any object without rewriting history.*
44

55
<!-- rumdl-disable MD013 -->
6-
[![CI](https://github.com/git-ents/git-metadata/actions/workflows/CI.yml/badge.svg)](https://github.com/git-ents/git-metadata/actions/workflows/CI.yml) [![CD](https://github.com/git-ents/git-metadata/actions/workflows/CD.yml/badge.svg)](https://github.com/git-ents/git-metadata/actions/workflows/CD.yml)
6+
[![CI](https://github.com/git-ents/git-data/actions/workflows/CI.yml/badge.svg)](https://github.com/git-ents/git-data/actions/workflows/CI.yml) [![CD](https://github.com/git-ents/git-data/actions/workflows/CD.yml/badge.svg)](https://github.com/git-ents/git-data/actions/workflows/CD.yml)
77
<!-- rumdl-enable MD013 -->
88

99
> [!CAUTION]
1010
> This project is in active development.
1111
> There are surely bugs and misbehaviors that have not yet been discovered.
1212
> Please file a [new issue] for any misbehaviors you find!
1313
14-
[new issue]: https://github.com/git-ents/git-metadata/issues/new
14+
[new issue]: https://github.com/git-ents/git-data/issues/new
1515

1616
## Overview
1717

0 commit comments

Comments
 (0)