Plumbing for git tag -a.
Plumbing that creates an annotated tag object from a strictly-formatted message on stdin and prints its SHA. It is the engine sitting under git tag -a / -s, minus any ref bookkeeping.
Think of it as 'hash-object for tags': you hand it the canonical tag blob, it stores the object, you get a SHA. Nothing in refs/tags/ moves until you call update-ref yourself.
git mktag < tag.in
# stdin format (exact order, exact field names):
# object <sha>
# type <commit|tree|blob|tag>
# tag <name>
# tagger <Name> <email> <unix-ts> <tz>
# <blank line>
# <message ...>
# prints: <tag-object-sha>| Flag | What it does |
|---|---|
--strict | Enforce strict tag-format checks (default in modern Git). |
(stdin) | Reads the canonical tag blob; no flags configure the format. |
(no ref update) | Writes the object only; you must update refs/tags/<name> separately. |
(fsck-driven) | Validation is governed by fsck.* config (e.g. fsck.missingTaggerEntry). |
git mktag <<'EOF'
object 1a2b3c4d...
type commit
tag v1.0.0
tagger Jane Dev <jane@x> 1714694400 +0000
First stable release
EOFgit mktag < tag.insha=$(git mktag < tag.in) && git update-ref refs/tags/v1.0.0 "$sha"printf 'object %s\ntype commit\ntag v1.0.0\ntagger Jane <j@x> %s +0000\n\nrelease\n' "$(git rev-parse HEAD)" "$(date +%s)" | git mktagHit each option, then Check answers. Score is recorded; Next is always open.