Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
deprecate template-file and squash-template-file config options (#445)
Maximilian Roos9502f233216e
diff --git a/docs/content/llm-commits.md b/docs/content/llm-commits.mdindex 2b3d4dd2b..e067c0f21 100644--- a/docs/content/llm-commits.md+++ b/docs/content/llm-commits.md@@ -147,16 +147,6 @@ Diff:"""```-Or load templates from files (supports `~` expansion):--```toml-[commit-generation]-command = "llm"-args = ["-m", "claude-haiku-4.5"]-template-file = "~/.config/worktrunk/commit-template.txt"-squash-template-file = "~/.config/worktrunk/squash-template.txt"-```-### Template syntaxTemplates use [minijinja](https://docs.rs/minijinja/latest/minijinja/syntax/index.html), which supports:diff --git a/src/llm.rs b/src/llm.rsindex 862b01361..f0a695d3a 100644--- a/src/llm.rs+++ b/src/llm.rs@@ -2,12 +2,17 @@ use anyhow::Context;use std::io::Write;use std::path::{Path, PathBuf};use std::process::{self, Stdio};+use std::sync::atomic::{AtomicBool, Ordering};use worktrunk::config::CommitGenerationConfig;use worktrunk::git::Repository;use worktrunk::path::format_path_for_display;+use worktrunk::styling::warning_message;use minijinja::Environment;+/// Track whether template-file deprecation warning has been shown this session+static TEMPLATE_FILE_WARNING_SHOWN: AtomicBool = AtomicBool::new(false);+/// Maximum diff size in characters before filtering kicks inconst DIFF_SIZE_THRESHOLD: usize = 400_000;@@ -325,6 +330,19 @@ fn load_template(match (inline, file) {(Some(inline), None) => Ok(inline.clone()),(None, Some(path)) => {+ // Show deprecation warning once per session+ if !TEMPLATE_FILE_WARNING_SHOWN.swap(true, Ordering::Relaxed) {+ eprintln!(+ "{}",+ warning_message(format!(+ "{} is deprecated and will be removed in a future release. \+ Use inline template instead. If you need this feature, comment on: \+ https://github.com/max-sixty/worktrunk/issues/444",+ file_type_name+ ))+ );+ }+let expanded_path = PathBuf::from(shellexpand::tilde(path).as_ref());std::fs::read_to_string(&expanded_path).map_err(|e| {anyhow::Error::from(worktrunk::git::GitError::Other {