Skip to content

feat: informative commit messages with file names and change stats#149

Open
strix-tkellogg wants to merge 10 commits into
masterfrom
informative-commit-messages
Open

feat: informative commit messages with file names and change stats#149
strix-tkellogg wants to merge 10 commits into
masterfrom
informative-commit-messages

Conversation

@strix-tkellogg
Copy link
Copy Markdown
Collaborator

Summary

Replaces the generic "dura auto-backup" commit message with useful context for recovery:

dura: 3 files (+45/-12) model.py, config.rs, utils.rs

Before: Every dura commit says "dura auto-backup" — no way to distinguish snapshots without diffing each one.

After: Commit messages show file count, insertions/deletions, and base file names (truncated at 72 chars for git log readability).

Design choices

  • Branch names unchanged — hash-based naming stays stable across snapshots (Tim's comment on Make dura branch names more informative #91: the date-based approach breaks the "update in place" model)
  • Commit message, not branch name — per Tim's suggestion, the commit message is featured more prominently than the branch name in most git viewers
  • Base file names only — saves space, avoids long paths dominating the message
  • 72-char truncation — stays readable in standard git log --oneline
  • Graceful fallback — if stats fail for any reason, falls back to "dura auto-backup"

Closes #91

Test plan

  • cargo check — compiles clean
  • cargo clippy -- -D warnings — no warnings
  • cargo test — 29/29 passing (2 new tests for commit message content)
  • CI across all 3 platforms (ubuntu, macos, windows)

🤖 Generated with Claude Code

nextzhou and others added 9 commits March 11, 2026 13:40
Add a `dura status` subcommand that shows daemon liveness and lists
watched repositories, addressing issue #94.

Features:
- Shows whether `dura serve` is running with PID
- Lists all watched repositories from config
- Displays config file and cache directory paths
- `--json` flag for machine-readable output
- Exit code 0 when running, 1 when not running
- Cross-platform PID liveness check via sysinfo crate

Changes:
- Cargo.toml: add sysinfo dependency
- src/database.rs: add RuntimeLock::is_alive() with sysinfo-based
  process detection (replaces need for platform-specific code)
- src/main.rs: add status subcommand, --json flag, status() handler
- tests/status_test.rs: 6 integration tests covering all scenarios
- tests/util/dura.rs: add run_output() helper for capturing full output

Closes #94
When a repository has been initialized but has no commits yet,
repo.head() returns ErrorCode::UnbornBranch. Previously this
propagated as an error, causing noisy log spam every poll cycle.

Now capture() handles unborn branches by:
- Using "dura/unborn" as the branch name
- Diffing against an empty tree (all files are new)
- Creating the initial commit with no parents
- Transitioning to normal branch naming once the user commits

Also removes a leftover dbg!() macro from poll_guard.rs that
printed to stderr on every change detection.

Fixes #128

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- actions/checkout@v3 → v4
- actions/upload-artifact@v3 → v4
- actions-rs/toolchain@v1 → dtolnay/rust-toolchain@stable (actions-rs is archived)
- actions-rs/cargo@v1 → direct cargo commands (actions-rs is archived)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Allow dead_code on Stats struct (log.rs)
- Use next_back() instead of last() on DoubleEndedIterator (metrics.rs)
- Use is_some_and() instead of map_or(false, ...) (snapshots.rs)
- Add explicit lifetime annotation on GitRepoIter return (config.rs)
- non_minimal_cfg: #[cfg(all(unix))] → #[cfg(unix)]
- needless_borrow: remove & from default_value arg
- redundant_closure: unwrap_or_else(|| fn()) → unwrap_or_else(fn)
- iter_kv_map: .iter().map(|(k,_)|...) → .keys().map(|k|...)
- for_kv_map: for (k, _) in &map → for k in map.keys()
ntapi 0.3.6 has misaligned references to packed struct fields
(E0793) which Rust 1.94 now rejects as a hard error. The 0.3.7
release fixes this. Transitive dep via tokio → mio 0.7.14.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ntapi 0.3.7 still had E0793 (misaligned packed struct references).
Updating tokio pulls mio 0.8 which drops the ntapi 0.3.x dependency
entirely, leaving only ntapi 0.4.3 which compiles clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces the generic "dura auto-backup" commit message with useful
context: file count, insertions/deletions, and base file names.
Example: "dura: 3 files (+45/-12) model.py, config.rs, utils.rs"

Branch names stay hash-based (stable across snapshots). The commit
message is where users actually look when recovering, per #91.

File names truncate at 72 chars to stay readable in git log.

Closes #91

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner

@tkellogg tkellogg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update the merge conflicts and then ship it

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.

Make dura branch names more informative

3 participants