git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Jack F'" <jack@bytes.nz>, <git@vger.kernel.org>
Subject: RE: Missing ? wildcard character in gitignore documentation
Date: Mon, 29 Jan 2018 10:47:10 -0500	[thread overview]
Message-ID: <000f01d39918$70009eb0$5001dc10$@nexbridge.com> (raw)
In-Reply-To: <903a193c-0360-59bc-4d86-6470ac8dc1a8@bytes.nz>

On January 29, 2018 6:30 AM, Jack F wrote:
> I have just noticed that the documentation for gitignore is missing
> documentation on using the ? to match any single character. I have included
> a example below with git version 2.14.1.
> 
> |11:05:09 j ~/Development/ls-ignore [master] $ git status On branch
> master Your branch is up-to-date with 'origin/master'. nothing to commit,
> working tree clean 11:05:11 j ~/Development/ls-ignore [master] $ cat
> .gitignore *~ node_modules yarn* 11:05:21 j ~/Development/ls-ignore
> [master] $ touch test.swo 11:05:31 j ~/Development/ls-ignore [master]?1 $
> git status On branch master Your branch is up-to-date with 'origin/master'.
> Untracked files: (use "git add <file>..." to include in what will be committed)
> test.swo nothing added to commit but untracked files present (use "git add"
> to track) 11:05:35 j ~/Development/ls-ignore [master]?1 $ echo "*.sw?" >>
> .gitignore 11:05:40 j ~/Development/ls-ignore [master]≠1 $ cat .gitignore *~
> node_modules
> yarn* *.sw? 11:05:51 j ~/Development/ls-ignore [master]≠1 $ git status On
> branch master Your branch is up-to-date with 'origin/master'. Changes not
> staged for commit: (use "git add <file>..." to update what will be
> committed) (use "git checkout -- <file>..." to discard changes in working
> directory) modified: .gitignore no changes added to commit (use "git add"
> and/or "git commit -a")|
> 
> 
> 
> Noticed it when checking an npm package (ignore) that uses the
> documentation (https://git-scm.com/docs/gitignore) to determine its
> functionality. It is documented in https://git-scm.com/book/en/v2/Git-
> Basics-Recording-Changes-to-the-Repository#Ignoring-Files

The implication of support for ? is there through the following paragraph from the gitignore documentation:

    "Otherwise, Git treats the pattern as a shell glob suitable for consumption by fnmatch(3)
    with the FNM_PATHNAME flag: wildcards in the pattern will not match a / in the
    pathname. For example, "Documentation/*.html" matches "Documentation/git.html"
    but not "Documentation/ppc/ppc.html" or "tools/perf/Documentation/perf.html"."

Of course you have to go read fnmatch(3), so it might be good for expand on this here :).

Cheers,
Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.




  reply	other threads:[~2018-01-29 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 11:29 Missing ? wildcard character in gitignore documentation Jack F
2018-01-29 15:47 ` Randall S. Becker [this message]
2018-01-29 16:07   ` Jack F
2018-01-30 10:13   ` Duy Nguyen
2018-01-30 11:07     ` Ævar Arnfjörð Bjarmason
2018-01-30 11:32       ` Duy Nguyen

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='000f01d39918$70009eb0$5001dc10$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git@vger.kernel.org \
    --cc=jack@bytes.nz \
    /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).