diff options
author | Elijah Newren <newren@gmail.com> | 2021-05-12 17:28:16 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-13 08:45:03 +0900 |
commit | b338e9f668737e08201c990450b8c3d744f63162 (patch) | |
tree | c666900caf1bfd1276b41b09351a4e3272d75715 /t/t5100/patch0004 | |
parent | dir: report number of visited directories and paths with trace2 (diff) | |
download | tgif-b338e9f668737e08201c990450b8c3d744f63162.tar.xz |
ls-files: error out on -i unless -o or -c are specified
ls-files --ignored can be used together with either --others or
--cached. After being perplexed for a bit and digging in to the code, I
assumed that ls-files -i was just broken and not printing anything and
I had a nice patch ready to submit when I finally realized that -i can be
used with --cached to find tracked ignores.
While that was a mistake on my part, and a careful reading of the
documentation could have made this more clear, I suspect this is an
error others are likely to make as well. In fact, of two uses in our
testsuite, I believe one of the two did make this error. In t1306.13,
there are NO tracked files, and all the excludes built up and used in
that test and in previous tests thus have to be about untracked files.
However, since they were looking for an empty result, the mistake went
unnoticed as their erroneous command also just happened to give an empty
answer.
-i will most the time be used with -o, which would suggest we could just
make -i imply -o in the absence of either a -o or -c, but that would be
a backward incompatible break. Instead, let's just flag -i without
either a -o or -c as an error, and update the two relevant testcases to
specify their intent.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5100/patch0004')
0 files changed, 0 insertions, 0 deletions