Files
git/builtin
Johannes Schindelin f6aa7ecc34 built-in add -i: start implementing the patch functionality in C
In the previous steps, we re-implemented the main loop of `git add -i`
in C, and most of the commands.

Notably, we left out the actual functionality of `patch`, as the
relevant code makes up more than half of `git-add--interactive.perl`,
and is actually pretty independent of the rest of the commands.

With this commit, we start to tackle that `patch` part. For better
separation of concerns, we keep the code in a separate file,
`add-patch.c`. The new code is still guarded behind the
`add.interactive.useBuiltin` config setting, and for the moment,
it can only be called via `git add -p`.

The actual functionality follows the original implementation of
5cde71d64a (git-add --interactive, 2006-12-10), but not too closely
(for example, we use string offsets rather than copying strings around,
and after seeing whether the `k` and `j` commands are applicable, in the
C version we remember which previous/next hunk was undecided, and use it
rather than looking again when the user asked to jump).

As a further deviation from that commit, We also use a comma instead of
a slash to separate the available commands in the prompt, as the current
version of the Perl script does this, and we also add a line about the
question mark ("print help") to the help text.

While it is tempting to use this conversion of `git add -p` as an excuse
to work on `apply_all_patches()` so that it does _not_ want to read a
file from `stdin` or from a file, but accepts, say, an `strbuf` instead,
we will refrain from this particular rabbit hole at this stage.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-13 12:37:13 -08:00
..
2019-10-15 13:47:59 +09:00
2019-10-11 14:24:48 +09:00
2019-09-18 11:50:09 -07:00
2019-10-11 14:24:48 +09:00
2019-01-29 12:47:54 -08:00
2019-10-15 13:48:02 +09:00
2019-04-25 16:41:12 +09:00
2019-10-15 13:48:02 +09:00
2019-09-18 11:50:09 -07:00
2019-09-30 13:19:32 +09:00
2019-10-07 11:32:53 +09:00
2019-05-13 14:22:54 +09:00
2019-08-19 13:05:58 -07:00
2019-10-15 13:48:03 +09:00
2019-10-11 14:24:46 +09:00
2019-10-11 14:24:46 +09:00
2019-07-19 11:30:21 -07:00
2019-10-11 14:24:48 +09:00
2019-06-19 08:19:21 -07:00
2019-10-11 14:24:48 +09:00