<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/2030/1/7/_/styles/combined.css?spaceKey=AST&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/AST/Commit+Messages">Commit Messages</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~russell">Russell Bryant</a>
    </h4>
        <br/>
                         <h4>Changes (20)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. Commit Message Formatting <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{numberedheadings} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{toc} <br> <br>h1. Commit Message Formatting <br> <br></td></tr>
            <tr><td class="diff-unchanged" >The following illustrates the basic outline for commit messages:\\  <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">2</span><span class="diff-added-chars"style="background-color: #dfd;">1</span>.</span> Special Tags for Commit Messages <br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> Mantis (https://issues.asterisk.org/) <br></td></tr>
            <tr><td class="diff-unchanged" > <br>To have a commit noted in an issue, use a tag of the form: <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">* (issue #1234) <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{noformat} <br>(issue #1234) <br>{noformat} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >To have a commit automatically close an issue, use a tag of the form: <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">* (closes issue #1234) <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{noformat} <br>(closes issue #1234) <br>{noformat} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >When making a commit for a mantis issue, it is easiest to use the  provided commit message template functionality. It will format the  special tags appropriately, and will also include information about who  reported the issue, which patches are being applied, and who did  testing. <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>Here is an example of what the template will generate for you: <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{code}</span> <span class="diff-added-words"style="background-color: #dfd;">{noformat}</span> <br></td></tr>
            <tr><td class="diff-unchanged" >(closes issue #1234) <br></td></tr>
            <tr><td class="diff-unchanged" >Reported by: SomeGuy
Patches:
     fix_bug_1234.diff uploaded by SomeDeveloper (license 5678) <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{code}</span> <span class="diff-added-words"style="background-color: #dfd;">{noformat}</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>If the patch being committed was written by the person doing the commit,  and is not available to reference as an upload to the issue, there is  no need to include something like &quot;fixed by me&quot;, as that will be the  default assumption when a specific patch is not referenced. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> Review Board (https://reviewboard.asterisk.org/) <br></td></tr>
            <tr><td class="diff-unchanged" > <br>To have a commit set a review request as submitted, include the full URL  to the review request. For example: <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">* Review: https://reviewboard.asterisk.org/r/95/ <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Note:The trailing  slash in the review URL is required. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{noformat} <br>Review: https://reviewboard.asterisk.org/r/95/ <br>{noformat} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1. Commit Messages with svnmerge <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. Commit Messages with svnmerge <br> <br></td></tr>
            <tr><td class="diff-unchanged" >When using the svnmerge tool for merging changes between branches, use  the commit message generated by svnmerge. The &#39;-f&#39; option to svnmerge  allows you to specify a file for svnmerge to write out a commit message  to. The &#39;-F&#39; option to svn commit allows you to specify a file that  contains the commit message. <br> <br>If you are using the expect script wrappers for svnmerge from repotools,  a commit message is automatically placed in the file &#39;../merge.msg&#39;. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >For more detailed information about working with branches and merging,  see <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">the following page on asterisk.org:</span> <span class="diff-added-words"style="background-color: #dfd;">[Subversion Usage].</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">* [http://www.asterisk.org/developers/svn-branching-merging|http://www.asterisk.org/developers/svn-branching-merging] <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>{numberedheadings} <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        

<div>
<ul>
    <li><a href='#CommitMessages-CommitMessageFormatting'>1. Commit Message Formatting</a></li>
    <li><a href='#CommitMessages-SpecialTagsforCommitMessages'>2. Special Tags for Commit Messages</a></li>
<ul>
    <li><a href='#CommitMessages-Mantis%28https%3A%2F%2Fissues.asterisk.org%2F%29'>2.1. Mantis ( https://issues.asterisk.org/)</a></li>
    <li><a href='#CommitMessages-ReviewBoard%28https%3A%2F%2Freviewboard.asterisk.org%2F%29'>2.2. Review Board ( https://reviewboard.asterisk.org/)</a></li>
</ul>
    <li><a href='#CommitMessages-CommitMessageswithsvnmerge'>3. Commit Messages with svnmerge</a></li>
</ul></div>

<h1><a name="CommitMessages-CommitMessageFormatting"></a>1. Commit Message Formatting</h1>

<p>The following illustrates the basic outline for commit messages:<br class="atl-forced-newline" /> </p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: java; gutter: false"><![CDATA[
  &lt;One-liner summary of changes&gt;

  &lt;Empty Line&gt;

  &lt;Verbose description of the changes&gt;

  &lt;Empty Line&gt;

  &lt;Special Tags&gt;
]]></script>
</div></div>

<p>Some commit history viewers treat the first line of commit messages as  the summary for the commit. So, an effort should be made to format our  commit messages in that fashion. The verbose description may contain  multiple paragraphs, itemized lists, etc. Always end the first sentence  (and any subsequent sentences) with punctuation.</p>

<p>Commit messages should be wrapped at 80 columns.<br class="atl-forced-newline" /> Note:For  trivial commits, such as "fix the build", or "fix spelling mistake", the  verbose description may not be necessary.</p>


<h1><a name="CommitMessages-SpecialTagsforCommitMessages"></a>2. Special Tags for Commit Messages</h1>


<h2><a name="CommitMessages-Mantis%28https%3A%2F%2Fissues.asterisk.org%2F%29"></a>2.1. Mantis (<a href="https://issues.asterisk.org/" class="external-link" rel="nofollow">https://issues.asterisk.org/</a>)</h2>

<p>To have a commit noted in an issue, use a tag of the form:</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>(issue #1234)
</pre>
</div></div>

<p>To have a commit automatically close an issue, use a tag of the form:</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>(closes issue #1234)
</pre>
</div></div>

<p>When making a commit for a mantis issue, it is easiest to use the  provided commit message template functionality. It will format the  special tags appropriately, and will also include information about who  reported the issue, which patches are being applied, and who did  testing.</p>

<p>Assuming that you have bug marshal access (and if you have commit  access, it is pretty safe to assume that you do), you will find the  commit message template section directly below the issue details section  and above the issue relationships section. You will have to click the  '+' next to "Commit message template" to make the contents of the  section visible.</p>

<p>Here is an example of what the template will generate for you:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>(closes issue #1234)
Reported by: SomeGuy
Patches:
     fix_bug_1234.diff uploaded by SomeDeveloper (license 5678)
</pre>
</div></div>

<p>If the patch being committed was written by the person doing the commit,  and is not available to reference as an upload to the issue, there is  no need to include something like "fixed by me", as that will be the  default assumption when a specific patch is not referenced.</p>

<h2><a name="CommitMessages-ReviewBoard%28https%3A%2F%2Freviewboard.asterisk.org%2F%29"></a>2.2. Review Board (<a href="https://reviewboard.asterisk.org/" class="external-link" rel="nofollow">https://reviewboard.asterisk.org/</a>)</h2>

<p>To have a commit set a review request as submitted, include the full URL  to the review request. For example:</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>Review: https://reviewboard.asterisk.org/r/95/
</pre>
</div></div>

<h1><a name="CommitMessages-CommitMessageswithsvnmerge"></a>3. Commit Messages with svnmerge</h1>

<p>When using the svnmerge tool for merging changes between branches, use  the commit message generated by svnmerge. The '-f' option to svnmerge  allows you to specify a file for svnmerge to write out a commit message  to. The '-F' option to svn commit allows you to specify a file that  contains the commit message.</p>

<p>If you are using the expect script wrappers for svnmerge from repotools,  a commit message is automatically placed in the file '../merge.msg'.</p>

<p>For more detailed information about working with branches and merging,  see <a href="/wiki/display/AST/Subversion+Usage" title="Subversion Usage">Subversion Usage</a>.</p>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://wiki.asterisk.org/wiki/display/AST/Commit+Messages">View Online</a>
        |
        <a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=3702833&revisedVersion=3&originalVersion=2">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/AST/Commit+Messages?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>