2

This alias in .git/config:

pycat = !find -iname '*.py' -exec cat {} \;

Gives me this in the shell:

$ git pycat
fatal: bad config file line 19 in .git/config

I've tried quotes, no quotes, switching quote types, escaping everything up to four levels, but I can't figure out what's making git unhappy here.

Gary Fixler
  • 5,632
  • 2
  • 23
  • 39

1 Answers1

2

A little farting around says it's the semicolon,

pycat = !find -iname '*.py' -exec cat {} "\\;"
pycat = !find -iname '*.py' -exec cat {} "';'"
pycat = "!find -iname '*.py' -exec cat {} \\;"
pycat = "!find -iname '*.py' -exec cat {} \";\""

all work. Semicolons are old-school comment-to-eol syntax, that may be what's going on here. So the config parser's eating one layer of doublequotes.

(edit: yup. It even says so in the doc:

The syntax is fairly flexible and permissive; whitespaces are mostly ignored. The # and ; characters begin comments to the end of line, blank lines are ignored.

)

jthill
  • 55,082
  • 5
  • 77
  • 137