<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin.h, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-02-09T20:09:09Z</updated>
<entry>
<title>Merge branch 'ps/history'</title>
<updated>2026-02-09T20:09:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-09T20:09:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7bf3785d0973d229fa21a76122c7e4735a2b1ffb'/>
<id>urn:sha1:7bf3785d0973d229fa21a76122c7e4735a2b1ffb</id>
<content type='text'>
"git history" history rewriting UI.

* ps/history:
  builtin/history: implement "reword" subcommand
  builtin: add new "history" command
  wt-status: provide function to expose status for trees
  replay: support updating detached HEAD
  replay: support empty commit ranges
  replay: small set of cleanups
  builtin/replay: move core logic into "libgit.a"
  builtin/replay: extract core logic to replay revisions
</content>
</entry>
<entry>
<title>builtin: add new "history" command</title>
<updated>2026-01-13T13:41:17Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-13T09:54:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a675183d483cb106c076395936cd9e602ae94404'/>
<id>urn:sha1:a675183d483cb106c076395936cd9e602ae94404</id>
<content type='text'>
When rewriting history via git-rebase(1) there are a few very common use
cases:

  - The ordering of two commits should be reversed.

  - A commit should be split up into two commits.

  - A commit should be dropped from the history completely.

  - Multiple commits should be squashed into one.

  - Editing an existing commit that is not the tip of the current
    branch.

While these operations are all doable, it often feels needlessly kludgey
to do so by doing an interactive rebase, using the editor to say what
one wants, and then perform the actions. Also, some operations like
splitting up a commit into two are way more involved than that and
require a whole series of commands.

Rebases also do not update dependent branches. The use of stacked
branches has grown quite common with competing version control systems
like Jujutsu though, so it clearly is a need that users have. While
rebases _can_ serve this use case if one always works on the latest
stacked branch, it is somewhat awkward and very easy to get wrong.

Add a new "history" command to plug these gaps. This command will have
several different subcommands to imperatively rewrite history for common
use cases like the above.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin.h: update documentation</title>
<updated>2026-01-09T14:37:02Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2026-01-09T03:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ac93bfcbc28e28a4844095648988558dad02aa3'/>
<id>urn:sha1:2ac93bfcbc28e28a4844095648988558dad02aa3</id>
<content type='text'>
The documentation for the builtin API was moved from the technical
documentation and into a comment in builtin.h by ec14d4ecb5 (builtin.h: take
over documentation from api-builtin.txt, 2017-08-02). This documentation
wasn't updated as part of the major overhaul to include a repository struct
in 9b1cb5070f (builtin: add a repository parameter for builtin functions,
2024-09-13).

There was a brief update regarding the move from *.txt to *.adoc by
e8015223c7 (builtin.h: *.txt -&gt; *.adoc fixes, 2025-03-03).

I noticed that there was quite a bit missing from the old documentation,
which is still visible on git-scm.com [1].

[1] https://github.com/git/git-scm.com/issues/2124

This change updates the documentation in the following ways:

 1. Updates the cmd_foo() prototype to include a repository.
 2. Adds some newlines to have uniformity in the list of flags.
 3. Adds a description of the NO_PARSEOPT flag.
 4. Describes the tests that perform checks on all builtins, which may trip
    up a contributor working on a new builtin.

I double-checked these instructions against a toy example in my local branch
to be sure that it was complete.

Signed-off-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tc/last-modified'</title>
<updated>2025-09-08T21:54:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-09-08T21:54:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95a8428323a573963c93ece8f875dd3cd25a1a11'/>
<id>urn:sha1:95a8428323a573963c93ece8f875dd3cd25a1a11</id>
<content type='text'>
A new command "git last-modified" has been added to show the closest
ancestor commit that touched each path.

* tc/last-modified:
  last-modified: use Bloom filters when available
  t/perf: add last-modified perf script
  last-modified: new subcommand to show when files were last modified
</content>
</entry>
<entry>
<title>last-modified: new subcommand to show when files were last modified</title>
<updated>2025-08-28T23:44:58Z</updated>
<author>
<name>Toon Claes</name>
<email>toon@iotcl.com</email>
</author>
<published>2025-08-05T09:33:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=32f74582bc298621a05ab5733810ff0300b69715'/>
<id>urn:sha1:32f74582bc298621a05ab5733810ff0300b69715</id>
<content type='text'>
Similar to git-blame(1), introduce a new subcommand
git-last-modified(1). This command shows the most recent modification to
paths in a tree. It does so by expanding the tree at a given commit,
taking note of the current state of each path, and then walking
backwards through history looking for commits where each path changed
into its final commit ID.

Based-on-patch-by: Jeff King &lt;peff@peff.net&gt;
Improved-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Toon Claes &lt;toon@iotcl.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>repo: declare the repo command</title>
<updated>2025-08-17T16:13:39Z</updated>
<author>
<name>Lucas Seiki Oshiro</name>
<email>lucasseikioshiro@gmail.com</email>
</author>
<published>2025-08-16T22:45:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab94bb80002a85b31124f9ece8ba3843f93f063c'/>
<id>urn:sha1:ab94bb80002a85b31124f9ece8ba3843f93f063c</id>
<content type='text'>
Currently, `git rev-parse` covers a wide range of functionality not
directly related to parsing revisions, as its name suggests. Over time,
many features like parsing datestrings, options, paths, and others
were added to it because there wasn't a more appropriate command
to place them.

Create a new Git command called `repo`. `git repo` will be the main
command for obtaining the information about a repository (such as
metadata and metrics).

Also declare a subcommand for `repo` called `info`. `git repo info`
will bring the functionality of retrieving repository-related
information currently returned by `rev-parse`.

Add the required documentation and build changes to enable usage of
this subcommand.

Helped-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Justin Tobler &lt;jltobler@gmail.com&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Mentored-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Mentored-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Lucas Seiki Oshiro &lt;lucasseikioshiro@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jt/diff-pairs'</title>
<updated>2025-03-26T07:26:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-03-26T07:26:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f50df872a45c4a1010dc5378055b1be0e844add1'/>
<id>urn:sha1:f50df872a45c4a1010dc5378055b1be0e844add1</id>
<content type='text'>
A post-processing filter for "diff --raw" output has been
introduced.

* jt/diff-pairs:
  builtin/diff-pairs: allow explicit diff queue flush
  builtin: introduce diff-pairs command
  diff: add option to skip resolving diff statuses
  diff: return diff_filepair from diff queue helpers
</content>
</entry>
<entry>
<title>builtin.h: *.txt -&gt; *.adoc fixes</title>
<updated>2025-03-03T21:49:22Z</updated>
<author>
<name>Todd Zullinger</name>
<email>tmz@pobox.com</email>
</author>
<published>2025-03-03T20:44:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8015223c74938548dfd8d6099b1ea5eb6ab9231'/>
<id>urn:sha1:e8015223c74938548dfd8d6099b1ea5eb6ab9231</id>
<content type='text'>
Signed-off-by: Todd Zullinger &lt;tmz@pobox.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin: introduce diff-pairs command</title>
<updated>2025-03-03T16:17:47Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2025-02-28T21:33:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5bd10b2adcf3a080169574dd08c5529de81eecb1'/>
<id>urn:sha1:5bd10b2adcf3a080169574dd08c5529de81eecb1</id>
<content type='text'>
Through git-diff(1), a single diff can be generated from a pair of blob
revisions directly. Unfortunately, there is not a mechanism to compute
batches of specific file pair diffs in a single process. Such a feature
is particularly useful on the server-side where diffing between a large
set of changes is not feasible all at once due to timeout concerns.

To facilitate this, introduce git-diff-pairs(1) which acts as a backend
passing its NUL-terminated raw diff format input from stdin through diff
machinery to produce various forms of output such as patch or raw.

The raw format was originally designed as an interchange format and
represents the contents of the diff_queued_diff list making it possible
to break the diff pipeline into separate stages. For example,
git-diff-tree(1) can be used as a frontend to compute file pairs to
queue and feed its raw output to git-diff-pairs(1) to compute patches.
With this, batches of diffs can be progressively generated without
having to recompute renames or retrieve object context. Something like
the following:

	git diff-tree -r -z -M $old $new |
	git diff-pairs -p -z

should generate the same output as `git diff-tree -p -M`. Furthermore,
each line of raw diff formatted input can also be individually fed to a
separate git-diff-pairs(1) process and still produce the same output.

Based-on-patch-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Justin Tobler &lt;jltobler@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>backfill: add builtin boilerplate</title>
<updated>2025-02-04T00:12:41Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2025-02-03T17:11:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a3f79e9abdbdb27308ac7e3d9e362bcc361cecdc'/>
<id>urn:sha1:a3f79e9abdbdb27308ac7e3d9e362bcc361cecdc</id>
<content type='text'>
In anticipation of implementing 'git backfill', populate the necessary files
with the boilerplate of a new builtin. Mark the builtin as experimental at
this time, allowing breaking changes in the near future, if necessary.

Signed-off-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
