Skip to content

feat(just): maintain の冒頭で dotfiles を git pull (ワンショット化) - #83

Merged
gapul merged 1 commit into
mainfrom
feat/maintain-git-pull
Jul 28, 2026
Merged

feat(just): maintain の冒頭で dotfiles を git pull (ワンショット化)#83
gapul merged 1 commit into
mainfrom
feat/maintain-git-pull

Conversation

@gapul

@gapul gapul commented Jul 28, 2026

Copy link
Copy Markdown
Owner

背景

jd maintain は flake input を更新するが自分の dotfiles リポは pull しないため、修正が main にマージ済みでも local が古いと旧レシピで維持して失敗する事故が起きた(今日の brew/pear-desktop 連鎖はこれが一因)。

変更

_maintain-macos / _maintain-linux の冒頭で本体ツリーを git pull --rebase --autostash(main ブランチのときだけ)。これで「同期 → 更新 → rebuild → gc」の真のワンショットになる。

二重 rebuild 対策: pull は post-merge/post-rewrite hook を発火して just rebuild を走らせるが、maintain はこの後に自前で rebuild する。maintain が DOTFILES_MAINTAIN=1 を export し、nix/home/git-hooks.nix の hook が同変数で早期 exit してスキップする。

  • main ブランチ限定 (feature/detached/worktree では pull しない)
  • WIP は --autostash で保全

🤖 Generated with Claude Code

maintain は flake input を更新するのに自分のリポは pull せず、local が古い
まま旧レシピで維持して失敗する事故が起きていた。maintain の趣旨は「全部
最新にする」なので、冒頭で本体ツリーを git pull --rebase --autostash する。

- main ブランチのときだけ pull (feature/detached では触らない)。WIP は autostash。
- pull が post-merge/post-rewrite hook を発火し二重 rebuild になるのを、
  DOTFILES_MAINTAIN=1 を export し hook 側で早期 exit して抑止。
- macOS/Linux 両 maintain に適用。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gapul
gapul enabled auto-merge (squash) July 28, 2026 00:29
@gapul
gapul merged commit 3500447 into main Jul 28, 2026
3 checks passed
@gapul
gapul deleted the feat/maintain-git-pull branch July 28, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant