summaryrefslogtreecommitdiffstats
path: root/builtin/count-objects.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-11-29 22:11:42 +0100
committerJunio C Hamano <gitster@pobox.com>2019-12-01 16:30:54 +0100
commitc08171d156f6f77bdab6500f0b433b650a31ccae (patch)
treed44096ccca43ec17dcfcb5cb1a7426906d07fd8b /builtin/count-objects.c
parentadd-interactive: make sure to release `rev.prune_data` (diff)
downloadgit-c08171d156f6f77bdab6500f0b433b650a31ccae.tar.xz
git-c08171d156f6f77bdab6500f0b433b650a31ccae.zip
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 'builtin/count-objects.c')
0 files changed, 0 insertions, 0 deletions