Git log in JSON format
gist.github.com
Git log in JSON format
1–10 of 17 posts
Re: Git log in JSON format
#2This 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.
Re: Git log in JSON format
#3Re: Git log in JSON format
#4> 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.
Re: Git log in JSON format
#5> 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.
http://www.theasciicode.com.ar/ascii-control-characters/reco...
Re: Git log in JSON format
#6Here's how I would do it, using libgit2 and proper JSON output: https://gist.github.com/m1el/42472327b4be382b02eb
Re: Git log in JSON format
#7 hg log -T json
hg log -T xml
hg status -T json
hg tags -T json
...Re: Git log in JSON format
#8Every time I see people using printf to generate structured data formats, a part of me dies inside. Here's how I would do it, using libgit2 and proper JSON output: https://gist.github.com/m1el/42472327b4be382b02eb
collection = []
for i in data:
collection.append(fn(i))
Why not just [fn(i) for i in data] ?Re: Git log in JSON format
#9Every time I see people using printf to generate structured data formats, a part of me dies inside. Here's how I would do it, using libgit2 and proper JSON output: https://gist.github.com/m1el/42472327b4be382b02eb
Every time I see this pattern, a part of me dies inside. collection = [] for i in data: collection.append(fn(i)) Why not just [fn(i) for i in data] ?
Re: Git log in JSON format
#10Every time I see people using printf to generate structured data formats, a part of me dies inside. Here's how I would do it, using libgit2 and proper JSON output: https://gist.github.com/m1el/42472327b4be382b02eb
Every time I see this pattern, a part of me dies inside. collection = [] for i in data: collection.append(fn(i)) Why not just [fn(i) for i in data] ?
map(fn, data)
?