$1
necessity in commit-msg
hook
#1108
-
In the docs, using
Upon testing,
Is there an edge case where |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Pinging you in case you missed this. |
Beta Was this translation helpful? Give feedback.
-
I investigated in the git source code and it seems like The Anyway, it should be safe to assume Investigation
|
Beta Was this translation helpful? Give feedback.
I investigated in the git source code and it seems like
$1
always ends with/COMMIT_EDITMSG
.The
.git
directory can be configured so the directory path may be different. I haven't worked with submodules enough but perhaps this is can be different for submodules too, as you speculate.Anyway, it should be safe to assume
.git/COMMIT_EDITMSG
as long as you're not changing the.git
directory.Investigation
The
commit-msg
commit hook is called here with argumentgit_path_commit_editmsg()
:https://github.com/git/git/blob/715d08a9e51251ad8290b181b6ac3b9e1f9719d7/builtin/commit.c#L1088
git_path_commit_editmsg
is defined usingGIT_PATH_FUNC
here:https://github.com/git/git/blob/715d08a9e51251a…