commitizen / commitizen/cz-cli

COMMIT_EDITMSG is not updated

Open
#643 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17.5k
Forks
566
Avg merge
8h 16m
Merged PRs (30d)
1

Description

Hello guys and thank you for a wonderful package!

I am experiencing some issues though if commiting from within a submodule directory.
```
(node:16959) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOTDIR: not a directory, open '/home/ubuntu/path/to/repository/submodule/.git/COMMIT_EDITMSG' [edited for bug report]
(node:16959) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
```

Nonetheless script is definitely right because hooks for submodules are located under `../.git/modules/submodule/hooks` and therefore `COMMIT_EDITMSG` file would never appear under `submodule/.git/COMMIT_EDITMSG` and `submodule/.git` is file, that's true as well ;)

I cannot give a time to resolve it by myself at the moment but will hopefully provide a solution somehow later as a contributor.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing a commit from within a Git submodule and trace the handling of COMMIT_EDITMSG. Compare the failing submodule/.git/COMMIT_EDITMSG path with the hooks location under ../.git/modules/submodule/hooks; done means the commit flow no longer tries to open the invalid path and handles the operation without an unhandled rejection.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.