|
866 | 866 | </li>
|
867 | 867 | <li>
|
868 | 868 | <p>You can launch gdb around your program using the shorthand GIT_DEBUGGER.
|
869 |
| -Run <code>GIT_DEBUGGER=1 ./bin-wrappers/git foo</code> to simply use gdb as is, or |
870 |
| -run <code>GIT_DEBUGGER="<debugger> <debugger-args>" ./bin-wrappers/git foo</code> to |
871 |
| -use your own debugger and arguments. Example: <code>GIT_DEBUGGER="ddd --gdb" |
872 |
| -./bin-wrappers/git log</code> (See <code>bin-wrappers/wrap-for-bin.sh</code>.)</p> |
| 869 | +Run <span class='synopsis'><code>GIT_DEBUGGER=1</code> <code>./bin-wrappers/git</code> <code>foo</code></span> to simply use gdb as is, or |
| 870 | +run <span class='synopsis'><code>GIT_DEBUGGER="</code><em><debugger></em> <em><debugger-args></em><code>"</code> <code>./bin-wrappers/git</code> <code>foo</code></span> to |
| 871 | +use your own debugger and arguments. Example: <span class='synopsis'><code>GIT_DEBUGGER="ddd</code> <code>--gdb"</code> |
| 872 | + |
| 873 | +<code>./bin-wrappers/git</code> <code>log</code></span> (See <span class='synopsis'><code>bin-wrappers/wrap-for-bin.sh</code></span>.)</p> |
873 | 874 | </li>
|
874 | 875 | <li>
|
875 | 876 | <p>The primary data structure that a subsystem <em>S</em> deals with is called
|
876 |
| -<code>struct S</code>. Functions that operate on <code>struct S</code> are named |
877 |
| -<code>S_<verb>()</code> and should generally receive a pointer to <code>struct S</code> as |
| 877 | +<span class='synopsis'><code>struct</code> <code>S</code></span>. Functions that operate on <span class='synopsis'><code>struct</code> <code>S</code></span> are named |
| 878 | +<span class='synopsis'><code>S_</code><em><verb></em>()</span> and should generally receive a pointer to <span class='synopsis'><code>struct</code> <code>S</code></span> as |
878 | 879 | first parameter. E.g.</p>
|
879 | 880 | <div class="literalblock">
|
880 | 881 | <div class="content">
|
|
914 | 915 | </li>
|
915 | 916 | <li>
|
916 | 917 | <p>There are several common idiomatic names for functions performing
|
917 |
| -specific tasks on a structure <code>S</code>:</p> |
| 918 | +specific tasks on a structure <span class='synopsis'><code>S</code></span>:</p> |
918 | 919 | </li>
|
919 | 920 | <li>
|
920 |
| -<p><code>S_init()</code> initializes a structure without allocating the |
| 921 | +<p><span class='synopsis'><code>S_init</code>()</span> initializes a structure without allocating the |
921 | 922 | structure itself.</p>
|
922 | 923 | </li>
|
923 | 924 | <li>
|
924 |
| -<p><code>S_release()</code> releases a structure’s contents without freeing the |
| 925 | +<p><span class='synopsis'><code>S_release</code>()</span> releases a structure’s contents without freeing the |
925 | 926 | structure.</p>
|
926 | 927 | </li>
|
927 | 928 | <li>
|
928 |
| -<p><code>S_clear()</code> is equivalent to <code>S_release()</code> followed by <code>S_init()</code> |
| 929 | +<p><span class='synopsis'><code>S_clear</code>()</span> is equivalent to <span class='synopsis'><code>S_release</code>()</span> followed by <span class='synopsis'><code>S_init</code>()</span> |
929 | 930 | such that the structure is directly usable after clearing it. When
|
930 |
| -<code>S_clear()</code> is provided, <code>S_init()</code> shall not allocate resources |
| 931 | +<span class='synopsis'><code>S_clear</code>()</span> is provided, <span class='synopsis'><code>S_init</code>()</span> shall not allocate resources |
931 | 932 | that need to be released again.</p>
|
932 | 933 | </li>
|
933 | 934 | <li>
|
934 |
| -<p><code>S_free()</code> releases a structure’s contents and frees the |
| 935 | +<p><span class='synopsis'><code>S_free</code>()</span> releases a structure’s contents and frees the |
935 | 936 | structure.</p>
|
936 | 937 | </li>
|
937 | 938 | <li>
|
|
1093 | 1094 | </li>
|
1094 | 1095 | <li>
|
1095 | 1096 | <p>Enclose the subject of an error inside a pair of single quotes,
|
1096 |
| -e.g. <code>die(_("unable to open '%s'"), path)</code>.</p> |
| 1097 | +e.g. <span class='synopsis'><code>die</code>(<code>_</code>(<code>"unable</code> <code>to</code> <code>open</code> <code>%s'"</code>)<code>,</code> <code>path</code>)</span>.</p> |
1097 | 1098 | </li>
|
1098 | 1099 | <li>
|
1099 | 1100 | <p>Unless there is a compelling reason not to, error messages from
|
1100 | 1101 | porcelain commands should be marked for translation, e.g.
|
1101 |
| -<code>die(_("bad revision %s"), revision)</code>.</p> |
| 1102 | +<span class='synopsis'><code>die</code>(<code>_</code>(<code>"bad</code> <code>revision</code> <code>%s"</code>)<code>,</code> <code>revision</code>)</span>.</p> |
1102 | 1103 | </li>
|
1103 | 1104 | <li>
|
1104 | 1105 | <p>Error messages from the plumbing commands are sometimes meant for
|
1105 | 1106 | machine consumption and should not be marked for translation,
|
1106 |
| -e.g., <code>die("bad revision %s", revision)</code>.</p> |
| 1107 | +e.g., <span class='synopsis'><code>die</code>(<code>"bad</code> <code>revision</code> <code>%s",</code> <code>revision</code>)</span>.</p> |
1107 | 1108 | </li>
|
1108 | 1109 | <li>
|
1109 | 1110 | <p>BUG("message") are for communicating the specific error to developers,
|
|
1189 | 1190 | in the abstract. E.g.</p>
|
1190 | 1191 | <div class="dlist">
|
1191 | 1192 | <dl>
|
1192 |
| -<dt class="hdlist1" id="Documentation/CodingGuidelines-code--shortcode"><a id="Documentation/CodingGuidelines---short" class="anchor" href="#Documentation/CodingGuidelines---short"></a><code>--short</code> </dt> |
| 1193 | +<dt class="hdlist1" id="Documentation/CodingGuidelines-spanclasssynopsiscode--shortcodespan"><a id="Documentation/CodingGuidelines---short" class="anchor" href="#Documentation/CodingGuidelines---short"></a><span class='synopsis'><code>--short</code></span> </dt> |
1193 | 1194 | <dd>
|
1194 | 1195 | <p>Emit output in the short-format.</p>
|
1195 | 1196 | <div class="literalblock">
|
|
1198 | 1199 | </div>
|
1199 | 1200 | </div>
|
1200 | 1201 | </dd>
|
1201 |
| -<dt class="hdlist1" id="Documentation/CodingGuidelines-code--shortcode-1"><a id="Documentation/CodingGuidelines---short-1" class="anchor" href="#Documentation/CodingGuidelines---short-1"></a><code>--short</code> </dt> |
| 1202 | +<dt class="hdlist1" id="Documentation/CodingGuidelines-spanclasssynopsiscode--shortcodespan-1"><a id="Documentation/CodingGuidelines---short-1" class="anchor" href="#Documentation/CodingGuidelines---short-1"></a><span class='synopsis'><code>--short</code></span> </dt> |
1202 | 1203 | <dd>
|
1203 | 1204 | <p>Use this to emit output in the short-format.</p>
|
1204 | 1205 | </dd>
|
1205 |
| -<dt class="hdlist1" id="Documentation/CodingGuidelines-code--shortcode-1-1"><a id="Documentation/CodingGuidelines---short-1-1" class="anchor" href="#Documentation/CodingGuidelines---short-1-1"></a><code>--short</code> </dt> |
| 1206 | +<dt class="hdlist1" id="Documentation/CodingGuidelines-spanclasssynopsiscode--shortcodespan-1-1"><a id="Documentation/CodingGuidelines---short-1-1" class="anchor" href="#Documentation/CodingGuidelines---short-1-1"></a><span class='synopsis'><code>--short</code></span> </dt> |
1206 | 1207 | <dd>
|
1207 | 1208 | <p>You can use this to get output in the short-format.</p>
|
1208 | 1209 | </dd>
|
1209 |
| -<dt class="hdlist1" id="Documentation/CodingGuidelines-code--shortcode-1-1-1"><a id="Documentation/CodingGuidelines---short-1-1-1" class="anchor" href="#Documentation/CodingGuidelines---short-1-1-1"></a><code>--short</code> </dt> |
| 1210 | +<dt class="hdlist1" id="Documentation/CodingGuidelines-spanclasssynopsiscode--shortcodespan-1-1-1"><a id="Documentation/CodingGuidelines---short-1-1-1" class="anchor" href="#Documentation/CodingGuidelines---short-1-1-1"></a><span class='synopsis'><code>--short</code></span> </dt> |
1210 | 1211 | <dd>
|
1211 | 1212 | <p>A user who prefers shorter output could…​.</p>
|
1212 | 1213 | </dd>
|
1213 |
| -<dt class="hdlist1" id="Documentation/CodingGuidelines-code--shortcode-1-1-1-1"><a id="Documentation/CodingGuidelines---short-1-1-1-1" class="anchor" href="#Documentation/CodingGuidelines---short-1-1-1-1"></a><code>--short</code> </dt> |
| 1214 | +<dt class="hdlist1" id="Documentation/CodingGuidelines-spanclasssynopsiscode--shortcodespan-1-1-1-1"><a id="Documentation/CodingGuidelines---short-1-1-1-1" class="anchor" href="#Documentation/CodingGuidelines---short-1-1-1-1"></a><span class='synopsis'><code>--short</code></span> </dt> |
1214 | 1215 | <dd>
|
1215 | 1216 | <p>Should a person and/or program want shorter output, he
|
1216 | 1217 | she/they/it can…​</p>
|
|
0 commit comments