<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/add-interactive.c, branch v2.37.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.37.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.37.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-07-04T20:40:59Z</updated>
<entry>
<title>Merge 'js/add-i-delete' into maint-2.37</title>
<updated>2022-07-04T20:40:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-07-04T20:40:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a631e99807f4cd5e98594452992f7343268ac56b'/>
<id>urn:sha1:a631e99807f4cd5e98594452992f7343268ac56b</id>
<content type='text'>
Rewrite of "git add -i" in C that appeared in Git 2.25 didn't
correctly record a removed file to the index, which is an old
regression but has become widely known because the C version
has become the default in the latest release.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add --interactive: allow `update` to stage deleted files</title>
<updated>2022-06-28T22:37:50Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-28T22:22:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4788e8b25692a8ae1a005554d3ad12f8ee4ee29e'/>
<id>urn:sha1:4788e8b25692a8ae1a005554d3ad12f8ee4ee29e</id>
<content type='text'>
The scripted version of `git add -i` used `git update-index --add
--remove`, but the built-in version implemented only the `--add` part.

This fixes https://github.com/msys2/MSYS2-packages/issues/3066

Reported-by: Christoph Reiter &lt;reiter.christoph@gmail.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>revisions API: have release_revisions() release "prune_data"</title>
<updated>2022-04-14T06:56:09Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-04-13T20:01:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=689a8e80dd4f7b3a20be88146bdea833c7759603'/>
<id>urn:sha1:689a8e80dd4f7b3a20be88146bdea833c7759603</id>
<content type='text'>
Extend the the release_revisions() function so that it frees the
"prune_data" in the "struct rev_info". This means that any code that
calls "release_revisions()" already can get rid of adjacent calls to
clear_pathspec().

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>revisions API users: add straightforward release_revisions()</title>
<updated>2022-04-14T06:56:08Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-04-13T20:01:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2108fe4a1976f95821e13503fd331f075da398c6'/>
<id>urn:sha1:2108fe4a1976f95821e13503fd331f075da398c6</id>
<content type='text'>
Add a release_revisions() to various users of "struct rev_list" in
those straightforward cases where we only need to add the
release_revisions() call to the end of a block, and don't need to
e.g. refactor anything to use a "goto cleanup" pattern.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pw/single-key-interactive'</title>
<updated>2022-03-21T22:14:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-21T22:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=214919b4f6a4ef69406d9383038f2a1a75476032'/>
<id>urn:sha1:214919b4f6a4ef69406d9383038f2a1a75476032</id>
<content type='text'>
The single-key interactive operation used by "git add -p" has been
made more robust.

* pw/single-key-interactive:
  add -p: disable stdin buffering when interactive.singlekey is set
  terminal: set VMIN and VTIME in non-canonical mode
  terminal: pop signal handler when terminal is restored
  terminal: always reset terminal when reading without echo
</content>
</entry>
<entry>
<title>add -p: disable stdin buffering when interactive.singlekey is set</title>
<updated>2022-02-23T21:30:06Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2022-02-22T18:53:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ac618c418e5e16acd82dc3d8e4356a39150de5a2'/>
<id>urn:sha1:ac618c418e5e16acd82dc3d8e4356a39150de5a2</id>
<content type='text'>
The builtin "add -p" reads the key "F2" as three separate keys "^[",
"O" and "Q". The "Q" causes it to quit which is probably not what the
user was expecting. This is because it uses poll() to check for
pending input when reading escape sequences but reads the input with
getchar() which is buffered by default and so hoovers up all the
pending input leading poll() think there isn't anything pending. Fix
this by calling setbuf() to disable input buffering if
interactive.singlekey is set.

Looking at the comment above mingw_getchar() in terminal.c I wonder if
that function is papering over this bug and could be removed.
Unfortunately I don't have access to windows to test that.

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.[ch]: have diff_free() call clear_pathspec(opts.pathspec)</title>
<updated>2022-02-16T21:50:13Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-16T10:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=244c27242f44e6b88e3a381c90bde08d134c274b'/>
<id>urn:sha1:244c27242f44e6b88e3a381c90bde08d134c274b</id>
<content type='text'>
Have the diff_free() function call clear_pathspec(). Since the
diff_flush() function calls this all its callers can be simplified to
rely on it instead.

When I added the diff_free() function in e900d494dcf (diff: add an API
for deferred freeing, 2021-02-11) I simply missed this, or wasn't
interested in it. Let's consolidate this now. This means that any
future callers (and I've got revision.c in mind) that embed a "struct
diff_options" can simply call diff_free() instead of needing know that
it has an embedded pathspec.

This does fix a bunch of leaks, but I can't mark any test here as
passing under the SANITIZE=leak testing mode because in
886e1084d78 (builtin/: add UNLEAKs, 2017-10-01) an UNLEAK(rev) was
added, which plasters over the memory
leak. E.g. "t4011-diff-symlink.sh" would report fewer leaks with this
fix, but because of the UNLEAK() reports none.

I'll eventually loop around to removing that UNLEAK(rev) annotation as
I'll fix deeper issues with the revisions API leaking. This is one
small step on the way there, a new freeing function in revisions.c
will want to call this diff_free().

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>*.h: move some *_INIT to designated initializers</title>
<updated>2021-09-27T21:48:00Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-09-27T12:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f69a6e4f076ec9ec89d94a6d960d0c161381a597'/>
<id>urn:sha1:f69a6e4f076ec9ec89d94a6d960d0c161381a597</id>
<content type='text'>
Move various *_INIT macros to use designated initializers. This helps
readability. I've only picked those leftover macros that were not
touched by another in-flight series of mine which changed others, but
also how initialization was done.

In the case of SUBMODULE_ALTERNATE_SETUP_INIT I've left an explicit
initialization of "error_mode", even though
SUBMODULE_ALTERNATE_ERROR_IGNORE itself is defined as "0". Let's not
peek under the hood and assume that enum fields we know the value of
will stay at "0".

The change to "TESTSUITE_INIT" in "t/helper/test-run-command.c" was
part of an earlier on-list version[1] of c90be786da9 (test-tool
run-command: fix flip-flop init pattern, 2021-09-11).

1. https://lore.kernel.org/git/patch-1.1-0aa4523ab6e-20210909T130849Z-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/xcalloc-takes-nelem-first'</title>
<updated>2021-03-19T22:25:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-03-19T22:25:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bfcc6e2a68b95ee71fc606a2e3917af78f1130f9'/>
<id>urn:sha1:bfcc6e2a68b95ee71fc606a2e3917af78f1130f9</id>
<content type='text'>
Code cleanup.

* rs/xcalloc-takes-nelem-first:
  fix xcalloc() argument order
</content>
</entry>
<entry>
<title>use CALLOC_ARRAY</title>
<updated>2021-03-14T00:00:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-03-13T16:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca56dadb4b65ccaeab809d80db80a312dc00941a'/>
<id>urn:sha1:ca56dadb4b65ccaeab809d80db80a312dc00941a</id>
<content type='text'>
Add and apply a semantic patch for converting code that open-codes
CALLOC_ARRAY to use it instead.  It shortens the code and infers the
element size automatically.

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>
</feed>
