From: Jonathan Nieder <jrnieder@gmail.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFD] git glossary: define pathspec
Date: Mon, 29 Nov 2010 10:27:58 -0600 [thread overview]
Message-ID: <20101129162758.GF8037@burratino> (raw)
In-Reply-To: <1291025622-15335-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy wrote:
> --- a/Documentation/glossary-content.txt
> +++ b/Documentation/glossary-content.txt
> @@ -278,6 +278,17 @@ This commit is referred to as a "merge commit", or sometimes just a
> of the logical predecessor(s) in the line of development, i.e. its
> parents.
>
> +[[def_pathspec]]pathspec::
> + Pathspec in its simplest form is a literal path to address a
> + file or a blob.
> + Pathspec can end with a slash. Such pathspec is considered a
> + directory prefix and will match everything under matched
> + directory.
> + Pathspec can contain wildcards such as '*', '?'... Such
> + pathspecs, after being matched literally against the entire
> + path, will be matched against the entire path using
> + fnmatch(3).
> +
Perhaps worth mentioning that these are path specifiers?
pathspec::
Pattern used to specify paths.
Pathspecs are used on the command line of "git ls-files", "git
ls-tree", "git grep", "git checkout", and many other commands to
limit the scope of operations to some subset of the tree or
worktree. See the documentation of each command for whether
paths are relative to the current directory or toplevel. The
pathspec syntax is as follows:
. any path matches itself
. the pathspec up to the last slash represents a
directory prefix. The scope of that pathspec is
limited to that subtree.
. the rest of the pathspec is a pattern for the remainder
of the pathname. Paths relative to the directory
prefix will be matched against that pattern using fnmatch(3);
in particular, '*' and '?' _can_ match directory separators.
For example, Documentation/*.jpg will match all .jpg files
in the Documentation subtree,
including Documentation/chapter_1/figure_1.jpg.
Of course, I am making the semantics up. :)
Hope that helps,
Jonathan
prev parent reply other threads:[~2010-11-29 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 10:13 [RFD] git glossary: define pathspec Nguyễn Thái Ngọc Duy
2010-11-29 10:21 ` Nguyen Thai Ngoc Duy
2010-11-29 10:26 ` Nguyen Thai Ngoc Duy
2010-11-29 16:27 ` Jonathan Nieder [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101129162758.GF8037@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
/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.
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 NNTP newsgroup(s).