Hacker News new | ask | show | jobs
by rossy 3989 days ago
> What if there's a double quote in a commit message?

This is what I want to know too. Unless I'm missing something, it doesn't do any escaping. The last time I did something like this, I used %n and %x00 to delimit the output of git log, and converted it to a JavaScript object on the JavaScript side. Git log isn't smart enough to write JSON by itself.

2 comments

Agreed on better output to text, then process, but I'd suggest the record & group separators... It always surprises me when people use more exotic characters for something that's been defined forever (practically) in computer terms for this purpose.

http://www.theasciicode.com.ar/ascii-control-characters/reco...

I did something very similar for work last summer and we basically realized the same thing - null-delimited fields seemed like the only way to really be safe.