commit.verbose support in commit message editor
Both git commit and during a reword during rebase show the staged patch within the editor. I find it very useful context to have while crafting the message, it would be great for git-revisebto do the same.
Currently the editor only shows the output of git diff-tree --stat A B in the extra text information. Theoretically it would be possible to add extra information though.
What info in particular from git commit would you want to add?
I'm sorry I forgot that I've got commit.verbose=true configured, this shows me the changes to be committed as a patch embedded in the message. Here's output of git commit --amend (implicit --verbose) of current master:
❯ cat .git/COMMIT_EDITMSG
Remove unused import
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Author: Nika Layzell <[email protected]>
# Date: Fri Aug 16 00:08:52 2019 -0700
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# modified: gitrevise/utils.py
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/gitrevise/utils.py b/gitrevise/utils.py
index f891356..9698dc5 100644
--- a/gitrevise/utils.py
+++ b/gitrevise/utils.py
@@ -1,5 +1,5 @@
from typing import List, Optional, Tuple
-from subprocess import run, CalledProcessError, PIPE
+from subprocess import run, CalledProcessError
from pathlib import Path
import textwrap
It would be great if git-revise would read the commit.verbose setting and follow suit.
I will try implementing this soon. This is the relevant logic in git for what to print when commit.verbose = true.
Fixed in https://github.com/mystor/git-revise/pull/126 Would be nice if someone could review it and merge 🙏