Skip to content

Commit e22a3d2

Browse files
committed
Autogenerated HTML docs for v2.49.0-720-g34673c
1 parent 63fd872 commit e22a3d2

21 files changed

+415
-367
lines changed

MyFirstContribution.adoc

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ the list by sending an email to <[email protected]>
4040
The https://lore.kernel.org/git[archive] of this mailing list is
4141
available to view in a browser.
4242

43-
==== https://groups.google.com/forum/#!forum/git-mentoring[[email protected]]
44-
45-
This mailing list is targeted to new contributors and was created as a place to
46-
post questions and receive answers outside of the public eye of the main list.
47-
Veteran contributors who are especially interested in helping mentor newcomers
48-
are present on the list. In order to avoid search indexers, group membership is
49-
required to view messages; anyone can join and no approval is required.
50-
5143
==== https://web.libera.chat/#git-devel[#git-devel] on Libera Chat
5244

5345
This IRC channel is for conversations between Git contributors. If someone is
@@ -150,15 +142,31 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry
150142
point for your command in a function matching the style and signature:
151143

152144
----
153-
int cmd_psuh(int argc, const char **argv, const char *prefix)
145+
int cmd_psuh(int argc UNUSED, const char **argv UNUSED,
146+
const char *prefix UNUSED, struct repository *repo UNUSED)
154147
----
155148

149+
A few things to note:
150+
151+
* A subcommand implementation takes its command line arguments
152+
in `int argc` + `const char **argv`, like `main()` would.
153+
154+
* It also takes two extra parameters, `prefix` and `repo`. What
155+
they mean will not be discussed until much later.
156+
157+
* Because this first example will not use any of the parameters,
158+
your compiler will give warnings on unused parameters. As the
159+
list of these four parameters is mandated by the API to add
160+
new built-in commands, you cannot omit them. Instead, you add
161+
`UNUSED` to each of them to tell the compiler that you *know*
162+
you are not (yet) using it.
163+
156164
We'll also need to add the declaration of psuh; open up `builtin.h`, find the
157165
declaration for `cmd_pull`, and add a new line for `psuh` immediately before it,
158166
in order to keep the declarations alphabetically sorted:
159167

160168
----
161-
int cmd_psuh(int argc, const char **argv, const char *prefix);
169+
int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo);
162170
----
163171

164172
Be sure to `#include "builtin.h"` in your `psuh.c`. You'll also need to
@@ -174,7 +182,8 @@ Throughout the tutorial, we will mark strings for translation as necessary; you
174182
should also do so when writing your user-facing commands in the future.
175183

176184
----
177-
int cmd_psuh(int argc, const char **argv, const char *prefix)
185+
int cmd_psuh(int argc UNUSED, const char **argv UNUSED,
186+
const char *prefix UNUSED, struct repository *repo UNUSED)
178187
{
179188
printf(_("Pony saying hello goes here.\n"));
180189
return 0;
@@ -287,8 +296,9 @@ on the reference implementation linked at the top of this document.
287296
It's probably useful to do at least something besides printing out a string.
288297
Let's start by having a look at everything we get.
289298

290-
Modify your `cmd_psuh` implementation to dump the args you're passed, keeping
291-
existing `printf()` calls in place:
299+
Modify your `cmd_psuh` implementation to dump the args you're passed,
300+
keeping existing `printf()` calls in place; because the args are now
301+
used, remove the `UNUSED` macro from them:
292302

293303
----
294304
int i;
@@ -312,26 +322,27 @@ on the command line, including the name of our command. (If `prefix` is empty
312322
for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so
313323
helpful. So what other context can we get?
314324

315-
Add a line to `#include "config.h"`. Then, add the following bits to the
325+
Add a line to `#include "config.h"` and `#include "repository.h"`.
326+
Then, add the following bits to the function body:
316327
function body:
317328

318329
----
319330
const char *cfg_name;
320331
321332
...
322333
323-
git_config(git_default_config, NULL);
324-
if (git_config_get_string_tmp("user.name", &cfg_name) > 0)
334+
repo_config(repo, git_default_config, NULL);
335+
if (repo_config_get_string_tmp(repo, "user.name", &cfg_name))
325336
printf(_("No name is found in config\n"));
326337
else
327338
printf(_("Your name: %s\n"), cfg_name);
328339
----
329340

330-
`git_config()` will grab the configuration from config files known to Git and
331-
apply standard precedence rules. `git_config_get_string_tmp()` will look up
341+
`repo_config()` will grab the configuration from config files known to Git and
342+
apply standard precedence rules. `repo_config_get_string_tmp()` will look up
332343
a specific key ("user.name") and give you the value. There are a number of
333344
single-key lookup functions like this one; you can see them all (and more info
334-
about how to use `git_config()`) in `Documentation/technical/api-config.adoc`.
345+
about how to use `repo_config()`) in `Documentation/technical/api-config.adoc`.
335346

336347
You should see that the name printed matches the one you see when you run:
337348

@@ -364,7 +375,7 @@ status_init_config(&s, git_status_config);
364375
----
365376

366377
But as we drill down, we can find that `status_init_config()` wraps a call
367-
to `git_config()`. Let's modify the code we wrote in the previous commit.
378+
to `repo_config()`. Let's modify the code we wrote in the previous commit.
368379

369380
Be sure to include the header to allow you to use `struct wt_status`:
370381

@@ -380,8 +391,8 @@ prepare it, and print its contents:
380391
381392
...
382393
383-
wt_status_prepare(the_repository, &status);
384-
git_config(git_default_config, &status);
394+
wt_status_prepare(repo, &status);
395+
repo_config(repo, git_default_config, &status);
385396
386397
...
387398

MyFirstContribution.html

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -495,16 +495,6 @@ <h4 id="_gitvger_kernel_org"><a class="anchor" href="#_gitvger_kernel_org"></a><
495495
</div>
496496
</div>
497497
<div class="sect3">
498-
<h4 id="_git_mentoringgooglegroups_com"><a class="anchor" href="#_git_mentoringgooglegroups_com"></a><a href="https://groups.google.com/forum/#!forum/git-mentoring">[email protected]</a></h4>
499-
<div class="paragraph">
500-
<p>This mailing list is targeted to new contributors and was created as a place to
501-
post questions and receive answers outside of the public eye of the main list.
502-
Veteran contributors who are especially interested in helping mentor newcomers
503-
are present on the list. In order to avoid search indexers, group membership is
504-
required to view messages; anyone can join and no approval is required.</p>
505-
</div>
506-
</div>
507-
<div class="sect3">
508498
<h4 id="_git_devel_on_libera_chat"><a class="anchor" href="#_git_devel_on_libera_chat"></a><a href="https://web.libera.chat/#git-devel">#git-devel</a> on Libera Chat</h4>
509499
<div class="paragraph">
510500
<p>This IRC channel is for conversations between Git contributors. If someone is
@@ -642,17 +632,41 @@ <h3 id="add-new-command"><a class="anchor" href="#add-new-command"></a>Adding a
642632
</div>
643633
<div class="listingblock">
644634
<div class="content">
645-
<pre>int cmd_psuh(int argc, const char **argv, const char *prefix)</pre>
635+
<pre>int cmd_psuh(int argc UNUSED, const char **argv UNUSED,
636+
const char *prefix UNUSED, struct repository *repo UNUSED)</pre>
646637
</div>
647638
</div>
648639
<div class="paragraph">
640+
<p>A few things to note:</p>
641+
</div>
642+
<div class="ulist">
643+
<ul>
644+
<li>
645+
<p>A subcommand implementation takes its command line arguments
646+
in <code>int</code> <code>argc</code> + <code>const</code> <code>char</code> <code>**argv</code>, like <code>main</code>() would.</p>
647+
</li>
648+
<li>
649+
<p>It also takes two extra parameters, <code>prefix</code> and <code>repo</code>. What
650+
they mean will not be discussed until much later.</p>
651+
</li>
652+
<li>
653+
<p>Because this first example will not use any of the parameters,
654+
your compiler will give warnings on unused parameters. As the
655+
list of these four parameters is mandated by the API to add
656+
new built-in commands, you cannot omit them. Instead, you add
657+
<code>UNUSED</code> to each of them to tell the compiler that you <strong>know</strong>
658+
you are not (yet) using it.</p>
659+
</li>
660+
</ul>
661+
</div>
662+
<div class="paragraph">
649663
<p>We&#8217;ll also need to add the declaration of psuh; open up <code>builtin.h</code>, find the
650664
declaration for <code>cmd_pull</code>, and add a new line for <code>psuh</code> immediately before it,
651665
in order to keep the declarations alphabetically sorted:</p>
652666
</div>
653667
<div class="listingblock">
654668
<div class="content">
655-
<pre>int cmd_psuh(int argc, const char **argv, const char *prefix);</pre>
669+
<pre>int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo);</pre>
656670
</div>
657671
</div>
658672
<div class="paragraph">
@@ -681,7 +695,8 @@ <h3 id="add-new-command"><a class="anchor" href="#add-new-command"></a>Adding a
681695
</div>
682696
<div class="listingblock">
683697
<div class="content">
684-
<pre>int cmd_psuh(int argc, const char **argv, const char *prefix)
698+
<pre>int cmd_psuh(int argc UNUSED, const char **argv UNUSED,
699+
const char *prefix UNUSED, struct repository *repo UNUSED)
685700
{
686701
printf(_("Pony saying hello goes here.\n"));
687702
return 0;
@@ -822,8 +837,9 @@ <h3 id="implementation"><a class="anchor" href="#implementation"></a>Implementat
822837
Let&#8217;s start by having a look at everything we get.</p>
823838
</div>
824839
<div class="paragraph">
825-
<p>Modify your <code>cmd_psuh</code> implementation to dump the args you&#8217;re passed, keeping
826-
existing <code>printf</code>() calls in place:</p>
840+
<p>Modify your <code>cmd_psuh</code> implementation to dump the args you&#8217;re passed,
841+
keeping existing <code>printf</code>() calls in place; because the args are now
842+
used, remove the <code>UNUSED</code> macro from them:</p>
827843
</div>
828844
<div class="listingblock">
829845
<div class="content">
@@ -849,7 +865,8 @@ <h3 id="implementation"><a class="anchor" href="#implementation"></a>Implementat
849865
helpful. So what other context can we get?</p>
850866
</div>
851867
<div class="paragraph">
852-
<p>Add a line to #include "config.<code>h</code>". Then, add the following bits to the
868+
<p>Add a line to #include "config.<code>h</code>" and #include "repository.<code>h</code>".
869+
Then, add the following bits to the function body:
853870
function body:</p>
854871
</div>
855872
<div class="listingblock">
@@ -858,19 +875,19 @@ <h3 id="implementation"><a class="anchor" href="#implementation"></a>Implementat
858875

859876
...
860877

861-
git_config(git_default_config, NULL);
862-
if (git_config_get_string_tmp("user.name", &amp;cfg_name) &gt; 0)
878+
repo_config(repo, git_default_config, NULL);
879+
if (repo_config_get_string_tmp(repo, "user.name", &amp;cfg_name))
863880
printf(_("No name is found in config\n"));
864881
else
865882
printf(_("Your name: %s\n"), cfg_name);</pre>
866883
</div>
867884
</div>
868885
<div class="paragraph">
869-
<p><code>git_config</code>() will grab the configuration from config files known to Git and
870-
apply standard precedence rules. <code>git_config_get_string_tmp</code>() will look up
886+
<p><code>repo_config</code>() will grab the configuration from config files known to Git and
887+
apply standard precedence rules. <code>repo_config_get_string_tmp</code>() will look up
871888
a specific key ("user.name") and give you the value. There are a number of
872889
single-key lookup functions like this one; you can see them all (and more info
873-
about how to use <code>git_config</code>()) in <code>Documentation/technical/api-config.adoc</code>.</p>
890+
about how to use <code>repo_config</code>()) in <code>Documentation/technical/api-config.adoc</code>.</p>
874891
</div>
875892
<div class="paragraph">
876893
<p>You should see that the name printed matches the one you see when you run:</p>
@@ -921,7 +938,7 @@ <h3 id="implementation"><a class="anchor" href="#implementation"></a>Implementat
921938
</div>
922939
<div class="paragraph">
923940
<p>But as we drill down, we can find that <code>status_init_config</code>() wraps a call
924-
to <code>git_config</code>(). Let&#8217;s modify the code we wrote in the previous commit.</p>
941+
to <code>repo_config</code>(). Let&#8217;s modify the code we wrote in the previous commit.</p>
925942
</div>
926943
<div class="paragraph">
927944
<p>Be sure to include the header to allow you to use <code>struct</code> <code>wt_status</code>:</p>
@@ -941,8 +958,8 @@ <h3 id="implementation"><a class="anchor" href="#implementation"></a>Implementat
941958

942959
...
943960

944-
wt_status_prepare(the_repository, &amp;status);
945-
git_config(git_default_config, &amp;status);
961+
wt_status_prepare(repo, &amp;status);
962+
repo_config(repo, git_default_config, &amp;status);
946963

947964
...
948965

@@ -2239,7 +2256,7 @@ <h3 id="after-approval"><a class="anchor" href="#after-approval"></a>After Revie
22392256
</div>
22402257
<div id="footer">
22412258
<div id="footer-text">
2242-
Last updated 2025-03-26 00:41:02 -0700
2259+
Last updated 2025-05-27 15:29:51 -0700
22432260
</div>
22442261
</div>
22452262
</body>

RelNotes/2.50.0.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ UI, Workflows & Features
7676
been under "scalar"'s control are taught an option not to enable the
7777
scheduled maintenance on it.
7878

79+
* The userdiff pattern for shell scripts has been updated to cope
80+
with more bash-isms.
81+
82+
* "git merge-tree" learned an option to see if it resolves cleanly
83+
without actually creating a result.
84+
85+
* The commit title in the "rebase -i" todo file are now prefixed with
86+
'#', just like a merge commit being replayed.
87+
7988

8089
Performance, Internal Implementation, Development Support etc.
8190
--------------------------------------------------------------
@@ -167,6 +176,15 @@ Performance, Internal Implementation, Development Support etc.
167176
* The dependency on the_repository variable has been reduced from the
168177
code paths in "git replay".
169178
179+
* Support to create a loose object file with unknown object type has
180+
been dropped.
181+
182+
* The code path to access the "packed-refs" file while "fsck" is
183+
taught to mmap the file, instead of reading the whole file in the
184+
memory.
185+
186+
* Assorted fixes for issues found with CodeQL.
187+
170188
171189
Fixes since v2.49
172190
-----------------
@@ -325,6 +343,10 @@ Fixes since v2.49
325343
automatically (as opposed to be done only upon manual request).
326344
(merge 6389579b2f ps/ci-gitlab-enable-msvc-meson-job later to maint).
327345

346+
* "git apply" and "git add -i/-p" code paths no longer unnecessarily
347+
expand sparse-index while working.
348+
(merge ecf9ba20e3 ds/sparse-apply-add-p later to maint).
349+
328350
* Other code cleanup, docfix, build fix, etc.
329351
(merge 227c4f33a0 ja/doc-block-delimiter-markup-fix later to maint).
330352
(merge 2bfd3b3685 ab/decorate-code-cleanup later to maint).
@@ -355,3 +377,5 @@ Fixes since v2.49
355377
(merge e5dd0a05ed ly/am-split-stgit-leakfix later to maint).
356378
(merge bac220e154 rc/t1001-test-path-is-file later to maint).
357379
(merge 91db6c735d ly/reftable-writer-leakfix later to maint).
380+
(merge 20e4e9ad0b jc/doc-synopsis-option-markup later to maint).
381+
(merge cddcee7f64 es/meson-configure-build-options-fix later to maint).

fsck-msgids.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
`emptyName`::
6060
(WARN) A path contains an empty name.
6161

62+
`emptyPackedRefsFile`::
63+
(INFO) "packed-refs" file is empty. Report to the
64+
[email protected] mailing list if you see this error. As only
65+
very early versions of Git would create such an empty
66+
"packed_refs" file, we might tighten this rule in the future.
67+
6268
`extraHeaderEntry`::
6369
(IGNORE) Extra headers found after `tagger`.
6470

git-cat-file.adoc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ SYNOPSIS
99
--------
1010
[verse]
1111
'git cat-file' <type> <object>
12-
'git cat-file' (-e | -p) <object>
13-
'git cat-file' (-t | -s) [--allow-unknown-type] <object>
12+
'git cat-file' (-e | -p | -t | -s) <object>
1413
'git cat-file' (--textconv | --filters)
1514
[<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]
1615
'git cat-file' (--batch | --batch-check | --batch-command) [--batch-all-objects]
@@ -202,9 +201,6 @@ flush::
202201
only once, even if it is stored multiple times in the
203202
repository.
204203

205-
--allow-unknown-type::
206-
Allow `-s` or `-t` to query broken/corrupt objects of unknown type.
207-
208204
--follow-symlinks::
209205
With `--batch` or `--batch-check`, follow symlinks inside the
210206
repository when requesting objects with extended SHA-1

git-cat-file.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ <h2 id="_synopsis">SYNOPSIS</h2>
453453
<div class="sectionbody">
454454
<div class="verseblock">
455455
<pre class="content"><em>git cat-file</em> &lt;type&gt; &lt;object&gt;
456-
<em>git cat-file</em> (-e | -p) &lt;object&gt;
457-
<em>git cat-file</em> (-t | -s) [--allow-unknown-type] &lt;object&gt;
456+
<em>git cat-file</em> (-e | -p | -t | -s) &lt;object&gt;
458457
<em>git cat-file</em> (--textconv | --filters)
459458
[&lt;rev&gt;:&lt;path|tree-ish&gt; | --path=&lt;path|tree-ish&gt; &lt;rev&gt;]
460459
<em>git cat-file</em> (--batch | --batch-check | --batch-command) [--batch-all-objects]
@@ -711,10 +710,6 @@ <h2 id="_options">OPTIONS</h2>
711710
only once, even if it is stored multiple times in the
712711
repository.</p>
713712
</dd>
714-
<dt class="hdlist1">--allow-unknown-type</dt>
715-
<dd>
716-
<p>Allow <code>-s</code> or <code>-t</code> to query broken/corrupt objects of unknown type.</p>
717-
</dd>
718713
<dt class="hdlist1">--follow-symlinks</dt>
719714
<dd>
720715
<p>With <code>--batch</code> or <code>--batch-check</code>, follow symlinks inside the
@@ -1046,7 +1041,7 @@ <h2 id="_git">GIT</h2>
10461041
</div>
10471042
<div id="footer">
10481043
<div id="footer-text">
1049-
Last updated 2025-04-16 14:42:40 -0700
1044+
Last updated 2025-05-27 15:29:51 -0700
10501045
</div>
10511046
</div>
10521047
</body>

0 commit comments

Comments
 (0)