Re: [PATCH] Document escaping of special characters in gitignore files

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Document escaping of special characters in gitignore files

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:20

Bruce Korb [off-list ref] writes:
On 01/05/11 11:27, Jakub Narebski wrote:
quoted
quoted
quoted
+++ b/templates/info--exclude
@@ -4,3 +4,4 @@
 # exclude patterns (uncomment them if you want to use them):
 # *.[oa]
 # *~
+# \#*#
Do we need this?  Without explanation it is somewhat hard to realize that
this last line is also an example of a pattern that excludes any filename
that begins and ends with a pound.
Well, perhaps not.  Note though that this exclude pattern is actually
useful for me, as GNU Emacs uses this convention ("#<filename>#") for
auto-save files.
As the source of this thread, I, too, use emacs and it is exactly
the problem of trying to figure out how to get git to ignore these
auto save files that got me down this path.  It was too hard to figure out.
So I suggested some doc changes and the addition of the "exclude
emacs auto save files" pattern to the sample text.  People who do not
use emacs would not understand the \#*# line and folks who do would.
They see files like that all the time.  For the sake of vi users, you
might want to explain them, but I don't think it is crucial.
It *is* important to have an example of a needs-to-be-escaped file name.
Perhaps a single liner comment to describe the three examples immediately
below "exclude patterns (uncomment them..." is in order in that case,
something like:

# exclude patterns (object and library, emacs backup, emacs autosave
# files) -- uncomment if you want to use them
# *.[oa]
# *~
# \#*#

Re: [PATCH] Document escaping of special characters in gitignore files

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:50:20

On Wed, 5 Jan 2011, Junio C Hamano wrote:
Perhaps a single liner comment to describe the three examples immediately
below "exclude patterns (uncomment them..." is in order in that case,
something like:

# exclude patterns (object and library, emacs backup, emacs autosave
# files) -- uncomment if you want to use them
# *.[oa]
# *~
Errr... I think that '*~' pattern is generic UNIX backup, like '*.bak'
is for MS-DOS / MS Windows.

http://en.wikipedia.org/wiki/Tilde#Backup_filenames

  Backup filenames

  The dominant Unix convention for naming backup copies of files is
  appending a tilde to the original file name. It originated with the
  Emacs text editor[citation needed] and was adopted by many other
  editors and some command-line tools.
# \#*#
Anyway, should I reroll this patch with above addition?  Should I add
an explanation why we can use `\#` but need to use "{tilde}#"? 
-- 
Jakub Narebski
Poland
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help