mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-17 13:23:05 -05:00
This is hardly the first conversion of a Git command that is implemented as a script to a built-in. So far, the most successful strategy for such conversions has been to add a built-in helper and call that for more and more functionality from the script, as more and more parts are converted. With the interactive add, we choose a different strategy. The sole reason for this is that on Windows (where such a conversion has the most benefits in terms of speed and robustness) we face the very specific problem that a `system()` call in Perl seems to close `stdin` in the parent process when the spawned process consumes even one character from `stdin`. And that just does not work for us here, as it would stop the main loop as soon as any interactive command was performed by the helper. Which is almost all of the commands in `git add -i`. It is almost as if Perl told us once again that it does not want us to use it on Windows. Instead, we follow the opposite route where we start with a bare-bones version of the built-in interactive add, guarded by the new `add.interactive.useBuiltin` config variable, and then add more and more functionality to it, until it is feature complete. At this point, the built-in version of `git add -i` only states that it cannot do anything yet ;-) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
8 lines
188 B
C
8 lines
188 B
C
#include "cache.h"
|
|
#include "add-interactive.h"
|
|
|
|
int run_add_i(struct repository *r, const struct pathspec *ps)
|
|
{
|
|
die(_("No commands are available in the built-in `git add -i` yet!"));
|
|
}
|