I wrote a hook-commit-msg that maps Team Foundation Server Server ID to a Git commit message. (When you commit, a selection list appears. Users can select one or more work items, and work items are added to the commit message using a specific format. Later we use Git log -grep to search for specific commits belonging to the work case).
I use the comments in the commit message to give additional information to the user. For example, when Team Foundation Server is unavailable, I add the following comment at the beginning of the commit message.
# Warning: could not access Team Foundation Server at <servername>.
Since the line starts with the # sign, it is not added to the actual commit message ... when using Git commit.
If I use Git gui, the comment appears in the Git GUI, but is actually added to the Git commit message when committed.
Is there a specific reason that Git gui actually adds lines starting with the # sign? I expected him to ignore these lines.
source
share