mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
fix(update): exclude followed checkouts from missing repo recovery
Missing-repo discovery ignored the operation follow policy, so tracked metadata added a skipped checkout back to update --all and allowed --force to reset it. Thread the policy through missing-repo detection and its CLI/server callers, including rehydration, so existing followed checkouts remain excluded. Cover global and project updates with dirty tracked checkouts and force, as well as shared and dashboard rehydration. Document that --force does not override the batch skip.
This commit is contained in:
@@ -261,7 +261,7 @@ func runCheck(sourceDir, projectRoot string, jsonOutput bool, extraTargetNames [
|
||||
if err != nil {
|
||||
repos = nil
|
||||
}
|
||||
missingRepos, err := install.GetMissingTrackedRepos(sourceDir)
|
||||
missingRepos, err := install.GetMissingTrackedRepos(sourceDir, walk)
|
||||
if err != nil {
|
||||
missingRepos = nil
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ func runDoctorChecks(cfg *config.Config, result *doctorResult, isProject bool) {
|
||||
if !isProject {
|
||||
checkGitStatus(cfg.EffectiveSkillsSource(), result)
|
||||
}
|
||||
checkMissingTrackedRepos(cfg.EffectiveSkillsSource(), result, isProject)
|
||||
checkMissingTrackedRepos(cfg.EffectiveSkillsSource(), result, isProject, walk)
|
||||
|
||||
checkSkillsValidity(cfg.EffectiveSkillsSource(), walk, result, discovered)
|
||||
checkSkillIntegrity(result, discovered, walk.Follow)
|
||||
@@ -826,8 +826,8 @@ func checkGitStatus(source string, result *doctorResult) {
|
||||
}
|
||||
|
||||
// checkSkillsValidity checks if all skills have valid SKILL.md files
|
||||
func checkMissingTrackedRepos(source string, result *doctorResult, isProject bool) {
|
||||
missingRepos, err := install.GetMissingTrackedRepos(source)
|
||||
func checkMissingTrackedRepos(source string, result *doctorResult, isProject bool, walks ...sourcewalk.Options) {
|
||||
missingRepos, err := install.GetMissingTrackedRepos(source, walks...)
|
||||
if err != nil || len(missingRepos) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ func cmdStatus(args []string) error {
|
||||
Skillignore: buildSkillignoreJSON(stats),
|
||||
}
|
||||
output.SkillCount = len(discovered)
|
||||
output.TrackedRepos = buildTrackedRepoJSON(cfg.EffectiveSkillsSource(), trackedRepos, discovered)
|
||||
output.TrackedRepos = buildTrackedRepoJSON(cfg.EffectiveSkillsSource(), trackedRepos, discovered, walk)
|
||||
|
||||
for name, target := range cfg.Targets {
|
||||
sc := target.SkillsConfig()
|
||||
@@ -255,10 +255,10 @@ func extractTrackedRepos(sourcePath string, walk sourcewalk.Options) []string {
|
||||
}
|
||||
|
||||
// buildTrackedRepoJSON builds statusJSONRepo entries with parallel git.IsDirty checks.
|
||||
func buildTrackedRepoJSON(sourcePath string, trackedRepos []string, discovered []sync.DiscoveredSkill) []statusJSONRepo {
|
||||
func buildTrackedRepoJSON(sourcePath string, trackedRepos []string, discovered []sync.DiscoveredSkill, walks ...sourcewalk.Options) []statusJSONRepo {
|
||||
results := make([]statusJSONRepo, len(trackedRepos))
|
||||
|
||||
missingRepos, _ := install.GetMissingTrackedRepos(sourcePath)
|
||||
missingRepos, _ := install.GetMissingTrackedRepos(sourcePath, walks...)
|
||||
|
||||
// Count skills per repo (single pass). A tracked repo may surface skills
|
||||
// at the repo root (RelPath equals the repo name, no slash) or nested
|
||||
|
||||
@@ -80,7 +80,7 @@ func cmdStatusProjectJSON(root string) error {
|
||||
Skillignore: buildSkillignoreJSON(stats),
|
||||
}
|
||||
output.SkillCount = len(discovered)
|
||||
output.TrackedRepos = buildTrackedRepoJSON(runtime.sourcePath, trackedRepos, discovered)
|
||||
output.TrackedRepos = buildTrackedRepoJSON(runtime.sourcePath, trackedRepos, discovered, walk)
|
||||
|
||||
for _, entry := range runtime.config.Targets {
|
||||
target, ok := runtime.targets[entry.Name]
|
||||
|
||||
@@ -267,7 +267,7 @@ func cmdUpdate(args []string) error {
|
||||
return fmt.Errorf("failed to scan skills: %w", err)
|
||||
}
|
||||
resolveWarnings = append(resolveWarnings, ssync.SourceLinkWarnings(walk, false)...)
|
||||
missingRepos, _ := install.GetMissingTrackedRepos(sourcePath)
|
||||
missingRepos, _ := install.GetMissingTrackedRepos(sourcePath, walk)
|
||||
for _, repo := range missingRepos {
|
||||
if !seen[repo.Name] {
|
||||
seen[repo.Name] = true
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"skillshare/internal/config"
|
||||
"skillshare/internal/install"
|
||||
"skillshare/internal/testutil"
|
||||
)
|
||||
|
||||
@@ -50,3 +52,79 @@ func TestUpdateFollowedCheckoutResolution(t *testing.T) {
|
||||
t.Fatalf("--all did not skip followed checkout: %s", output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateAllSkipsFollowedCheckoutWithMetadata(t *testing.T) {
|
||||
for _, project := range []bool{false, true} {
|
||||
for _, force := range []bool{false, true} {
|
||||
t.Run(fmt.Sprintf("project=%t/force=%t", project, force), func(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
testutil.SetIsolatedXDG(t, root)
|
||||
t.Setenv("SKILLSHARE_CONFIG", filepath.Join(root, "config.yaml"))
|
||||
source := filepath.Join(root, "skills")
|
||||
cfg := &config.Config{Source: source, FollowSourceLinks: true}
|
||||
if err := cfg.Save(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if project {
|
||||
projectCfg := &config.ProjectConfig{Sources: config.ProjectSources{Skills: source}, FollowSourceLinks: true}
|
||||
if err := projectCfg.Save(root); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
if err := os.MkdirAll(source, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
remote := testutil.SetupBareRemoteRepo(t, root)
|
||||
testutil.SeedRemoteBranch(t, root, remote, "main", map[string]string{"SKILL.md": "# Safe skill\n", "notes.txt": "original\n"})
|
||||
checkout := filepath.Join(root, "checkout")
|
||||
testutil.RunGit(t, "", "clone", remote, checkout)
|
||||
before := testutil.RunGit(t, checkout, "rev-parse", "HEAD")
|
||||
seed := filepath.Join(root, "seed-main")
|
||||
if err := os.WriteFile(filepath.Join(seed, "SKILL.md"), []byte("# Updated skill\n"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
testutil.RunGit(t, seed, "add", ".")
|
||||
testutil.RunGit(t, seed, "commit", "-m", "advance remote")
|
||||
testutil.RunGit(t, seed, "push", "origin", "HEAD:main")
|
||||
if err := os.WriteFile(filepath.Join(checkout, "notes.txt"), []byte("local edit\n"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.Symlink(checkout, filepath.Join(source, "_dev-skills")); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store := install.LoadMetadataOrNew(source)
|
||||
store.Set("_dev-skills", &install.MetadataEntry{Source: "file://" + remote, Tracked: true})
|
||||
if err := store.Save(source); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
args := []string{"--all"}
|
||||
if force {
|
||||
args = append(args, "--force")
|
||||
}
|
||||
output := captureStdoutStderr(t, func() {
|
||||
var err error
|
||||
if project {
|
||||
_, err = cmdUpdateProject(args, root)
|
||||
} else {
|
||||
err = cmdUpdate(append([]string{"-g"}, args...))
|
||||
}
|
||||
if err != nil {
|
||||
t.Errorf("update --all: %v", err)
|
||||
}
|
||||
})
|
||||
if !strings.Contains(output, "_dev-skills: followed source link, not updated by --all") {
|
||||
t.Fatalf("skip warning missing: %s", output)
|
||||
}
|
||||
if got := testutil.RunGit(t, checkout, "rev-parse", "HEAD"); got != before {
|
||||
t.Fatalf("HEAD changed: %s", got)
|
||||
}
|
||||
if got := testutil.RunGit(t, checkout, "rev-parse", "origin/main"); got != before {
|
||||
t.Fatalf("checkout fetched: %s", got)
|
||||
}
|
||||
if data, err := os.ReadFile(filepath.Join(checkout, "notes.txt")); err != nil || string(data) != "local edit\n" {
|
||||
t.Fatalf("dirty file changed: %q %v", data, err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ func updateAllProjectSkills(uc *updateContext, walk sourcewalk.Options) (*update
|
||||
for _, t := range targets {
|
||||
existing[t.name] = true
|
||||
}
|
||||
missingRepos, _ := install.GetMissingTrackedRepos(uc.sourcePath)
|
||||
missingRepos, _ := install.GetMissingTrackedRepos(uc.sourcePath, walk)
|
||||
for _, repo := range missingRepos {
|
||||
if !existing[repo.Name] {
|
||||
existing[repo.Name] = true
|
||||
|
||||
@@ -351,8 +351,9 @@ func GetTrackedRepos(sourceDir string, walk ...sourcewalk.Options) ([]string, er
|
||||
}
|
||||
|
||||
// GetMissingTrackedRepos returns tracked metadata entries whose repo clone is absent.
|
||||
func GetMissingTrackedRepos(sourceDir string) ([]TrackedRepoMeta, error) {
|
||||
return getMissingTrackedReposImpl(sourceDir)
|
||||
// An optional walk policy recognizes existing followed source checkouts.
|
||||
func GetMissingTrackedRepos(sourceDir string, walks ...sourcewalk.Options) ([]TrackedRepoMeta, error) {
|
||||
return getMissingTrackedReposImpl(sourceDir, walks...)
|
||||
}
|
||||
|
||||
// RehydrateMissingTrackedRepos re-clones tracked repos declared in metadata whose
|
||||
|
||||
@@ -40,13 +40,13 @@ type TrackedRepoMeta struct {
|
||||
|
||||
// getMissingTrackedReposImpl returns tracked repositories declared in .metadata.json
|
||||
// whose clone directories are absent or no longer contain a git checkout.
|
||||
func getMissingTrackedReposImpl(sourceDir string) ([]TrackedRepoMeta, error) {
|
||||
func getMissingTrackedReposImpl(sourceDir string, walks ...sourcewalk.Options) ([]TrackedRepoMeta, error) {
|
||||
store, err := LoadMetadata(sourceDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
existingRepos, err := GetTrackedRepos(sourceDir)
|
||||
existingRepos, err := GetTrackedRepos(sourceDir, walks...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -95,7 +95,7 @@ func rehydrateMissingTrackedReposImpl(sourceDir string, parseOpts ParseOptions,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
existingRepos, err := GetTrackedRepos(sourceDir)
|
||||
existingRepos, err := GetTrackedRepos(sourceDir, sourcewalk.Options{Follow: opts.SourceFollow})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"skillshare/internal/sourcewalk"
|
||||
)
|
||||
|
||||
// makeRemote creates a bare git remote with a SKILL.md on the default branch,
|
||||
@@ -144,3 +146,25 @@ func TestInstallTrackedRepo_BranchFromSource(t *testing.T) {
|
||||
t.Errorf("cloned branch = %q, want %q", got, featureBranch)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMissingTrackedReposFollowPolicy(t *testing.T) {
|
||||
source, checkout := t.TempDir(), t.TempDir()
|
||||
mustRunGit(t, checkout, "init")
|
||||
if err := os.Symlink(checkout, filepath.Join(source, "_dev-skills")); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store := LoadMetadataOrNew(source)
|
||||
store.Set("_dev-skills", &MetadataEntry{Source: "https://example.com/repo.git", Tracked: true})
|
||||
if err := store.Save(source); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
walk := sourcewalk.Options{Follow: sourcewalk.NewFollow(source, nil)}
|
||||
missing, err := GetMissingTrackedRepos(source, walk)
|
||||
if err != nil || len(missing) != 0 {
|
||||
t.Fatalf("present followed checkout reported missing: %+v %v", missing, err)
|
||||
}
|
||||
results, err := RehydrateMissingTrackedRepos(source, ParseOptions{}, InstallOptions{SourceFollow: walk.Follow})
|
||||
if err != nil || len(results) != 0 {
|
||||
t.Fatalf("present followed checkout rehydrated: %+v %v", results, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ type missingTrackedRepoInfo struct {
|
||||
|
||||
// missingTrackedRepos returns tracked repos declared in metadata but absent on disk.
|
||||
func (s *Server) missingTrackedRepos() []missingTrackedRepoInfo {
|
||||
repos, err := install.GetMissingTrackedRepos(s.cfg.EffectiveSkillsSource())
|
||||
repos, err := install.GetMissingTrackedRepos(s.cfg.EffectiveSkillsSource(), s.skillsWalk())
|
||||
if err != nil || len(repos) == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -527,6 +527,7 @@ func (s *Server) handleRehydrateTrackedRepos(w http.ResponseWriter, r *http.Requ
|
||||
opts := install.InstallOptions{
|
||||
AuditThreshold: s.updateAuditThreshold(),
|
||||
SourceDir: sourceDir,
|
||||
SourceFollow: s.skillsWalk().Follow,
|
||||
}
|
||||
if s.IsProjectMode() {
|
||||
opts.AuditProjectRoot = s.projectRoot
|
||||
|
||||
@@ -196,3 +196,37 @@ func assertUpdateFollowLink(t *testing.T, link string) {
|
||||
t.Fatalf("source link was replaced: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleRehydrate_FollowedCheckoutWithMetadata(t *testing.T) {
|
||||
for _, project := range []bool{false, true} {
|
||||
t.Run(fmt.Sprintf("project=%t", project), func(t *testing.T) {
|
||||
s, source := newUpdateFollowServer(t, project, true)
|
||||
checkout := t.TempDir()
|
||||
initGitRepo(t, checkout)
|
||||
link := filepath.Join(source, "_dev-skills")
|
||||
if err := os.Symlink(checkout, link); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store := install.LoadMetadataOrNew(source)
|
||||
store.Set("_dev-skills", &install.MetadataEntry{Source: "file://" + checkout, Tracked: true})
|
||||
if err := store.Save(source); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if repos := s.missingTrackedRepos(); len(repos) != 0 {
|
||||
t.Fatalf("followed checkout reported missing: %+v", repos)
|
||||
}
|
||||
rr := httptest.NewRecorder()
|
||||
s.handleRehydrateTrackedRepos(rr, httptest.NewRequest(http.MethodPost, "/api/update/rehydrate", nil))
|
||||
var resp struct {
|
||||
Results []install.RehydrateResult `json:"results"`
|
||||
}
|
||||
if err := json.Unmarshal(rr.Body.Bytes(), &resp); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if rr.Code != http.StatusOK || len(resp.Results) != 0 {
|
||||
t.Fatalf("followed checkout rehydrated: %d %s", rr.Code, rr.Body.String())
|
||||
}
|
||||
assertUpdateFollowLink(t, link)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +153,9 @@ skillshare update _repo --force -p # Discard local changes
|
||||
| `--json` | JSON output |
|
||||
| `--diff` | Show file-level change summary after update |
|
||||
|
||||
With `follow_source_links: true`, `update --all` skips followed Git checkouts,
|
||||
even with `--force`; update them by name instead.
|
||||
|
||||
**Safety:** Tracked repos with uncommitted changes are skipped, and repos whose git status cannot be read fail. Use `--force` to override both.
|
||||
|
||||
**Security:** Updates roll back when findings reach the configured block threshold.
|
||||
|
||||
@@ -181,7 +181,7 @@ skillshare sync
|
||||
If `~/code/dev-skills` contains a `.git` entry, `_dev-skills` becomes a tracked-repo group and its children are discovered as skills. Sync links or copies them like any other skill. In symlink mode, editing files in the real checkout is visible immediately in targets; copy mode requires another sync.
|
||||
|
||||
:::warning Updates change the real checkout
|
||||
`skillshare update _dev-skills` runs git inside `~/code/dev-skills`, not a separate managed clone. `skillshare update _dev-skills --force` resets that real checkout and discards its local changes. `skillshare update --all` skips followed links with a warning for that reason; update them by name. `skillshare install <url> --track --update` refuses to pull a followed checkout with uncommitted changes, because a blocking audit finding could roll it back with `git reset --hard`; commit or stash first. The dashboard never updates followed Git checkouts, including force retries; they are managed by you.
|
||||
`skillshare update _dev-skills` runs git inside `~/code/dev-skills`, not a separate managed clone. `skillshare update _dev-skills --force` resets that real checkout and discards its local changes. `skillshare update --all` skips followed links with a warning for that reason, including with `--force`; update them by name. `skillshare install <url> --track --update` refuses to pull a followed checkout with uncommitted changes, because a blocking audit finding could roll it back with `git reset --hard`; commit or stash first. The dashboard never updates followed Git checkouts, including force retries; they are managed by you.
|
||||
:::
|
||||
|
||||
#### Safety guards
|
||||
|
||||
+1
-1
@@ -183,7 +183,7 @@ skillshare sync
|
||||
`~/code/dev-skills` に `.git` エントリが含まれていれば、`_dev-skills` は Tracked リポジトリのグループになり、その子ディレクトリが Skill として検出されます。Sync は他の Skill と同様にそれらをリンクまたはコピーします。symlink モードでは、実際のチェックアウト内のファイルを編集するとすぐに Target に反映されます。copy モードでは再度 sync が必要です。
|
||||
|
||||
:::warning update は実際のチェックアウトを変更します
|
||||
`skillshare update _dev-skills` は、別途管理される clone ではなく `~/code/dev-skills` の中で git を実行します。`skillshare update _dev-skills --force` はその実際のチェックアウトをリセットし、ローカルの変更を破棄します。この理由から、`skillshare update --all` はたどられたリンクを警告付きでスキップします。名前を指定して update してください。`skillshare install <url> --track --update` は、コミットされていない変更があるたどられたチェックアウトの pull を拒否します。ブロックする audit の検出結果によって `git reset --hard` で巻き戻される可能性があるため、先にコミットするか stash してください。ダッシュボードは強制再試行を含め、たどられた Git チェックアウトを更新しません。ユーザーが管理してください。
|
||||
`skillshare update _dev-skills` は、別途管理される clone ではなく `~/code/dev-skills` の中で git を実行します。`skillshare update _dev-skills --force` はその実際のチェックアウトをリセットし、ローカルの変更を破棄します。この理由から、`skillshare update --all` は `--force` を指定しても、たどられたリンクを警告付きでスキップします。名前を指定して update してください。`skillshare install <url> --track --update` は、コミットされていない変更があるたどられたチェックアウトの pull を拒否します。ブロックする audit の検出結果によって `git reset --hard` で巻き戻される可能性があるため、先にコミットするか stash してください。ダッシュボードは強制再試行を含め、たどられた Git チェックアウトを更新しません。ユーザーが管理してください。
|
||||
:::
|
||||
|
||||
#### 安全ガード {#safety-guards}
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ skillshare sync
|
||||
`~/code/dev-skills`에 `.git` 항목이 있으면 `_dev-skills`는 tracked repo 그룹이 되고, 그 하위 항목들이 skill로 발견됩니다. sync는 다른 skill과 마찬가지로 이를 링크하거나 복사합니다. symlink 모드에서는 실제 checkout에서 편집한 파일이 target에 즉시 반영되며, copy 모드에서는 sync를 한 번 더 실행해야 합니다.
|
||||
|
||||
:::warning update는 실제 checkout을 변경합니다
|
||||
`skillshare update _dev-skills`는 별도의 관리형 clone이 아니라 `~/code/dev-skills` 안에서 git을 실행합니다. `skillshare update _dev-skills --force`는 그 실제 checkout을 reset하고 로컬 변경 사항을 버립니다. 같은 이유로 `skillshare update --all`은 따라간 링크를 경고와 함께 건너뛰므로, 이름을 지정해 update하세요. `skillshare install <url> --track --update`는 커밋하지 않은 변경이 있는 연결된 체크아웃의 pull을 거부합니다. 차단 수준의 audit 결과로 `git reset --hard`가 실행될 수 있으므로 먼저 커밋하거나 stash하세요. 대시보드는 강제 재시도를 포함해 연결된 Git 체크아웃을 업데이트하지 않습니다. 사용자가 직접 관리합니다.
|
||||
`skillshare update _dev-skills`는 별도의 관리형 clone이 아니라 `~/code/dev-skills` 안에서 git을 실행합니다. `skillshare update _dev-skills --force`는 그 실제 checkout을 reset하고 로컬 변경 사항을 버립니다. 같은 이유로 `skillshare update --all`은 `--force`를 지정해도 따라간 링크를 경고와 함께 건너뛰므로, 이름을 지정해 update하세요. `skillshare install <url> --track --update`는 커밋하지 않은 변경이 있는 연결된 체크아웃의 pull을 거부합니다. 차단 수준의 audit 결과로 `git reset --hard`가 실행될 수 있으므로 먼저 커밋하거나 stash하세요. 대시보드는 강제 재시도를 포함해 연결된 Git 체크아웃을 업데이트하지 않습니다. 사용자가 직접 관리합니다.
|
||||
:::
|
||||
|
||||
#### 안전 장치 {#safety-guards}
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ skillshare sync
|
||||
如果 `~/code/dev-skills` 包含 `.git` 条目,`_dev-skills` 就会成为一个 tracked repo 分组,其子目录会被发现为 Skill。Sync 会像对待其他 Skill 一样链接或复制它们。在 symlink 模式下,在真实 checkout 中编辑文件会立即反映到 Target;copy 模式则需要再执行一次 sync。
|
||||
|
||||
:::warning update 会修改真实的 checkout
|
||||
`skillshare update _dev-skills` 会在 `~/code/dev-skills` 内部运行 git,而不是在一个单独管理的克隆中。`skillshare update _dev-skills --force` 会重置这个真实的 checkout 并丢弃其本地修改。正因如此,`skillshare update --all` 会跳过被跟随的链接并给出警告;请按名称单独更新它们。`skillshare install <url> --track --update` 会拒绝拉取存在未提交修改的链接 checkout,因为阻断级别的 audit 结果可能通过 `git reset --hard` 回滚它;请先 commit 或 stash。dashboard 永远不会更新链接指向的 Git checkout,包括强制重试;这些 checkout 由你管理。
|
||||
`skillshare update _dev-skills` 会在 `~/code/dev-skills` 内部运行 git,而不是在一个单独管理的克隆中。`skillshare update _dev-skills --force` 会重置这个真实的 checkout 并丢弃其本地修改。正因如此,`skillshare update --all`(即使加上 `--force`) 会跳过被跟随的链接并给出警告;请按名称单独更新它们。`skillshare install <url> --track --update` 会拒绝拉取存在未提交修改的链接 checkout,因为阻断级别的 audit 结果可能通过 `git reset --hard` 回滚它;请先 commit 或 stash。dashboard 永远不会更新链接指向的 Git checkout,包括强制重试;这些 checkout 由你管理。
|
||||
:::
|
||||
|
||||
#### 安全防护 {#safety-guards}
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ skillshare sync
|
||||
如果 `~/code/dev-skills` 內含 `.git` 項目,`_dev-skills` 就會成為一個 tracked-repo 群組,其子目錄會被探索為 Skill。Sync 會像其他 Skill 一樣連結或複製它們。在 symlink 模式下,在真實 checkout 中編輯檔案會立即反映在 Target 上;copy 模式則需要再 sync 一次。
|
||||
|
||||
:::warning Update 會改動真實的 checkout
|
||||
`skillshare update _dev-skills` 會在 `~/code/dev-skills` 內執行 git,而不是在另一個受管理的 clone 中。`skillshare update _dev-skills --force` 會重設該真實 checkout 並丟棄其本機變更。基於同樣的理由,`skillshare update --all` 會略過已跟進的連結並顯示警告;請以名稱逐一更新。`skillshare install <url> --track --update` 會拒絕拉取有未提交變更的連結 checkout,因為阻擋性的 audit 發現可能透過 `git reset --hard` 回滾它;請先 commit 或 stash。dashboard 永遠不會更新連結指向的 Git checkout,包含強制重試;這些 checkout 由你管理。
|
||||
`skillshare update _dev-skills` 會在 `~/code/dev-skills` 內執行 git,而不是在另一個受管理的 clone 中。`skillshare update _dev-skills --force` 會重設該真實 checkout 並丟棄其本機變更。基於同樣的理由,`skillshare update --all`(即使加上 `--force`) 會略過已跟進的連結並顯示警告;請以名稱逐一更新。`skillshare install <url> --track --update` 會拒絕拉取有未提交變更的連結 checkout,因為阻擋性的 audit 發現可能透過 `git reset --hard` 回滾它;請先 commit 或 stash。dashboard 永遠不會更新連結指向的 Git checkout,包含強制重試;這些 checkout 由你管理。
|
||||
:::
|
||||
|
||||
#### 安全防護 {#safety-guards}
|
||||
|
||||
Reference in New Issue
Block a user