Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SourceTree comments in commit message (starting with '#')

Jonathan Wiens
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 26, 2014

When using commit.template config (see https://answers.atlassian.com/questions/143622/git-config-commit-template-apparently-not-working) SourceTree reads the template file just fine. When committing, it doesn't ignore lines starting with '#' though, as it was designed by git.

In the terminal, when committing with a message that contains lines starting with a '#', git ignores those lines and does not make them part of the actual commit message. SourceTree on the other hand makes them part of the actual commit message.

Is this behaviour wanted? If yes, why?

I want commit message templates that explain where what goes, specifying keywords that dynamically interact with a project management platform (Redmine, http://www.redmine.org/projects/redmine/wiki/RedmineSettings#Referencing-issues-in-commit-messages) as comments that should be ignored in the actual commit message.

I'm currently working with SourceTree 1.5.2.0 on Windows 8 and system Git version 1.9.0

Thanks!

1 answer

0 votes
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2012

The reason it's done that way is that the file-specific log is currently just linear (no graph, just a simple history) to show how the file got into that state. If in the future the history diverged into multiple branches that wouldn't work. For simplicity the file history was kept to just 'how did I get here'.

An alternative is to use the File Status view (Cmd-1), switch to 'Show All' and start typing the name of the file in the search to find it quickly, then do Log Selected from there, which will give you all the history to the current day.

Martin Fowler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 29, 2014

I get irritated by this regularly too, and have a UX suggestion. How about showing all the commits on this file that are ancestors of head? That way you'd have a linear history and I think that's what I usually want.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events