Re: [PATCHv3 2/2] Documentation: enhance gitignore whitelist example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Blake <eblake@xxxxxxxxxx> 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?

> +    # 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/&./;

> +    !/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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]