repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

Review a change

Open the repository’s Reviews tab and pick a published revision to see its exact ID, commands and replies.

Work in your clone. The revision page has copyable commands for Nushell and POSIX shells. The multi-line examples below assume a POSIX shell. Each revision gets an annotated tag, review/SERIES/vN. Each reviewer keeps replies in refs/notes/reviews/REVIEWER, attached to the tag object, not the commit.

With Revue

Install Revue to publish a revision, open it in a separate worktree or reply. In this example the series is parser and the revision is v1.

git revue publish parser -m "Handle empty input"
git revue open parser/v1 ../parser-v1

Before replying with Revue or plain Git, enter your own reviewer handle in your shell. Use a handle that starts with an ASCII letter or digit and contains only ASCII letters, digits, hyphens or underscores.

printf '%s' 'Your reviewer handle: '; IFS= read -r reviewer

Revue opens your editor for the reply.

git revue reply parser/v1 --as "$reviewer"

With plain Git

Discover. List annotated review tags on origin. The filter keeps peeled ^{} entries, which lightweight tags do not have, and prints the tag names to use below.

git ls-remote --tags origin 'refs/tags/review/*/v*' |
  awk '$2 ~ /^refs\/tags\/review\/[^\/]+\/v[1-9][0-9]*\^\{\}$/ {
    sub(/^refs\/tags\//, "", $2)
    sub(/\^\{\}$/, "", $2)
    print $2
  }'

Publish. Tag the commit to review and push just that tag. For a revision, use the next version rather than moving an existing tag.

git tag -a review/parser/v1 HEAD -m "Handle empty input"
git push origin refs/tags/review/parser/v1

Open. Fetch the tag and check out its commit in a new worktree. The ^{commit} suffix rejects tags that do not point to a commit.

git fetch origin tag review/parser/v1
git worktree add --detach ../parser-v1 'refs/tags/review/parser/v1^{commit}'

Read replies. After fetching the tag, list reviewer namespaces. Fetch the one you want to read (for example, alex) and read the note on the tag object. Repeat for other reviewers.

git ls-remote --refs origin 'refs/notes/reviews/*'
git fetch origin refs/notes/reviews/alex:refs/notes/incoming/alex
git notes --ref=incoming/alex show 'refs/tags/review/parser/v1^{tag}'

Reply. On the revision page, open Use stock Git instead and run Write and push a reply once for a new reply. It refreshes your reviewer’s notes before opening the editor and stops if you already have unpublished local notes.

Resume a rejected or interrupted reply

Keep the original clone and use the same handle. Inspect the local note first; a failed push does not undo an append, and a lost connection does not prove that the remote rejected it.

ref="refs/notes/reviews/${reviewer:?Enter your own handle first}"
incoming="refs/notes/review-origin/$reviewer"
tag='refs/tags/review/parser/v1^{tag}'
git notes --ref="$ref" show "$tag"

Replace the tag in the example with your revision (or its full annotated tag ID from Luigit). If no reply was saved locally, check the remote with Read replies on this tag before writing anything again. If it was saved, run Resume existing local notes on that revision, not the write command. Resume fetches and merges the remote reviewer ref, then pushes only that ref without appending. It can publish pending changes on other tags in the same ref; inspect those too.

For a non-fast-forward rejection, resume against the latest remote ref. For authentication, permission or policy failures, fix the cause first. If the ref unexpectedly disappeared or was rewritten, stop and check with the repository owner before publishing it again. Never force-push.

If Git reports a notes merge conflict

Inspect the common base, your local note and the fetched note for each conflicting object. For the current tag, the commands below show all three (an absent base or note can be legitimate).

target=$(git rev-parse --verify "$tag")
base=$(git merge-base "$ref" "$incoming")
printf '\nCommon base note:\n'
if [ -n "$base" ]; then
  blob=$(git ls-tree -r --full-tree "$base" | awk -v target="$target" '
    $2 == "blob" { path = $4; gsub("/", "", path); if (path == target) print $3 }
  ')
  if [ -n "$blob" ]; then git cat-file blob "$blob"; else printf '(no note)\n'; fi
else
  printf '(no common base)\n'
fi
printf '\nLocal note:\n'
git notes --ref="$ref" show "$tag"
printf '\nFetched note:\n'
git notes --ref="$incoming" show "$tag"

Edit the file Git reports under NOTES_MERGE_WORKTREE and remove conflict markers. Keep shared text once, plus each intended change once; do not concatenate both full notes or use a union strategy blindly. If unsure, abort instead; your pre-merge local notes are retained.

To save the resolution:

git notes --ref="$ref" merge --commit

Or to cancel instead:

git notes --ref="$ref" merge --abort

After committing the resolution, verify the resulting notes, then use Resume existing local notes to check for newer remote changes and push without appending.

Luigit is read-only. Whether a push starts CI depends on the repository’s configured triggers. These instructions do not enforce review or gate merges.