diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2019-11-29 21:11:42 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-12-01 07:30:54 -0800 |
commit | c08171d156f6f77bdab6500f0b433b650a31ccae (patch) | |
tree | d44096ccca43ec17dcfcb5cb1a7426906d07fd8b /t/t6031-merge-filemode.sh | |
parent | add-interactive: make sure to release `rev.prune_data` (diff) | |
download | tgif-c08171d156f6f77bdab6500f0b433b650a31ccae.tar.xz |
built-in add -i: allow filtering the modified files list
In the `update` command of `git add -i`, we are primarily interested in the
list of modified files that have worktree (i.e. unstaged) changes.
At the same time, we need to determine _also_ the staged changes, to be
able to produce the full added/deleted information.
The Perl script version of `git add -i` has a parameter of the
`list_modified()` function for that matter. In C, we can be a lot more
precise, using an `enum`.
The C implementation of the filter also has an easier time to avoid
unnecessary work, simply by using an adaptive order of the `diff-index`
and `diff-files` phases, and then skipping files in the second phase
when they have not been seen in the first phase.
Seeing as we change the meaning of the `phase` field, we rename it to
`mode` to reflect that the order depends on the exact invocation of the
`git add -i` command.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6031-merge-filemode.sh')
0 files changed, 0 insertions, 0 deletions