Re: [PATCHv3 2/2] Documentation: enhance gitignore whitelist example
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 5, 2011, 22:43 UTC
- Message-ID
- <7vbp0kl3p6.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1302041878-24426-2-git-send-email-eblake@redhat.com>
Eric Blake <eblake@redhat.com> writes:
> v3: split out fnmatch tweaks, don't tweak specification of patterns > or existing examples but instead add an entirely new example, make > the example use a deeper hierarchy
Somebody has to compare this vs making the existing example larger. Generally speaking, I prefer to keep the number of examples smaller (the less the beginner has to read, the better), but the end result might be more readable with a separate example, like this patch does.
> + $ cat .gitignore > + # Use anchoring, since `build' would ignore Documentation/build.
> + # Do not ignore the directory itself, ... > + # /build/ > + # rather ignore files in the top-level build directory, ...
Do you _really_ need these three lines? I suspect that it is unclear to the first reader that the second one is a _bad_ example that is commented out. That is, how about starting like this, without the above three?
Show 7 quoted lines
> + # Ignore files in the top-level build directory, ... > + /build/* > + # but permit child directories, ... > + !/build/*/ > + # then ignore all nested files, ... > + /build/*/* > + # and finally white-list the special file
Nit; s/the special file/&./;
Show 8 quoted lines
> + !/build/foo/baz > + $ git status > + [...] > + # Untracked files: > + [...] > + # Documentation/build/file > + # build/foo/baz > + [...]
Other than that, as a free-standing example this was very straightforward illustration. I didn't check the flow-of-learning though.
Thanks.