git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Eric BlakeNext: Junio C Hamano
Message 3 of 6 in “[PATCHv3 1/2] Documentation: clarify fnmatch behavior in gitignore”
  1. Eric BlakeApr 5, 2011
  2. 2/2 Documentation: enhance gitignore whitelist exampleEric Blake, Apr 5, 2011
  3. Junio C HamanoApr 5, 2011
  4. Junio C HamanoApr 5, 2011
  5. Eric BlakeApr 5, 2011
  6. Drew NorthupApr 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.