git-revise icon indicating copy to clipboard operation
git-revise copied to clipboard

commit.verbose support in commit message editor

Open mmlb opened this issue 6 years ago • 4 comments

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.

mmlb avatar Aug 15 '19 11:08 mmlb

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?

mystor avatar Aug 16 '19 06:08 mystor

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.

mmlb avatar Aug 17 '19 20:08 mmlb

I will try implementing this soon. This is the relevant logic in git for what to print when commit.verbose = true.

solson avatar Apr 26 '21 20:04 solson

Fixed in https://github.com/mystor/git-revise/pull/126 Would be nice if someone could review it and merge 🙏

nikitabobko avatar Jan 11 '23 21:01 nikitabobko