Derrick Stolee <stolee@xxxxxxxxx> writes: >> +# Ignore_Untracked_Cache, abbreviated to 3 letters because then people can >> +# compare commands side-by-side, e.g. >> +# iuc status --porcelain >expect && >> +# git status --porcelain >actual && >> +# test_cmp expect actual ;-) >> +iuc() { Missing SP after "iuc". >> + git ls-files -s >../current-index-entries >> + git ls-files -t | grep ^S | sed -e s/^S.// >../current-sparse-entries When you see yourself piping grep output to sed, think twice to see if you can lose one of them. sed -ne 's/^S.//p' perhaps? >> + >> + GIT_INDEX_FILE=.git/tmp_index >> + export GIT_INDEX_FILE >> + git update-index --index-info <../current-index-entries >> + git update-index --skip-worktree $(cat ../current-sparse-entries) Are the dances with ls-files and update-index to prepare us for a possible future in which we do not use .git/index as the index file, or something? IOW, would export GIT_INDEX_FILE=.git/tmp_index && cp .git/index "$GIT_INDEX_FILE && be insufficient? >> + >> + git -c core.untrackedCache=false "$@" >> + ret=$? >> + >> + rm ../current-index-entries >> + rm $GIT_INDEX_FILE >> + unset GIT_INDEX_FILE >> + >> + return $ret >> +} > > This is a clever way to get around the untracked cache deletion. > > Thanks for adding these extra comparisons! It really does help guarantee > that we are doing the right thing in each case. Yes, I think it is a great idea to see tested commands behave the same way with or without the untracked cache. Thanks.