I have the following global setting in my .gitconfig file:
commit.verbose=true
I really like seeing the file edits in vim when I'm writing a commit message. Is is also possible to have this functionality when using git merge?
The verbose flag in when merging doesn't have the same behavior as the commit verbose flag.
EDIT: Here are some screen shots to explain what I'm talking about:
Committing some edits to my develop branch and writing the message in vim could look something like. The commit.verbose flag is set to true as I noted above:
$ git commit -a

Now attempting to merge the changes into another branch (i.e. master) results in the following:
$ git checkout master && git merge -v --no-ff develop

I think the verbose option you see on the the git docs, and I used in the command above, and related to the output after a successful merge. In my example case the output was:
Merge made by the 'recursive' strategy.
README | 2 ++
1 file changed, 2 insertions(+)
Bumping up the verbosity to level 5 doesn't do what I'm asking:
$ GIT_MERGE_VERBOSITY=5 git merge -v --no-ff develop
Merging:
1b4c630 Initial commit
virtual develop
found 1 common ancestor:
1b4c630 Initial commit
Merge made by the 'recursive' strategy.
README | 2 ++
1 file changed, 2 insertions(+)
EDIT: The closest answer to my question is found in one of the answers listed HERE, essentially I get the entire diff if I execute the following before the merge
git diff <commit1> <commit2>
EDIT 2: Another way to see the full merge commit the same as a commit message is by first merging the branch, and then running
git commit --amend
This makes it possible to see the merge commit as a normal commit, at least with respect to seeing the full diff.
I think you might be looking for merge.verbosity:
merge.verbosity
Controls the amount of output shown by the recursive merge strategy. Level 0 outputs nothing except a final error message if conflicts were detected. Level 1 outputs only conflicts, 2 outputs conflicts and file changes. Level 5 and above outputs debugging information. The default is level 2. Can be overridden by the
GIT_MERGE_VERBOSITYenvironment variable.
https://git-scm.com/docs/git-merge#git-merge-mergeverbosity
Edit: based on your update with screenshots, I think I have to change my answer to: no, near as I can tell there is no way to do what you're asking with vanilla Git. Even fugitive (which I highly recommend BTW) doesn't really provide anything like that. I note this possibly relevant question.
there is a round-about way, steps are:
git merge # ... your optionsgit commit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With