{"record":{"id":"e88f113ff0075396","repo":"GitoxideLabs/gitoxide","slug":"the-edited-commit-message-is-empty-e88f11","errorCode":null,"errorMessage":"the edited commit message is empty","messagePattern":"the edited commit message is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/reword.rs","lineNumber":163,"sourceCode":"    repo: gix::Repository,\n    graph: &crate::history::HistoryGraph,\n    old_id: gix::ObjectId,\n    edited: &[u8],\n) -> Result<Outcome> {\n    apply_conflict_reporting(repo, graph, old_id, edited, |_| {})?.complete()\n}\n\n#[tracing::instrument(skip_all, fields(commit_id = %old_id))]\npub(crate) fn apply_conflict_reporting(\n    repo: gix::Repository,\n    graph: &crate::history::HistoryGraph,\n    old_id: gix::ObjectId,\n    edited: &[u8],\n    mut report: impl FnMut(rebase::Progress),\n) -> Result<Perform> {\n    let edit = parse(edited)?;\n    if edit.message.is_empty() {\n        anyhow::bail!(\"the edited commit message is empty\");\n    }\n\n    let mut commit = repo\n        .find_commit(old_id)\n        .context(\"could not find commit after editing\")?\n        .decode()\n        .context(\"could not decode commit after editing\")?\n        .into_owned()\n        .context(\"could not own commit after editing\")?;\n    let author = actor(edit.author, edit.author_time, \"author\")?;\n    let commit_changed = author != commit.author || edit.message != commit.message;\n    let (rebased, enrichment, enrich_change) = if commit_changed {\n        commit.author = author;\n        commit.committer = actor(edit.committer, edit.committer_time, \"committer\")?;\n        commit.message = edit.message;\n        let (performed, enrichment) =\n            apply_commit_conflict_with_enrichment(&repo, graph, old_id, commit, &edit.enrichment, &mut report)?;\n        let outcome = match performed {","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/reword.rs#L145-L181","documentation":"After the user saves the editor, `apply_conflict_reporting` parses the edited document and refuses to continue if the resulting commit message is empty. Rewording to an empty message is not allowed, so the reword/apply step is aborted with this error before any commit is rewritten.","triggerScenarios":"Calling `apply_conflict_reporting` (from `apply`) with an `edited` buffer whose parsed `edit.message` is empty — i.e. the user cleared the message in the editor, or the editor saved only comment/todo lines that were stripped by `parse`/`cleanup_message`.","commonSituations":"A developer opens the reword editor, deletes the entire message (or all non-comment lines) and saves; an editor or script truncates the file; an automated flow pipes an empty message buffer into apply.","solutions":["Re-run the reword and keep at least a non-empty summary line in the editor before saving.","If comments were stripped unintentionally, check the editor's comment character handling (CommentChar lines are ignored, not kept as message).","Abort the reword if an empty message was intended — this operation cannot produce an empty commit message.","In scripted flows, validate the message buffer is non-empty before invoking `apply`."],"exampleFix":"// before\napply(repo, state, edited_bytes)?;\n// after\nif cleanup_message(edited_bytes, None).is_empty() {\n    anyhow::bail!(\"reword aborted: message must not be empty\");\n}\napply(repo, state, edited_bytes)?;","handlingStrategy":"validation","validationCode":"fn edited_message_nonempty(edited: &[u8]) -> bool {\n    edited.iter().any(|&b| b != b'\\n' && b != b'\\r' && b != b' ' && b != b'\\t')\n}","typeGuard":null,"tryCatchPattern":"match apply(repo, state, edited) {\n    Ok(perform) => perform,\n    Err(e) if e.to_string().contains(\"edited commit message is empty\") => {\n        eprintln!(\"Reword aborted: keep at least one summary line in the editor.\");\n        revert_to_pre_edit_state(state)\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Never delete the whole message in the reword editor; keep a summary line.","Check editor settings that strip trailing content or comments aggressively.","In scripted flows, assert the message buffer is non-empty before calling apply."],"tags":["git","commit-message","validation","reword","empty-input"],"backgroundTag":"empty-required-field","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}