Skip to content

Comment on Git log in JSON format

Comments

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.

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.