From 665f02cbe8fd04e381e40abe145ad5fd27f2afed Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Sat, 12 Jul 2025 10:00:22 -0600 Subject: [PATCH] when changing state, include old state in git log message Before this commit: change state of issue f3990ac13cd93a925f2a66e6a72eb0f2 to backlog After this commit: change state of issue 406e2330695040fed5fdbcaae5d2b331, new -> inprogress --- src/issue.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/issue.rs b/src/issue.rs index 15d97f0..b309cae 100644 --- a/src/issue.rs +++ b/src/issue.rs @@ -251,6 +251,7 @@ impl Issue { /// Change the State of the Issue. pub fn set_state(&mut self, new_state: State) -> Result<(), IssueError> { + let old_state = self.state.clone(); let mut state_filename = std::path::PathBuf::from(&self.dir); state_filename.push("state"); let mut state_file = std::fs::File::create(&state_filename)?; @@ -260,8 +261,9 @@ impl Issue { crate::git::commit( &self.dir, &format!( - "change state of issue {} to {}", + "change state of issue {}, {} -> {}", self.dir.file_name().unwrap().to_string_lossy(), + old_state, new_state, ), )?;