Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eda2d0d162 | ||
|
|
2a80e1699b | ||
|
|
8307891085 | ||
|
|
5ae9137276 | ||
|
|
72827ccefa | ||
|
|
8e0df9797d | ||
|
|
5fb9770df3 | ||
|
|
110a34d994 | ||
|
|
4aef6b0cb7 | ||
|
|
2b0b9d4df1 | ||
|
|
b9f14716b7 | ||
|
|
fee30f9b40 | ||
|
|
1d7f916083 | ||
|
|
3d60fd5226 | ||
|
|
e7f5bdff67 | ||
|
|
2e8a70aa05 | ||
|
|
0337f57087 | ||
|
|
e4336d11db | ||
|
|
ff615d0ee0 |
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
|||||||
IyB2MiBnaXQgYnVuZGxlCi1lYjUxNjFiMjA3ZjY5YzVkZDExMGRkMWRhY2U4MjdlNDVlNmE3YzBjIFByZXBhcmUgc2NvcGVkIGxpZmVjeWNsZSBwcm9qZWN0aW9uIGFuZCBhbGlnbiBhdXRob3JpbmcgZ3VpZGUKNGVjYWQ3ODQzM2JkZmNmMjA3OTJmMDczOTI0YzgwZDhiYTM3YzI1MSBIRUFECgpQQUNLAAAAAgAAAAmaD3iclYxBasQwDEX3PoUuULBTy56BUgo9Qk+gyAoxOFGwlTJz+0mP0M1/m/e+dRFIKaGkHEjmhJEQw0wpLEuc6J2EPGUWpOjdQV12A5kxpDBPPi/pzlhKCP6aQiy3KUu8zq7Es6PTVu3wrUUe8MF/+GrK1FYd9gkh3+4+IU4R3nz23rFuWzWTfyTuR6SAHlZ1pwZrHab9Cb/UThmwdN1AHkerXA1Y92H95MsY7gVQV0+A8AJZ6jpicljDJLKEbnIkzdT7+qm0OXicO8l6knXDVkaRBMlA5Wbxd/8ltOsfbrdZqLNifQvz4pOMjADYiw06qwZ4nDMxAAKF/ETd5PyiVIaVx+V07E+q8bJ9nHjgWrRc8hO5229MYCpSUouzS/ILGAqFYp9XyMx+YvVSZKPCuh1rl166fQuuqDi1qCy1iGHm7X1W4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NUTFMEpoALDTpG2BF6I00TFtB+goA8O4DApqVlFmgxI4l50FxusGicWKcDU4GdRPK2Ciafq187mdF6r3ww69tht9t1yqv/Hf2PK0vmmF+eneR2cWkxB0wUTsGcadgjLe2r+h9gJTff9+uml577+Cv6tvIHQ+/uihpCoA9oYJtpiVZ7snfB2u7+eiU7
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,79 @@
|
|||||||
|
param(
|
||||||
|
[string]$Remote = "gitea",
|
||||||
|
[string]$MainBranch = "main"
|
||||||
|
)
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
# Verify remote exists.
|
||||||
|
$remotes = git remote
|
||||||
|
if ($remotes -notcontains $Remote) {
|
||||||
|
throw "Git remote '$Remote' does not exist. Available remotes: $($remotes -join ', ')"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Using remote: $Remote"
|
||||||
|
Write-Host "Canonical branch: $MainBranch"
|
||||||
|
|
||||||
|
# Update remote references.
|
||||||
|
git fetch $Remote --prune
|
||||||
|
|
||||||
|
# Update local main from the selected remote.
|
||||||
|
git switch $MainBranch
|
||||||
|
git pull --ff-only $Remote $MainBranch
|
||||||
|
|
||||||
|
# Get all branches on this specific remote.
|
||||||
|
$remotePrefix = "$Remote/"
|
||||||
|
|
||||||
|
$branches = git for-each-ref `
|
||||||
|
--format="%(refname:short)" `
|
||||||
|
"refs/remotes/$Remote" |
|
||||||
|
Where-Object {
|
||||||
|
$_ -ne "$Remote/$MainBranch" -and
|
||||||
|
$_ -ne "$Remote/HEAD"
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($remoteBranch in $branches) {
|
||||||
|
# Remove "<remote>/" prefix while preserving branch names such as
|
||||||
|
# agent/foo/bar.
|
||||||
|
$branch = $remoteBranch.Substring($remotePrefix.Length)
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "Updating $branch..."
|
||||||
|
|
||||||
|
# Check whether the local branch already exists.
|
||||||
|
git show-ref --verify --quiet "refs/heads/$branch"
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -eq 0) {
|
||||||
|
git switch $branch
|
||||||
|
|
||||||
|
# Make sure the local branch reflects the latest remote branch
|
||||||
|
# before modifying the instruction files.
|
||||||
|
git pull --ff-only $Remote $branch
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
git switch --track -c $branch "$Remote/$branch"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Force these files to exactly match canonical main.
|
||||||
|
git restore `
|
||||||
|
--source "$MainBranch" `
|
||||||
|
-- AGENTS.md PROJECT_GOAL.md
|
||||||
|
|
||||||
|
git add AGENTS.md PROJECT_GOAL.md
|
||||||
|
|
||||||
|
# Commit only when one of the files actually changed.
|
||||||
|
git diff --cached --quiet
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
git commit -m "Sync agent instructions from $MainBranch"
|
||||||
|
git push $Remote $branch
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "Already up to date."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
git switch $MainBranch
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "Finished synchronizing AGENTS.md and PROJECT_GOAL.md."
|
||||||
Reference in New Issue
Block a user