{"thread":{"id":"47188","subject":"\"man git-clean\" doesn't clarify the *default* behaviour of \"git clean\"","startedAt":"2017-11-13T10:22:30Z","lastAt":"2017-11-13T10:22:30Z","messageCount":1,"participants":["Robert P. J. Day"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"332403","messageId":"alpine.LFD.2.21.1711130519270.11152@localhost.localdomain","threadId":"47188","inReplyTo":null,"subject":"\"man git-clean\" doesn't clarify the *default* behaviour of \"git clean\"","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2017-11-13T10:21:59Z","receivedAt":"2017-11-13T10:22:30Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"\n  (against my better judgment at this point, i'm going to suggest a\nslight reworking of \"man git-clean\" to make the OPTIONS more\ncomprehensible.)\n\n  while the man page for \"git clean\" explains how options like -d and\n-e and -x and -X, etc etc, alter the default behaviour of \"git clean\",\nthat man page doesn't clearly explain what that initial default\nbehaviour *is*.\n\n  this sort of goes back to an earlier question of mine -- what is the\nprecise definition of files that are \"[un]known to Git\", because\nthat's what you read in that man page:\n\n  \"Normally, only files unknown to Git are removed, ...\"\n\nbut i submit that unless the reader knows precisely what that means,\nthen all of the OPTIONS explanations are potentially confusing since\nthey're all worded in the sense of, \"it's the default behaviour, but\nwith this alteration.\"\n\n  based on a few simple tests, it *seems* that, in this case, the\nabsolutely default behaviour of just \"git clean\" (with no options) is\nto remove files that are all of:\n\n  1) untracked\n  2) not ignored\n  3) 1) and 2) above within only *tracked* directories\n  4) not within subdirs named \".git\"\n\nis this accurate? because if this were explicitly listed at the\nopening of that man page, it would make the subsequent OPTIONS far\nmore understandable, in that each option would now clearly show the\nchange from the default operation. does that make sense? and two more\nthings.\n\n  first, the exclusion options mention overriding both of .gitignore\nand $GIT_DIR/info/exclude, but what about one's personal\ncore.excludesFile setting? does that not play a part in this?\n\n  finally, just an observation, but it seemed that as i was playing\nwith testing cleaning of tracked versus untracked directories, it\nappeared that simply *staging* a directory made it \"known\" to git for\nthe purposes of cleaning. thinking about it, that seems to make sense,\nbut i've never seen that mentioned anywhere.\n\nrday\n\np.s. with respect to trying to improve the docs, i am not trying to be\ndifficult, i am merely succeeding. :-)\n\n  as hard as this may be to believe, i actually teach courses in git,\nand often, i just display the man page for a command and walk through\nit to explain its operation, and there are times when that man page is\nsimply not clear which is why i'm working so hard at trying to improve\nthem.\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                        http://crashcourse.ca\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n\n"}]}