You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commit messages of automated comments appends the full output of .git/hooks/prepare-commit-msg including comment lines, which must be ignored.
Observed behaviour
Blackbox sometimes do automated comments, such as when files are added/removed to blackbox.
.git/hooks/prepare-commit-msg is a script which modifies the commit message file before it is opened with the users configured editor when just git commit is called.
In my case I append the last five commit messages to remember what I have done before when writing the current message, therefore .git/hooks/prepare-commit-msg is in my case:
#!/bin/bash# shows last 5 commit messages as comment when doing a commit
BRANCH_NAME=$(git branch | grep '*'| sed 's/* //')if [ $BRANCH_NAME!='(no branch)' ];thenecho"#">>$1echo"# Last 5 commit messages">>$1echo"# ----------------------">>$1
COMMITS=`git log --pretty=format:"# %h %s [%an]" -5`echo"${COMMITS}">>$1fi
.git/hooks/prepare-commit-msg is allowed to add lines which are then later part of the commit message, but all lines in commit message file starting with a # (comment lines) must be ignored.
For some reason the automated blackbox comments include the entire output of .git/hooks/prepare-commit-msg, also comment lines!
Such a comment message created by blackbox here when removing the file foo.txt, then looks like:
blackbox must fulfil the rules of git hooks and the commit message file. That the hooks are called, also for blackbox automated commits, is correct and non-comment lines must part of the commit message, but all comment lines must be ignored.
Tested with current blackbox master (commit 0626efa) on a Linux machine and git 2.7.4.
The text was updated successfully, but these errors were encountered:
Brief
Commit messages of automated comments appends the full output of
.git/hooks/prepare-commit-msg
including comment lines, which must be ignored.Observed behaviour
Blackbox sometimes do automated comments, such as when files are added/removed to blackbox.
.git/hooks/prepare-commit-msg
is a script which modifies the commit message file before it is opened with the users configured editor when justgit commit
is called.In my case I append the last five commit messages to remember what I have done before when writing the current message, therefore
.git/hooks/prepare-commit-msg
is in my case:.git/hooks/prepare-commit-msg
is allowed to add lines which are then later part of the commit message, but all lines in commit message file starting with a#
(comment lines) must be ignored.For some reason the automated blackbox comments include the entire output of
.git/hooks/prepare-commit-msg
, also comment lines!Such a comment message created by blackbox here when removing the file
foo.txt
, then looks like:Expected behaviour
blackbox must fulfil the rules of git hooks and the commit message file. That the hooks are called, also for blackbox automated commits, is correct and non-comment lines must part of the commit message, but all comment lines must be ignored.
Tested with current blackbox master (commit 0626efa) on a Linux machine and git 2.7.4.
The text was updated successfully, but these errors were encountered: