question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breaks git commit -v (git commit --verbose)

See original GitHub issue

Issuehunt badges

According to the documentation for git-commit (emphasis mine)

-v –verbose Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has. Note that this diff output doesn’t have its lines prefixed with #. This diff will not be a part of the commit message.

Git is apparently able to ignore the diff block thanks to a marker preceding it, which looks like this:

# ------------------------ >8 ------------------------
# Do not touch the line above.
# Everything below will be removed.
#

Today I’ve discovered that the plugin causes the full diff to be included in the commit message (disabling/uninstalling it fixes the problem.) I’m assuming it must be messing with the “Do not touch the line above.” line, causing Git to get confused.

I could add a [COMMIT_EDITMSG] section to my .editorconfig file to try and have this file left alone, but this feels hackish. Furthermore, adding this to every repository would get tiresome.

I wonder if there is a more elegant solution to this. git commit -v is just too good to give up!

In case it matters, this is my .editorconfig file:

root = true

[*]
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

IssueHunt Summary

vogu66 vogu66 has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sindresorhuscommented, Jun 8, 2016

Could just ignore the COMMIT_EDITMSG filename in this plugin.

0reactions
issuehunt-app[bot]commented, Jul 25, 2020

@sindresorhus has rewarded $36.00 to @vogu66. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $4.00
Read more comments on GitHub >

github_iconTop Results From Across the Web

`git commit -v` by default - Stack Overflow
"git commit" learned to pay attention to the "commit.verbose" ... However, it breaks git commit arguments that have whitespace, ...
Read more >
git-commit Documentation - Git
Create a new commit which "fixes up" <commit> when applied with git rebase --autosquash . Plain --fixup=<commit> creates a "fixup!" commit which changes...
Read more >
Git tip: committing with verbose mode | tekin.co.uk
Use Git's verbose mode to see the diff of the changes you are about to commit.
Read more >
Make your git commit verbose - Mike my bytes
According to the manual ( git commit --help ):. -v , --verbose. Show unified diff between the HEAD commit and what would be...
Read more >
git-commit - man pages section 1: User Commands
showUntrackedFiles configuration variable documented in git-config(1). -v, --verbose Show unified diff between the HEAD commit and what ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found