mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
docs(agentydragon): add worktree helper script and branch convention to README
This commit is contained in:
@@ -22,6 +22,13 @@ This file documents the changes introduced on the `agentydragon` branch
|
||||
|
||||
Tasks live under `agentydragon/tasks/` as individual Markdown files. Please update each task’s **Status** and **Implementation** sections in place rather than maintaining a static list here.
|
||||
|
||||
### Branch & Worktree Workflow
|
||||
|
||||
- **Branch convention**: work on each task in its own branch named `agentydragon/<task-id>-<task-slug>`.
|
||||
- **Worktree helper**: run `create-task-worktree.sh <task-id>-<task-slug>`
|
||||
in `agentydragon/tasks/` to create or reuse a worktree at
|
||||
`agentydragon/tasks/.worktrees/<task-id>-<task-slug>` off the `master` branch.
|
||||
|
||||
---
|
||||
|
||||
*This README was autogenerated to summarize changes on the `agentydragon` branch.*
|
||||
41
agentydragon/tasks/create-task-worktree.sh
Executable file
41
agentydragon/tasks/create-task-worktree.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# create-task-worktree.sh
|
||||
#
|
||||
# Create or reuse a git worktree for a specific task branch under agentydragon/tasks/.worktrees.
|
||||
# Usage: create-task-worktree.sh <task-id>-<task-slug>
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 <task-id>-<task-slug>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
task_slug="$1"
|
||||
branch="agentydragon/$task_slug"
|
||||
|
||||
# Determine repository root
|
||||
repo_root=$(git rev-parse --show-toplevel)
|
||||
|
||||
tasks_dir="$repo_root/agentydragon/tasks"
|
||||
worktrees_dir="$tasks_dir/.worktrees"
|
||||
worktree_path="$worktrees_dir/$task_slug"
|
||||
|
||||
mkdir -p "$worktrees_dir"
|
||||
|
||||
# Create branch if it does not exist
|
||||
if ! git show-ref --verify --quiet "refs/heads/$branch"; then
|
||||
echo "Creating branch $branch from master..."
|
||||
git branch --track "$branch" master
|
||||
fi
|
||||
|
||||
# Create worktree if it does not exist
|
||||
if [ ! -d "$worktree_path" ]; then
|
||||
echo "Creating worktree for $branch at $worktree_path"
|
||||
git worktree add "$worktree_path" "$branch"
|
||||
else
|
||||
echo "Worktree for $branch already exists at $worktree_path"
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user