Skip to content

Commit

Permalink
Autogenerated HTML docs for v2.44.0-548-g91ec36
Browse files Browse the repository at this point in the history
  • Loading branch information
gitster committed Apr 9, 2024
1 parent fd00376 commit eabec52
Show file tree
Hide file tree
Showing 59 changed files with 484 additions and 396 deletions.
2 changes: 1 addition & 1 deletion MyFirstContribution.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
<body class="article">
<div id="header">
<h1>My First Contribution to the Git Project</h1>
<span id="revdate">2024-04-05</span>
<span id="revdate">2024-04-09</span>
</div>
<div id="content">
<div class="sect1">
Expand Down
41 changes: 23 additions & 18 deletions MyFirstObjectWalk.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
<body class="article">
<div id="header">
<h1>My First Object Walk</h1>
<span id="revdate">2024-04-05</span>
<span id="revdate">2024-04-09</span>
</div>
<div id="content">
<div class="sect1">
Expand Down Expand Up @@ -989,13 +989,14 @@ <h4 id="_configuring_from_code_gitconfig_code">Configuring From <code>.gitconfig

...

static int git_walken_config(const char *var, const char *value, void *cb)
static int git_walken_config(const char *var, const char *value,
const struct config_context *ctx, void *cb)
{
/*
* For now, we don't have any custom configuration, so fall back to
* the default config.
*/
return git_default_config(var, value, cb);
return git_default_config(var, value, ctx, cb);
}</code></pre>
</div></div>
<div class="paragraph"><p>Make sure to invoke <code>git_config()</code> with it in your <code>cmd_walken()</code>:</p></div>
Expand Down Expand Up @@ -1180,10 +1181,11 @@ <h3 id="_adding_a_filter">Adding a Filter</h3>
<div class="paragraph"><p>First some setup. Add <code>grep_config()</code> to <code>git_walken_config()</code>:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>static int git_walken_config(const char *var, const char *value, void *cb)
<pre><code>static int git_walken_config(const char *var, const char *value,
const struct config_context *ctx, void *cb)
{
grep_config(var, value, cb);
return git_default_config(var, value, cb);
grep_config(var, value, ctx, cb);
return git_default_config(var, value, ctx, cb);
}</code></pre>
</div></div>
<div class="paragraph"><p>Next, we can modify the <code>grep_filter</code>. This is done with convenience functions
Expand Down Expand Up @@ -1317,7 +1319,7 @@ <h2 id="_basic_object_walk">Basic Object Walk</h2>
about each one.</p></div>
<div class="paragraph"><p>We can base our work on an example. <code>git pack-objects</code> prepares all kinds of
objects for packing into a bitmap or packfile. The work we are interested in
resides in <code>builtins/pack-objects.c:get_object_list()</code>; examination of that
resides in <code>builtin/pack-objects.c:get_object_list()</code>; examination of that
function shows that the all-object walk is being performed by
<code>traverse_commit_list()</code> or <code>traverse_commit_list_filtered()</code>. Those two
functions reside in <code>list-objects.c</code>; examining the source shows that, despite
Expand Down Expand Up @@ -1549,8 +1551,8 @@ <h3 id="_adding_a_filter_2">Adding a Filter</h3>
} else {
trace_printf(
_("Filtered object walk with filterspec 'tree:1'.\n"));
CALLOC_ARRAY(rev-&gt;filter, 1);
parse_list_objects_filter(rev-&gt;filter, "tree:1");

parse_list_objects_filter(&amp;rev-&gt;filter, "tree:1");
}
traverse_commit_list(rev, walken_show_commit,
walken_show_object, NULL);</code></pre>
Expand All @@ -1567,10 +1569,12 @@ <h3 id="_adding_a_filter_2">Adding a Filter</h3>
<div class="sect2">
<h3 id="_counting_omitted_objects">Counting Omitted Objects</h3>
<div class="paragraph"><p>We also have the capability to enumerate all objects which were omitted by a
filter, like with <code>git log --filter=&lt;spec&gt; --filter-print-omitted</code>. Asking
<code>traverse_commit_list_filtered()</code> to populate the <code>omitted</code> list means that our
object walk does not perform any better than an unfiltered object walk; all
reachable objects are walked in order to populate the list.</p></div>
filter, like with <code>git log --filter=&lt;spec&gt; --filter-print-omitted</code>. To do this,
change <code>traverse_commit_list()</code> to <code>traverse_commit_list_filtered()</code>, which is
able to populate an <code>omitted</code> list. Asking for this list of filtered objects
may cause performance degradations, however, because in this case, despite
filtering objects, the possibly much larger set of all reachable objects must
be processed in order to populate that list.</p></div>
<div class="paragraph"><p>First, add the <code>struct oidset</code> and related items we will use to iterate it:</p></div>
<div class="listingblock">
<div class="content">
Expand All @@ -1589,8 +1593,9 @@ <h3 id="_counting_omitted_objects">Counting Omitted Objects</h3>

...</code></pre>
</div></div>
<div class="paragraph"><p>Modify the call to <code>traverse_commit_list_filtered()</code> to include your <code>omitted</code>
object:</p></div>
<div class="paragraph"><p>Replace the call to <code>traverse_commit_list()</code> with
<code>traverse_commit_list_filtered()</code> and pass a pointer to the <code>omitted</code> oidset
defined and initialized above:</p></div>
<div class="listingblock">
<div class="content">
<pre><code> ...
Expand Down Expand Up @@ -1658,7 +1663,7 @@ <h3 id="_changing_the_order_2">Changing the Order</h3>
<div class="paragraph"><p>With only that change, run again (but save yourself some scrollback):</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ GIT_TRACE=1 ./bin-wrappers/git walken | head -n 10</code></pre>
<pre><code>$ GIT_TRACE=1 ./bin-wrappers/git walken 2&gt;&amp;1 | head -n 10</code></pre>
</div></div>
<div class="paragraph"><p>Take a look at the top commit with <code>git show</code> and the object ID you printed; it
should be the same as the output of <code>git show HEAD</code>.</p></div>
Expand All @@ -1683,7 +1688,7 @@ <h3 id="_changing_the_order_2">Changing the Order</h3>
<div class="listingblock">
<div class="content">
<pre><code>$ make
$ GIT_TRACE=1 ./bin-wrappers git walken | tail -n 10</code></pre>
$ GIT_TRACE=1 ./bin-wrappers/git walken 2&gt;&amp;1 | tail -n 10</code></pre>
</div></div>
<div class="paragraph"><p>The last commit object given should have the same OID as the one we saw at the
top before, and running <code>git show &lt;oid&gt;</code> with that OID should give you again
Expand Down Expand Up @@ -1737,7 +1742,7 @@ <h2 id="_wrapping_up">Wrapping Up</h2>
<div id="footer">
<div id="footer-text">
Last updated
2023-07-17 11:51:48 PDT
2024-04-09 14:45:01 PDT
</div>
</div>
</body>
Expand Down
37 changes: 21 additions & 16 deletions MyFirstObjectWalk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,14 @@ We'll also need to include the `config.h` header:

...

static int git_walken_config(const char *var, const char *value, void *cb)
static int git_walken_config(const char *var, const char *value,
const struct config_context *ctx, void *cb)
{
/*
* For now, we don't have any custom configuration, so fall back to
* the default config.
*/
return git_default_config(var, value, cb);
return git_default_config(var, value, ctx, cb);
}
----

Expand Down Expand Up @@ -389,10 +390,11 @@ modifying `rev_info.grep_filter`, which is a `struct grep_opt`.
First some setup. Add `grep_config()` to `git_walken_config()`:

----
static int git_walken_config(const char *var, const char *value, void *cb)
static int git_walken_config(const char *var, const char *value,
const struct config_context *ctx, void *cb)
{
grep_config(var, value, cb);
return git_default_config(var, value, cb);
grep_config(var, value, ctx, cb);
return git_default_config(var, value, ctx, cb);
}
----

Expand Down Expand Up @@ -523,7 +525,7 @@ about each one.

We can base our work on an example. `git pack-objects` prepares all kinds of
objects for packing into a bitmap or packfile. The work we are interested in
resides in `builtins/pack-objects.c:get_object_list()`; examination of that
resides in `builtin/pack-objects.c:get_object_list()`; examination of that
function shows that the all-object walk is being performed by
`traverse_commit_list()` or `traverse_commit_list_filtered()`. Those two
functions reside in `list-objects.c`; examining the source shows that, despite
Expand Down Expand Up @@ -732,8 +734,8 @@ walk we've just performed:
} else {
trace_printf(
_("Filtered object walk with filterspec 'tree:1'.\n"));
CALLOC_ARRAY(rev->filter, 1);
parse_list_objects_filter(rev->filter, "tree:1");

parse_list_objects_filter(&rev->filter, "tree:1");
}
traverse_commit_list(rev, walken_show_commit,
walken_show_object, NULL);
Expand All @@ -752,10 +754,12 @@ points to the same tree object as its grandparent.)
=== Counting Omitted Objects

We also have the capability to enumerate all objects which were omitted by a
filter, like with `git log --filter=<spec> --filter-print-omitted`. Asking
`traverse_commit_list_filtered()` to populate the `omitted` list means that our
object walk does not perform any better than an unfiltered object walk; all
reachable objects are walked in order to populate the list.
filter, like with `git log --filter=<spec> --filter-print-omitted`. To do this,
change `traverse_commit_list()` to `traverse_commit_list_filtered()`, which is
able to populate an `omitted` list. Asking for this list of filtered objects
may cause performance degradations, however, because in this case, despite
filtering objects, the possibly much larger set of all reachable objects must
be processed in order to populate that list.

First, add the `struct oidset` and related items we will use to iterate it:

Expand All @@ -776,8 +780,9 @@ static void walken_object_walk(
...
----

Modify the call to `traverse_commit_list_filtered()` to include your `omitted`
object:
Replace the call to `traverse_commit_list()` with
`traverse_commit_list_filtered()` and pass a pointer to the `omitted` oidset
defined and initialized above:

----
...
Expand Down Expand Up @@ -843,7 +848,7 @@ those lines without having to recompile.
With only that change, run again (but save yourself some scrollback):

----
$ GIT_TRACE=1 ./bin-wrappers/git walken | head -n 10
$ GIT_TRACE=1 ./bin-wrappers/git walken 2>&1 | head -n 10
----

Take a look at the top commit with `git show` and the object ID you printed; it
Expand Down Expand Up @@ -871,7 +876,7 @@ of the first handful:

----
$ make
$ GIT_TRACE=1 ./bin-wrappers git walken | tail -n 10
$ GIT_TRACE=1 ./bin-wrappers/git walken 2>&1 | tail -n 10
----

The last commit object given should have the same OID as the one we saw at the
Expand Down
33 changes: 33 additions & 0 deletions RelNotes/2.45.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ UI, Workflows & Features
* core.commentChar used to be limited to a single byte, but has been
updated to allow an arbitrary multi-byte sequence.

* "git add -p" and other "interactive hunk selection" UI has learned to
skip showing the hunk immediately after it has already been shown, and
an additional action to explicitly ask to reshow the current hunk.

* "git pack-refs" learned the "--auto" option, which is a useful
addition to be triggered from "git gc --auto".

Performance, Internal Implementation, Development Support etc.

Expand Down Expand Up @@ -140,6 +146,16 @@ Performance, Internal Implementation, Development Support etc.
the "t/" directory with "make t<num>-*.sh t<num>-*.sh".
(merge 8d383806fc pb/test-scripts-are-build-targets later to maint).

* The "hint:" messages given by the advice mechanism, when given a
message with a blank line, left a line with trailing whitespace,
which has been cleansed.

* Documentation rules has been explicitly described how to mark-up
literal parts and a few manual pages have been updated as examples.

* The .editorconfig file has been taught that a Makefile uses HT
indentation.


Fixes since v2.44
-----------------
Expand Down Expand Up @@ -302,6 +318,23 @@ Fixes since v2.44
corrected.
(merge f999d5188b bl/pretty-shorthand-config-fix later to maint).

* "git apply" failed to extract the filename the patch applied to,
when the change was about an empty file created in or deleted from
a directory whose name ends with a SP, which has been corrected.
(merge 776ffd1a30 jc/apply-parse-diff-git-header-names-fix later to maint).

* Update a more recent tutorial doc.
(merge 95ab557b4b dg/myfirstobjectwalk-updates later to maint).

* The test script had an incomplete and ineffective attempt to avoid
clobbering the testing user's real crontab (and its equivalents),
which has been completed.
(merge 73cb87773b es/test-cron-safety later to maint).

* Use advice_if_enabled() API to rewrite a simple pattern to
call advise() after checking advice_enabled().
(merge 6412d01527 rj/use-adv-if-enabled later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge f0e578c69c rs/use-xstrncmpz later to maint).
(merge 83e6eb7d7a ba/credential-test-clean-fix later to maint).
Expand Down
2 changes: 1 addition & 1 deletion ReviewingGuidelines.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
<body class="article">
<div id="header">
<h1>Reviewing Patches in the Git Project</h1>
<span id="revdate">2024-04-05</span>
<span id="revdate">2024-04-09</span>
</div>
<div id="content">
<div class="sect1">
Expand Down
2 changes: 1 addition & 1 deletion SubmittingPatches.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
<body class="article">
<div id="header">
<h1>Submitting Patches</h1>
<span id="revdate">2024-04-05</span>
<span id="revdate">2024-04-09</span>
</div>
<div id="content">
<div class="sect1">
Expand Down
2 changes: 1 addition & 1 deletion ToolsForGit.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
<body class="article">
<div id="header">
<h1>Tools for developing Git</h1>
<span id="revdate">2024-04-05</span>
<span id="revdate">2024-04-09</span>
</div>
<div id="content">
<div class="sect1">
Expand Down
2 changes: 1 addition & 1 deletion everyday.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
<body class="article">
<div id="header">
<h1>Everyday Git With 20 Commands Or So</h1>
<span id="revdate">2024-04-05</span>
<span id="revdate">2024-04-09</span>
</div>
<div id="content">
<div id="preamble">
Expand Down
3 changes: 2 additions & 1 deletion git-add.html
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,7 @@ <h2 id="_interactive_mode">INTERACTIVE MODE</h2>
K - leave this hunk undecided, see previous hunk
s - split the current hunk into smaller hunks
e - manually edit the current hunk
p - print the current hunk
? - print help</code></pre>
</div></div>
<div class="paragraph"><p>After deciding the fate for all hunks, if there is any hunk
Expand Down Expand Up @@ -1425,7 +1426,7 @@ <h2 id="_git">GIT</h2>
<div id="footer">
<div id="footer-text">
Last updated
2024-03-01 17:30:58 PST
2024-04-09 14:45:01 PDT
</div>
</div>
</body>
Expand Down
1 change: 1 addition & 0 deletions git-add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ patch::
K - leave this hunk undecided, see previous hunk
s - split the current hunk into smaller hunks
e - manually edit the current hunk
p - print the current hunk
? - print help
+
After deciding the fate for all hunks, if there is any hunk
Expand Down
Loading

0 comments on commit eabec52

Please sign in to comment.