Skip to content

Offer a built-in version of git add -i and git add -p #2150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 78 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
ed53346
Start to implement a built-in version of `git add --interactive`
dscho Mar 7, 2019
bc99009
diff: export diffstat interface
theiostream May 16, 2017
5e23c07
built-in add -i: implement the `status` command
theiostream May 16, 2017
8cafc6a
built-in add -i: refresh the index before running `status`
dscho Mar 27, 2019
cad52c8
fixup! mingw (git_terminal_prompt): turn on echo explictly
dscho May 7, 2019
fa27842
fixup! mingw (git_terminal_prompt): work around BusyBox & WSL issues
dscho May 7, 2019
ddd2fdb
Temporarily back out compat/terminal.c changes
dscho May 7, 2019
46f5bad
Temporarily revert part of "tests: add a special setup [...]"
dscho May 7, 2019
a5ae46f
Temporarily revert "t3701: verify that we can add *lots* of files int…
dscho May 7, 2019
83d92a9
built-in add -i: color the header in the `status` command
dscho May 5, 2019
db97839
built-in add -i: implement the main loop
dscho Mar 7, 2019
d7245b9
Add a function to determine unique prefixes for a list of strings
slavicaDj Mar 27, 2019
573f9f4
built-in add -i: show unique prefixes of the commands
slavicaDj Feb 27, 2019
f48c70e
built-in add -i: support `?` (prompt help)
dscho Mar 5, 2019
9cf3260
built-in add -i: use color in the main loop
slavicaDj Mar 3, 2019
ddb913e
built-in add -i: implement the `help` command
dscho Mar 7, 2019
e65167d
built-in add -i: allow filtering the modified files list
dscho Mar 5, 2019
7a479f4
built-in add -i: prepare for multi-selection commands
dscho Mar 7, 2019
41e36a5
built-in add -i: implement the `update` command
dscho Mar 5, 2019
c6ba59e
built-in add -i: re-implement `revert` in C
dscho Mar 6, 2019
3df0c46
built-in add -i: re-implement `add-untracked` in C
dscho Mar 6, 2019
c599406
built-in add -i: implement the `patch` command
dscho Mar 11, 2019
5235122
built-in add -i: re-implement the `diff` command
dscho Mar 8, 2019
2e33d35
built-in add -i: offer the `quit` command
dscho Mar 7, 2019
45b7716
t3701: add a test for advanced split-hunk editing
dscho Apr 3, 2019
7e9ef10
t3701: avoid depending on the TTY prerequisite
dscho Mar 23, 2019
5051b44
built-in add -i: start implementing the `patch` functionality in C
dscho Mar 11, 2019
7923057
t3701: add a test for the different `add -p` prompts
dscho Mar 23, 2019
cf4bbd3
built-in add -i: wire up the new C code for the `patch` command
dscho Mar 12, 2019
f0c7048
t3701: verify the shown messages when nothing can be added
dscho Mar 24, 2019
e79b65b
built-in add -p: show colored hunks by default
dscho Mar 12, 2019
d6b95ad
t3701: verify that the diff.algorithm config setting is handled
dscho Mar 23, 2019
23cbcb5
built-in add -p: adjust hunk headers as needed
dscho Mar 21, 2019
36aeb30
git add -p: use non-zero exit code when the diff generation failed
dscho Mar 23, 2019
bd92652
built-in add -p: color the prompt and the help text
dscho Mar 12, 2019
cb1a9e2
apply --allow-overlap: fix a corner case
dscho Mar 20, 2019
7c75f74
built-in add -p: offer a helpful error message when hunk navigation f…
dscho Mar 17, 2019
794a908
built-in add -p: support multi-file diffs
dscho Mar 15, 2019
6b873ab
built-in add -p: handle deleted empty files
dscho Mar 15, 2019
21be306
built-in app -p: allow selecting a mode change as a "hunk"
dscho Mar 15, 2019
590a241
built-in add -p: show different prompts for mode changes and deletions
dscho Mar 23, 2019
5988354
built-in add -p: implement the hunk splitting feature
dscho Mar 17, 2019
73bcd8e
built-in add -p: coalesce hunks after splitting them
dscho Mar 19, 2019
30a2c35
built-in add -p: implement hunk editing
dscho Mar 19, 2019
fb601ae
built-in add -p: implement the 'g' ("goto") command
dscho Mar 21, 2019
7a8fea2
built-in add -p: implement the '/' ("search regex") command
dscho Mar 21, 2019
fdae5e5
built-in add -p: implement the 'q' ("quit") command
dscho Mar 22, 2019
5ac62a9
built-in add -p: prepare for patch modes other than "stage"
dscho Mar 23, 2019
b6dcc0a
stash -p: respect the add.interactive.usebuiltin setting
dscho Mar 24, 2019
9efe35e
built-in add -p: implement the "stash" and "reset" patch modes
dscho Mar 23, 2019
e9bd93a
built-in add -p: support interactive.diffFilter
dscho Mar 12, 2019
1bd8c11
built-in add -p: only show the applicable parts of the help text
dscho Mar 24, 2019
125dfcf
built-in add -p: implement the "checkout" patch modes
dscho Mar 23, 2019
b47efd8
built-in add -p: handle diff.algorithm
dscho Mar 23, 2019
e6b1b18
built-in add -p: show helpful hint when nothing can be staged
dscho Mar 24, 2019
d858409
commit --interactive: make it work with the built-in `add -i`
dscho Mar 29, 2019
40410ba
terminal: make the code of disable_echo() reusable
dscho Apr 4, 2019
8d5239f
terminal: accommodate Git for Windows' default terminal
dscho Apr 4, 2019
09af4d8
terminal: add a new function to read a single keystroke
dscho Mar 26, 2019
597ac69
built-in add -p: respect the `interactive.singlekey` config setting
dscho Mar 26, 2019
8cf5fd6
built-in add -p: handle Escape sequences in interactive.singlekey mode
dscho Mar 27, 2019
89951d7
built-in add -p: handle Escape sequences more efficiently
dscho Mar 27, 2019
a2d32c9
Merge branch 'add-i-in-c-status-and-help'
dscho Mar 28, 2019
779d4dd
ci: include the built-in `git add -i` in the `linux-gcc` job
dscho Mar 28, 2019
5f0f8fd
Merge branch 'add-i-in-c-all-except-patch'
dscho Mar 28, 2019
15f3dba
Merge branch 'add-i-fixes'
dscho Mar 28, 2019
ddc8a97
Merge branch 'add-p-in-c'
dscho Mar 28, 2019
8c242f9
Merge branch 'other-command-p-in-c'
dscho Mar 28, 2019
ab0301b
Merge branch 'add-p-in-c-config-settings'
dscho Mar 28, 2019
b5af4f2
Merge remote-tracking branch 'dscho/add-p' into add-p-g4w
dscho Apr 3, 2019
b6d2448
t3701: verify that we can add *lots* of files interactively
dscho Sep 12, 2015
36fd328
re-revert tests: add a special setup where stash.useBuiltin is off
dscho Dec 20, 2018
954b915
mingw: Support `git_terminal_prompt` with more terminals
kblees Mar 19, 2015
2125656
built-in stash: use the built-in `git add -p` if so configured
dscho Apr 4, 2019
9c4ed70
t3904: fix incorrect demonstration of a bug
dscho Apr 6, 2019
b85a6f8
stash -p: (partially) fix bug concerning split hunks
dscho Apr 6, 2019
d8850d4
Merge branch 'stash-p-corner-case'
dscho May 8, 2019
ee77788
Merge branch 'built-in-stash-and-add-p'
dscho Apr 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Documentation/config/add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ add.ignore-errors (deprecated)::
option of linkgit:git-add[1]. `add.ignore-errors` is deprecated,
as it does not follow the usual naming convention for configuration
variables.

add.interactive.useBuiltin::
[EXPERIMENTAL] Set to `true` to use the experimental built-in
implementation of the interactive version of linkgit:git-add[1]
instead of the Perl script version. Is `false` by default.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ TEST_BUILTINS_OBJS += test-online-cpus.o
TEST_BUILTINS_OBJS += test-parse-options.o
TEST_BUILTINS_OBJS += test-path-utils.o
TEST_BUILTINS_OBJS += test-pkt-line.o
TEST_BUILTINS_OBJS += test-prefix-map.o
TEST_BUILTINS_OBJS += test-prio-queue.o
TEST_BUILTINS_OBJS += test-reach.o
TEST_BUILTINS_OBJS += test-read-cache.o
Expand Down Expand Up @@ -852,6 +853,8 @@ LIB_H := $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
-name '*.h' -print)

LIB_OBJS += abspath.o
LIB_OBJS += add-interactive.o
LIB_OBJS += add-patch.o
LIB_OBJS += advice.o
LIB_OBJS += alias.o
LIB_OBJS += alloc.o
Expand Down Expand Up @@ -970,6 +973,7 @@ LIB_OBJS += patch-ids.o
LIB_OBJS += path.o
LIB_OBJS += pathspec.o
LIB_OBJS += pkt-line.o
LIB_OBJS += prefix-map.o
LIB_OBJS += preload-index.o
LIB_OBJS += pretty.o
LIB_OBJS += prio-queue.o
Expand Down
Loading