git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitignore.txt: suggestions how to get literal # or ! at the beginning
@ 2012-10-06  8:38 Nguyễn Thái Ngọc Duy
  2012-10-06 11:33 ` Philip Oakley
  0 siblings, 1 reply; 8+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2012-10-06  8:38 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

We support backslash escape, but we hide the details behind the phrase
"a shell glob suitable for consumption by fnmatch(3)". So it may not
be obvious how one can get literal # or ! at the beginning of a pattern.
Add a few lines on how to work around the magic characters.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Asciidoc 8.2.6 does not like me writing
 "Put \# if you need a literal #.." so I go with "backslash" and
 "hash" instead. `\!` displays fine both in man page and html format.
 '!' changed to `!` because it looks clearer in monospace.

 Documentation/gitignore.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index 96639e0..8c03ed4 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -74,11 +74,14 @@ PATTERN FORMAT
    for readability.
 
  - A line starting with # serves as a comment.
+   Put a backslash in front of the first hash for the patterns
+   that start with a hash.
 
- - An optional prefix '!' which negates the pattern; any
+ - An optional prefix `!` which negates the pattern; any
    matching file excluded by a previous pattern will become
    included again.  If a negated pattern matches, this will
-   override lower precedence patterns sources.
+   override lower precedence patterns sources. Use `\!` if
+   you need a literal `!` at the beginning of the pattern.
 
  - If the pattern ends with a slash, it is removed for the
    purpose of the following description, but it would only find
-- 
1.7.12.1.406.g6ab07c4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-10-07  3:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-06  8:38 [PATCH] gitignore.txt: suggestions how to get literal # or ! at the beginning Nguyễn Thái Ngọc Duy
2012-10-06 11:33 ` Philip Oakley
2012-10-06 11:43   ` Nguyen Thai Ngoc Duy
2012-10-06 13:21     ` Jeff King
2012-10-06 13:51       ` [PATCH v2] " Nguyễn Thái Ngọc Duy
2012-10-06 15:40         ` Jeff King
2012-10-06 18:25           ` Junio C Hamano
2012-10-07  3:13             ` [PATCH v3] " Nguyễn Thái Ngọc Duy

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).