Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I create a custom cleanup mode for git?
    text
    copied!<p>I'd like to have a commit message cleanup that will not necessarily remove lines beginning with a <code>#</code> in the message itself. The default <code>--cleanup=strip</code> removes <strong>all</strong> lines starting with a <code>#</code> character. </p> <p>The reason being is unfortunately, the <a href="http://trac.edgewall.org/" rel="nofollow noreferrer">Trac</a> engine's wiki formatter uses hashes in the beginning of a code block to denote the syntax type. This creates difficulty when using the engine's syntax in my commit messages. </p> <p>Example:</p> <pre><code>Created demo of perl added to helloworld.pl {{{ #!/usr/bin/perl use strict; # say hi to the user. print "hello world\n"; }}} # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD^1 &lt;file&gt;..." to unstage) # # added: helloworld.pl # and so on and so forth... </code></pre> <p>I would like the following result in the final logged commit message:</p> <pre><code>commit 1234567890123456789012345678901234567890 Author: Danny &lt;...&gt; Date: Wed Apr 7 13:34:29 2010 -0400 Created demo of perl added to helloworld.pl {{{ #!/usr/bin/perl use strict; # say hi to the user. print "hello world\n"; }}} </code></pre> <p>I'd like to use a custom filter that removes all lines beginning with a hash from the bottom of the commit message upwards. Leaving the lines in the message I have added alone. Where or how can I specify this in git?</p> <p>Note, creating a sed or perl script to perform the operation is not a problem, just knowing <em>where to hook it</em> into git is the question.</p> <p>My apologies on the confusion of my question, I hadn't realized how vague it was.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload