Untrack warm-state JSON and keep it out of the worktree

未关闭 适合新手
#7 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
80/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
git, javascript, node.js
领域
tooling

调研方向

先运行 git ls-files scripts 确认两个状态文件都已被跟踪,然后阅读 scripts/warm.mjs(大约第 32 行和第 139-140 行)和 scripts/warm-og.mjs(大约第 13 行和第 44-45 行)中的写入/更新位置,看看路径是在哪里选择的。添加一个统一的 state 目录辅助函数,遵循环境变量覆盖,并默认使用 ${XDG_STATE_HOME:-$HOME/.local/state}/gitone,更新 .gitignore,并用 git rm --cached 取消跟踪这两个文件。完成意味着运行两个 warmer 后 git status --porcelain 是干净的,并且该位置已在 CONTRIBUTING.md 或 scripts/ 下记录。

由索引模型根据 Issue 内容生成。

描述

bug help wanted

Current behavior

The warmers write their progress into tracked files inside the repository. Every run changes the worktree, creates review noise and can cause merge conflicts.

git status after a run shows:

M scripts/.og-warm-state.json
M scripts/.warm-state.json

Cause

  • .gitignore lists scripts/.warm-state.json, but the file is already tracked; gitignore does not untrack it.
  • scripts/.og-warm-state.json is not ignored at all.
  • scripts/warm.mjs:32 and scripts/warm-og.mjs:13 write state in place; scripts/warm.mjs:139-140 and scripts/warm-og.mjs:44-45 update it.

Expected behavior

Warm state is local runtime data, not source. Move it outside the repository, for example under ${XDG_STATE_HOME:-$HOME/.local/state}/gitone, or under an ignored scripts/.state/ directory. Untrack both files with git rm --cached; add both names to .gitignore; allow an override through an environment variable for CI or multiple checkouts.

Acceptance

  • git ls-files no longer lists either state file.
  • git status --porcelain is clean after a warm run.
  • A fresh checkout can run both warmers without creating tracked changes.
  • The state location is documented in scripts/ or CONTRIBUTING.md.
主要语言
TypeScript
星标
7
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

LangerSword/gitone 的其他 Issue

查看 LangerSword/gitone 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。