mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-02 23:14:33 +01:00
* feat: a .gstack-project marker makes a nested repo or umbrella folder its own project (#2649, #1923) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: marker tests ignore an ambient GSTACK_STATE_ROOT Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (per-repo records ignore every marker, worktree binding in remote-slug and under a git HOME) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(slug): a linked worktree finds its main checkout's marker on its first run The worktree binding was written only when the main checkout resolved, so a worktree outside an umbrella resolved first kept its old bucket and later switched. Walk up from the main checkout on a miss instead (under its own $HOME rule) and drop the binding file. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs/test: pregate user policy names REPO_SLUG; pin greptile consent to REPO_SLUG Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(slug): no-clobber checkpoint recovery, unambiguous marker cache keys, ignore unusable folder names; remote-slug resolves once Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(slug): remote-slug reads a quoted marker path; repo mode stays per repository Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(slug): the review log and /ship spend-cap pointer stay with the repository under a marker; recovered checkpoints keep their repository; a linked worktree's own marker stands for its main checkout Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(captain): approvals live under the repository's own slug Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
28 lines
1.2 KiB
Bash
Executable File
28 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Output the remote slug for the current git repo.
|
|
# Used by SKILL.md files to derive project-specific paths in ~/.gstack/projects/.
|
|
# The slug rule (owner-repo for 2-segment remotes, "<last-two>-<16 hex>" for
|
|
# 3+-segment nested-group remotes, #3003) is shared with bin/gstack-slug through
|
|
# bin/gstack-remote-identity.sh.
|
|
set -e
|
|
. "$(dirname "$0")/../../bin/gstack-remote-identity.sh" 2>/dev/null || { echo "$0: bin/gstack-remote-identity.sh is missing. fix: reinstall with ./setup or /gstack-upgrade" >&2; exit 1; }
|
|
# A counted .gstack-project marker (#2649, #1923), found on the cwd chain or
|
|
# from a linked worktree's main checkout, decides identity the way bin/gstack-slug
|
|
# does, so design-doc lookups find docs where skills saved them.
|
|
_id=$("$(dirname "$0")/../../bin/gstack-slug" --identity 2>/dev/null || true)
|
|
_marker=$(printf '%s\n' "$_id" | sed -n 's/^PROJECT_MARKER=//p')
|
|
if [ -n "$_marker" ] && [ "$_marker" != "''" ]; then
|
|
printf '%s\n' "$_id" | sed -n 's/^SLUG=//p'
|
|
exit 0
|
|
fi
|
|
URL=$(git remote get-url origin 2>/dev/null || true)
|
|
_gri_slug=""
|
|
if [ -n "$URL" ]; then
|
|
gstack_remote_slug "$URL"
|
|
fi
|
|
if [ -n "$_gri_slug" ]; then
|
|
echo "$_gri_slug"
|
|
else
|
|
basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
fi
|