Imported from Gizzahub/gzh-cli (
cmd/git-sync/AGENTS.md). Install upstream withnpx skills add Gizzahub/gzh-cli --skill git-sync. Copyright stays with the author.
AGENTS.md - git-sync (์ ์ฅ์ ๋๊ธฐํ ์ง์ ์ )
๐ ๊ณตํต ๊ท์น: cmd/AGENTS_COMMON.md ์ฐธ์กฐ
๋ชจ๋ ์ญํ
git-sync๋ gzh-cli-gitforge/pkg/reposync์ pkg/reposynccli๊ฐ ์ ๊ณตํ๋ ๊ณต์ฉ
Cobra command tree๋ฅผ gz git-sync๋ก ์กฐ๋ฆฝยท๋ฑ๋กํ๋ ์์ ์ง์
์ ์
๋๋ค.
- ๋๊ธฐํ ๊ณํ๊ณผ ์คํ ๋ก์ง์
gzh-cli-gitforge์ ๋ก๋๋ค. - ์ด ๋ชจ๋์ registry metadata์ ๊ณต๊ฐ command ์ด๋ฆ์ ์ฐ๊ฒฐํฉ๋๋ค.
app.AppContext๋ registry ๊ฒฝ๊ณ์์ ์ ๋ฌ๋์ง๋ง ํ์ฌ command factory ๊ตฌ์ฑ์๋ ์ฌ์ฉํ์ง ์์ต๋๋ค. gitcommand dependency์ stable lifecycle์ ์ ์งํฉ๋๋ค.
๋ณ๊ฒฝ ๊ท์น
- ๊ธฐ๋ฅ ๋ก์ง์ ์ด ํจํค์ง์ ๋ณต์ ํ์ง ๋ง๊ณ gitforge์ ๊ณต๊ฐ API๋ฅผ ํ์ฅํฉ๋๋ค.
Use, command ์ด๋ฆ, flags๋ฅผ ๋ฐ๊ฟ ๋๋ ๊ธฐ์กดgz git-syncํธํ์ฑ์ ๋จผ์ ๊ฒํ ํฉ๋๋ค.- filesystem/Git ์คํ์ ์ถ๊ฐํ๋ค๋ฉด dry-run, ๋ถ๋ถ ์คํจ, ์ฌ์๋์ ์ํ ์ ์ฅ ๊ณ์ฝ์ gitforge ๊ตฌํ ๋ฐ ํ ์คํธ์์ ๋ค๋ฃน๋๋ค.
- ํ ํฐ, remote URL์ credential, ํ๊ฒฝ ๋ณ์ ๊ฐ์ ๋ก๊ทธ์ ์ถ๋ ฅํ์ง ์์ต๋๋ค.
๊ฒ์ฆ
go test ./cmd/git-sync ./cmd/registry
go test -race ./cmd/git-sync ./cmd/registry
command tree๋ gitforge ์ฐ๋์ ๋ณ๊ฒฝํ๋ค๋ฉด make check๋ ์คํํฉ๋๋ค.