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.

git commit -m to pre-fill commit title

See original GitHub issue

With husky setup, the -m is lost.

I’m a CLI guru, so if I typed -m already, it should be used as a base, for example, add the category to it unless missing.

$ git commit -m 'Add prepare commit msg hook'
$ git commit -m 'feat: Add prepare commit msg hook'

currently have to re-type everything with several prompts. kind of slows down the commit process, driving away from the git hook setup.

Husky part:

--- a/package.json
+++ b/package.json
@@ -105,6 +105,7 @@
   },
   "husky": {
     "hooks": {
+      "prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
       "pre-commit": "lint-staged"
     }
   },

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
garronejcommented, Feb 22, 2022

Hi,
Just to add to this thread: This shortcoming is this only thing preventing me from recommending cz.

1reaction
glensccommented, Nov 22, 2021

@nevstokes: quote "$file" to avoid word splitting

Read more comments on GitHub >

github_iconTop Results From Across the Web

git commit: pre-populate commit subject but still prompt for a ...
What I'm looking for is a way to have the commit subject pre-populated while still being able to write the commit message manually....
Read more >
git-commit Documentation - Git
NAME. git-commit - Record changes to the repository ... The commit message subject line is taken from the specified commit with a prefix...
Read more >
Git Commit | Atlassian Git Tutorial
A power user shortcut command that combines the -a and -m options. This combination immediately creates a commit of all the staged changes...
Read more >
VS Code Extension Git Prefix - Prefill Your Commit Message ...
... extension for VS Code called Git Prefix by Samuel Meyers that let's you prefill your git commit messages with your branch name....
Read more >
MR Title and Description should be pre-filled from first ... - GitLab
The merge request's title if no multi-line commit message is found. ... gp gitlab @:refs/heads/commit-message-template --force Total 0 ...
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