git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Git Mailing list <git@vger.kernel.org>
Subject: "man git-clean" doesn't clarify the *default* behaviour of "git clean"
Date: Mon, 13 Nov 2017 05:21:59 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.21.1711130519270.11152@localhost.localdomain> (raw)


  (against my better judgment at this point, i'm going to suggest a
slight reworking of "man git-clean" to make the OPTIONS more
comprehensible.)

  while the man page for "git clean" explains how options like -d and
-e and -x and -X, etc etc, alter the default behaviour of "git clean",
that man page doesn't clearly explain what that initial default
behaviour *is*.

  this sort of goes back to an earlier question of mine -- what is the
precise definition of files that are "[un]known to Git", because
that's what you read in that man page:

  "Normally, only files unknown to Git are removed, ..."

but i submit that unless the reader knows precisely what that means,
then all of the OPTIONS explanations are potentially confusing since
they're all worded in the sense of, "it's the default behaviour, but
with this alteration."

  based on a few simple tests, it *seems* that, in this case, the
absolutely default behaviour of just "git clean" (with no options) is
to remove files that are all of:

  1) untracked
  2) not ignored
  3) 1) and 2) above within only *tracked* directories
  4) not within subdirs named ".git"

is this accurate? because if this were explicitly listed at the
opening of that man page, it would make the subsequent OPTIONS far
more understandable, in that each option would now clearly show the
change from the default operation. does that make sense? and two more
things.

  first, the exclusion options mention overriding both of .gitignore
and $GIT_DIR/info/exclude, but what about one's personal
core.excludesFile setting? does that not play a part in this?

  finally, just an observation, but it seemed that as i was playing
with testing cleaning of tracked versus untracked directories, it
appeared that simply *staging* a directory made it "known" to git for
the purposes of cleaning. thinking about it, that seems to make sense,
but i've never seen that mentioned anywhere.

rday

p.s. with respect to trying to improve the docs, i am not trying to be
difficult, i am merely succeeding. :-)

  as hard as this may be to believe, i actually teach courses in git,
and often, i just display the man page for a command and walk through
it to explain its operation, and there are times when that man page is
simply not clear which is why i'm working so hard at trying to improve
them.

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


                 reply	other threads:[~2017-11-13 10:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.21.1711130519270.11152@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).