On Fri, Sep 13, 2019 at 11:54 AM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > Elijah Newren <newren@xxxxxxxxx> writes: > > > +test_expect_failure 'git clean handles being told what to clean' ' > > + mkdir -p d1 d2 && > > + touch d1/ut d2/ut && > > + git clean -f */ut && > > + test_path_is_missing d1/ut && > > + test_path_is_missing d2/ut > > +' > > Looks like d1 and d2 are new directories and the paths we see in the > test are the only ones that are involved (i.e. we do not rely on any > leftover cruft in d[12]/ from previous tests). If so, perhaps it is > easier to follow by starting the tests with "rm -fr d1 d2 &&" or > something to assure the readers of the script (not this patch, but > the resulting file down the road) about the isolation? The same > comment applies to the remainder. Makes sense. > Also, you talked about tracked paths in the proposed log message; do > they not participate in reproducing the issue(s)? If there is only one directory which has no tracked files, then the user can clean up the files -- but confusingly, they have to issue the same git-clean command multiple times. If multiple directories have no untracked files, git-clean will never clean them out. I probably didn't do a very good job explaining that although I started with the case with one tracked, that I view the case without any as the more general case -- and that solving it solves both problems. I could probably make that clearer in the commit message. (Or maybe just add more testcases even if slightly duplicative, I guess.)