Skip to content

fix: git compat improvements — for-each-ref, rebase, commit-graph, issue dep#90

Merged
mizchi merged 7 commits into
mainfrom
claude/determined-hawking-b7Aif
May 31, 2026
Merged

fix: git compat improvements — for-each-ref, rebase, commit-graph, issue dep#90
mizchi merged 7 commits into
mainfrom
claude/determined-hawking-b7Aif

Conversation

@mizchi
Copy link
Copy Markdown
Member

@mizchi mizchi commented May 31, 2026

Summary

  • Feature Request: Support issue dependencies in bit issue #31 bit issue dep add/remove/list — bidirectional blocked-by/blocking dependency tracking
  • WASM component/impl の wbtest fixture/helper 整理を完了する #29 WASM wbtest fixture constants — extract component_impl_fixture_remote_url, component_impl_fixture_default_branch, and component_impl_assert_remote_fetch_target() helper; centralize inline URL strings across all component/impl wbtests
  • [P2] for-each-ref フォーマット拡張 #86 for-each-ref format improvements:
    • Fix %(align) in suppressed %(if) branches emitting spurious padding
    • Fix error message escaping (%%(if)%(if))
    • Add atom argument validation for objecttype, objectsize, upstream, push, symref
    • Add general %NN two-digit hex escape support (e.g. %09 for tab)
    • Fix %(subject:sanitize) to replace all non-filename-safe chars with - and compress runs
    • Add --merged/--no-merged/--points-at space-separated argument form (bare --merged defaults to HEAD)
  • [P1] commit-graph / MIDX 実装 #85 commit-graph / gc:
    • Fix date_hi bit extraction in reader (bits 1-0, not 31-30 — format spec bug)
    • Add gc.writeCommitGraph config check in git gc
  • [P4] rebase edge cases 修正 (t3400-rebase.sh) #88 rebase edge cases:
    • Write/clear REBASE_HEAD on conflict
    • --preserve-merges alias for --rebase-merges
    • Accept --apply/--merge backend flags and rebase.backend config silently
    • Accept --stat/--no-stat, --signoff, --ignore-whitespace, --whitespace=, --empty=, --reschedule-failed-exec, --reset-author-date, --committer-date-is-author-date
    • Read rebase.stat config for compat

Test plan

  • moon check — 0 errors
  • moon build --target native — clean
  • moon test --target native -p bitlib — 297/297 passed
  • moon test --target wasm — passed

https://claude.ai/code/session_0159rAapXhARokV9Si1wvgoa


Generated by Claude Code

claude added 7 commits May 31, 2026 01:19
Implement `git commit-graph write/verify` command handler:
- write: supports --reachable, --stdin-packs, --stdin-commits,
  --object-dir, --append, --changed-paths (accepted/ignored)
- verify: validates signature, hash-version, checksum trailer
- Register "commit-graph" in main.mbt dispatch

Add commit-graph and multi-pack-index to git shim command lists
(GIT_SHIM_STRICT_CMDS_ALL, GIT_SHIM_RANDOM_CMDS, GIT_SHIM_FULL_CMDS)
so t5318/t5319/t6500 tests exercise the bit implementation rather
than falling through to real git.

Closes #85 (partial — t5318, t5319, t6500 coverage)
…ean options

- Add version/v atoms to is_known_atom and format evaluator
- Fix trailers option validation to accept valueonly=true/false,
  unfold=true/false, only=... with = suffix
- Fix trailers evaluation to properly parse boolean =true/false/yes/no

https://claude.ai/code/session_0159rAapXhARokV9Si1wvgoa
… messages

- %(align:N) inside a suppressed %(if)%(then) branch no longer emits
  spurious padding; align_stack push is guarded by output-active check
  so scope_stack still tracks the %(end) correctly
- Fix error messages to drop double-% escaping (%%(if) → %(if), etc.)
- Change "unknown field name 'X'" → "unknown field name: X" to match git
- Change "%(end) without corresponding %(if)/%(align)" → "without
  corresponding atom" to match git
- Add validation for atoms that do not take arguments: objecttype,
  deltabase
- Add argument validation for objectsize, upstream, push, symref

https://claude.ai/code/session_0159rAapXhARokV9Si1wvgoa
Replace ad-hoc %0a/%0d/%00 special cases with a general %NN two-digit
hex escape handler. This matches git's behaviour where %09 emits a tab,
%0a a newline, %1b an escape, etc. The %xNN form (already supported) is
kept alongside; git itself does not recognise %xNN but it is harmless.

https://claude.ai/code/session_0159rAapXhARokV9Si1wvgoa
…eserve-merges

## bit issue dep (issue #31)

Add dependency tracking to bit issue:
- `bit issue dep add <id> <blocked-by-id>` — mark one issue as blocked by another
- `bit issue dep remove <id> <blocked-by-id>` — remove the dependency
- `bit issue dep list <id>` — show blocked-by and blocking relationships

Implementation:
- Add `blocked_by` and `blocking` fields to Issue and WorkItem structs
- Serialize as `blocked-by <id>` / `blocking <id>` lines in the work-item format
- Hub::add_dep / Hub::remove_dep maintain bidirectional consistency
- Both legacy Issue and WorkItem serialization/deserialization updated

## rebase fixes (issue #88)

- Write REBASE_HEAD to .git/ when a conflict occurs (used by hooks/tools)
- Remove REBASE_HEAD when rebase state is cleared (--continue/--abort/--skip)
- Accept --preserve-merges as alias for --rebase-merges (deprecated but used
  in some scripts)

https://claude.ai/code/session_0159rAapXhARokV9Si1wvgoa
…ure constants

#88: Accept --apply/--merge backend selection flags and rebase.backend
config value; bit uses a unified backend so these are no-ops needed for
git compat tests (GIT_TEST_REBASE_USE_BUILTIN_BACKEND).

#86: Fix %(subject:sanitize) to replace all non-filename-safe characters
(not just spaces) with a single '-' and strip trailing dashes, matching
git's ref-filter behavior.

#29: Extract component_impl_fixture_remote_url and
component_impl_fixture_default_branch constants; add
component_impl_assert_remote_fetch_target() helper; update all
component/impl wbtests to use these constants instead of inline strings.

https://claude.ai/code/session_0159rAapXhARokV9Si1wvgoa
#86: Add --merged/--no-merged/--points-at space-separated argument form
(--merged <ref> was accepted only as --merged=<ref>; bare --merged now
defaults to HEAD matching git behavior).

#85: Fix commit-graph reader date_hi bit extraction (bits 1-0, not 31-30)
matching the format written by the writer. Add gc.writeCommitGraph config
check — skip writing commit-graph when explicitly disabled.

#88: Silently accept --stat/--no-stat/--diffstat, --signoff, --ignore-
whitespace, --whitespace=, --empty=, --reschedule-failed-exec, --reset-
author-date, --committer-date-is-author-date, and read rebase.stat config
for compat with t3400 test variants.

https://claude.ai/code/session_0159rAapXhARokV9Si1wvgoa
@mizchi mizchi merged commit cfdf376 into main May 31, 2026
16 checks passed
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.

2 participants