From: Jeff King <peff@peff.net>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Philip Oakley <philipoakley@iee.org>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] gitignore.txt: suggestions how to get literal # or ! at the beginning
Date: Sat, 6 Oct 2012 09:21:27 -0400 [thread overview]
Message-ID: <20121006132127.GC11712@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8DObOJUSdDPEsTwAKjXMYiOyf7P_6oEE9xbU6QFz7rOxQ@mail.gmail.com>
On Sat, Oct 06, 2012 at 06:43:50PM +0700, Nguyen Thai Ngoc Duy wrote:
> On Sat, Oct 6, 2012 at 6:33 PM, Philip Oakley <philipoakley@iee.org> wrote:
> >> 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.
> >
> >
> > Why not put the backslash-hash in back quotes as well to give the same
> > look/feel consistency?
>
> Because asciidoc does not like \#, '\#' nor `\#`. It just shows \
> without # and I don't want to master asciidoc just to make it show \#.
It works fine for me with asciidoc 8.6.7. <sigh>
I would think the "inline literal" syntax started in 8.2.5 would take
care of it; maybe there were some bug fixes, considering how new it was
in your version.
I also think switching "!" to `!` is a slight regression; it will change
fonts in the HTML version, but usually not in the manpage, and the loss
of the quotes makes things harder to read. I would use both, and it does
not hurt to also spell out the name of the punctuation.
So this:
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index 96639e0..c0a5851 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -73,12 +73,15 @@ PATTERN FORMAT
- A blank line matches no files, so it can serve as a separator
for readability.
- - A line starting with # serves as a comment.
+ - 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 (i.e., "`\#`").
- - 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
renders to:
· 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 (i.e., "\#").
· 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. Use "\!" if you
need a literal "!" at the beginning of the pattern.
-Peff
next prev parent reply other threads:[~2012-10-06 13:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=20121006132127.GC11712@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=philipoakley@iee.org \
/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).