<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/reset.c, 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-03-03T23:09:36Z</updated>
<entry>
<title>add-patch: allow disabling editing of hunks</title>
<updated>2026-03-03T23:09:36Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-02T12:13:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=48f6d9232834be661f0d1dc4f187b324124ccbe0'/>
<id>urn:sha1:48f6d9232834be661f0d1dc4f187b324124ccbe0</id>
<content type='text'>
The "add-patch" mode allows the user to edit hunks to apply custom
changes. This is incompatible with a new `git history split` command
that we're about to introduce in a subsequent commit, so we need a way
to disable this mode.

Add a new flag to disable editing hunks.

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>add-patch: split out `struct interactive_options`</title>
<updated>2026-03-03T23:09:35Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-02T12:13:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e3d4d7787cc3b2f0281e808042ceaa08e05c281b'/>
<id>urn:sha1:e3d4d7787cc3b2f0281e808042ceaa08e05c281b</id>
<content type='text'>
The `struct add_p_opt` is reused both by our infra for "git add -p" and
"git add -i". Users of `run_add_i()` for example are expected to pass
`struct add_p_opt`. This is somewhat confusing and raises the question
of which options apply to what part of the stack.

But things are even more confusing than that: while callers are expected
to pass in `struct add_p_opt`, these options ultimately get used to
initialize a `struct add_i_state` that is used by both subsystems. So we
are basically going full circle here.

Refactor the code and split out a new `struct interactive_options` that
hosts common options used by both. These options are then applied to a
`struct interactive_config` that hosts common configuration.

This refactoring doesn't yet fully detangle the two subsystems from one
another, as we still end up calling `init_add_i_state()` in the "git add
-p" subsystem. This will be fixed in a subsequent commit.

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>Merge branch 'aa/add-p-no-auto-advance'</title>
<updated>2026-03-03T19:08:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-03T19:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a751e79acaf5a02cc24fa6b0b2656e13c57ad803'/>
<id>urn:sha1:a751e79acaf5a02cc24fa6b0b2656e13c57ad803</id>
<content type='text'>
"git add -p" learned a new mode that allows the user to revisit a
file that was already dealt with.

* aa/add-p-no-auto-advance:
  add-patch: allow interfile navigation when selecting hunks
  add-patch: allow all-or-none application of patches
  add-patch: modify patch_update_file() signature
  interactive -p: add new `--auto-advance` flag
</content>
</entry>
<entry>
<title>interactive -p: add new `--auto-advance` flag</title>
<updated>2026-02-17T18:48:36Z</updated>
<author>
<name>Abraham Samuel Adekunle</name>
<email>abrahamadekunle50@gmail.com</email>
</author>
<published>2026-02-14T11:03:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06c81a1118a6c9a77505b0ae3092576fa4c01763'/>
<id>urn:sha1:06c81a1118a6c9a77505b0ae3092576fa4c01763</id>
<content type='text'>
When using the interactive add, reset, stash or checkout machinery,
we do not have the option of reworking with a file when selecting
hunks, because the session automatically advances to the next file
or ends if we have just one file.

Introduce the flag `--auto-advance` which auto advances by default,
when interactively selecting patches with the '--patch' option.
However, the `--no-auto-advance` option does not auto advance, thereby
allowing users the option to rework with files.

Signed-off-by: Abraham Samuel Adekunle &lt;abrahamadekunle50@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cocci: convert parse_tree functions to repo_ variants</title>
<updated>2026-01-10T02:36:18Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2026-01-09T21:30:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec7a16b14551fed736ecfe0a9d4f6d6f9e03be79'/>
<id>urn:sha1:ec7a16b14551fed736ecfe0a9d4f6d6f9e03be79</id>
<content type='text'>
Add and apply a semantic patch to convert calls to parse_tree() and
friends to the corresponding variant that takes a repository argument,
to allow the functions that implicitly use the_repository to be retired
once all potential in-flight topics are settled and converted as well.

The changes in .c files were generated by Coccinelle, but I fixed a
whitespace bug it would have introduced to builtin/commit.c.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'lm/add-p-context'</title>
<updated>2025-08-04T15:10:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-04T15:10:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d63f334a8242f9e993b5bfb451f03394023ab877'/>
<id>urn:sha1:d63f334a8242f9e993b5bfb451f03394023ab877</id>
<content type='text'>
"git add/etc -p" now honor the diff.context configuration variable,
and also they learn to honor the -U&lt;n&gt; command-line option.

* lm/add-p-context:
  add-patch: add diff.context command line overrides
  add-patch: respect diff.context configuration
  t: use test_config in t4055
  t: use test_grep in t3701 and t4055
</content>
</entry>
<entry>
<title>add-patch: add diff.context command line overrides</title>
<updated>2025-07-29T15:52:45Z</updated>
<author>
<name>Leon Michalak</name>
<email>leonmichalak6@gmail.com</email>
</author>
<published>2025-07-29T07:01:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b3ae04011c3d679ba601c7ef9e20b9dec125ebb'/>
<id>urn:sha1:2b3ae04011c3d679ba601c7ef9e20b9dec125ebb</id>
<content type='text'>
This patch compliments the previous commit, where builtins that use
add-patch infrastructure now respect diff.context and
diff.interHunkContext file configurations.

In particular, this patch helps users who don't want to set persistent
context configurations or just want a way to override them on a one-time
basis, by allowing the relevant builtins to accept corresponding command
line options that override the file configurations.

This mimics commands such as diff and log, which allow for both context
file configuration and command line overrides.

Signed-off-by: Leon Michalak &lt;leonmichalak6@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: drop `git_config()` wrapper</title>
<updated>2025-07-23T15:15:18Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-23T14:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ce196e86b455fa2552812802c58f30c090c94af'/>
<id>urn:sha1:9ce196e86b455fa2552812802c58f30c090c94af</id>
<content type='text'>
In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config()`. All callsites
are adjusted so that they use `repo_config(the_repository, ...)`
instead. While some callsites might already have a repository available,
this mechanical conversion is the exact same as the current situation
and thus cannot cause any regression. Those sites should eventually be
cleaned up in a later patch series.

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>reset: integrate sparse index with --patch</title>
<updated>2025-05-16T19:02:47Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2025-05-16T14:55:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=efab7dc1f49ef95f00560c30bca357dd445e7cb4'/>
<id>urn:sha1:efab7dc1f49ef95f00560c30bca357dd445e7cb4</id>
<content type='text'>
Similar to the previous change for 'git add -p', the reset builtin
checked for integration with the sparse index after possibly redirecting
its logic toward the interactive logic. This means that the builtin
would expand the sparse index to a full one upon read.

Move this check earlier within cmd_reset() to improve performance here.

Add tests to guarantee that we are not universally expanding the index.
Add behavior tests to check that we are doing the same operations as a
full index.

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>diff.h: fix index used to loop through unsigned integer</title>
<updated>2024-12-06T11:20:03Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T10:27:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47d72a74a737f06791c282a75baf2c573cdf42f6'/>
<id>urn:sha1:47d72a74a737f06791c282a75baf2c573cdf42f6</id>
<content type='text'>
The `struct diff_flags` structure is essentially an array of flags, all
of which have the same type. We can thus use `sizeof()` to iterate
through all of the flags, which we do in `diff_flags_or()`. But while
the statement returns an unsigned integer, we used a signed integer to
iterate through the flags, which generates a warning.

Fix this by using `size_t` for the index instead.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
