0

How can I use git log --pretty=format"" to output a git log in this format

timestamp|username|type|file    
1275543595|andrew|A|src/main.cpp
akond
  • 15,865
  • 4
  • 35
  • 55
Stephie
  • 3,135
  • 17
  • 22

2 Answers2

0

Crude, but gets the job done

git log --name-status --format='%ct|%an' hulu.sh |
  sed 'N;N;s/\n/|/;s///;s/\t/|/'
  • append 2 lines to pattern space
  • replace first newline with |
  • remove second newline
  • replace tab with |
1363415345|Steven Penny|M|hulu.sh
1363403048|Steven Penny|M|hulu.sh
1363278409|Steven Penny|M|hulu.sh
1363201389|Steven Penny|M|hulu.sh
1363158212|Steven Penny|M|hulu.sh

git log exclude renames

Community
  • 1
  • 1
Zombo
  • 1
  • 62
  • 391
  • 407
  • Thanks! What's the hulu.sh bit for and it outputs wrong see [here](http://www.github.com/RX14/Modpack_Downloader) for the repo and [here](http://www.rx14.co.uk/log.log) for the log generated – Stephie Mar 16 '13 at 18:26
0

Am i correct in assuming that you are trying to get this format so you can have gource parse it ?

if so, check out : https://github.com/whitewhidow/live-git-for-gource/blob/master/git-live.sh

wich already does this, also, just check the code, so you can figure out how to get the correct format, in case you needed it for something else ..

Sam Janssens
  • 1,491
  • 1
  • 12
  • 30