{"thread":{"id":"1058","subject":"how about this as a basis for git-annotate?","startedAt":"2005-06-30T12:20:45Z","lastAt":"2005-06-30T12:20:45Z","messageCount":1,"participants":["lode leroy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"5449","messageId":"BAY22-F23ACB8E1D2F394F9318069FFE30@phx.gbl","threadId":"1058","inReplyTo":null,"subject":"how about this as a basis for git-annotate?","fromName":"lode leroy","fromEmail":"lode_leroy@hotmail.com","sentAt":"2005-06-30T12:20:45Z","receivedAt":"2005-06-30T12:20:45Z","isPatch":false,"sender":{"key":"lode_leroy@hotmail.com","avatar":null},"body":"#!/bin/bash\n\nfile=\"$1\"\nanno=\"$file.anno\"\nprev=\"\"\nexport GIT_DIFF_OPTS=-u0\n\nrm $anno\ntouch $anno\n\nrevs=`git-rev-list HEAD | tac`\n\nfor rev in $revs; do\n\tif [ ! -z \"$prev\" ]; then\n\t\tgit-diff-tree -p $prev $rev $file \\\n\t\t| sed \t-e \"/^--- /p\" \\\n\t\t\t-e \"/^+++ /p\" \\\n\t\t\t-e \"/^--- /d\" \\\n\t\t\t-e \"/^+++ /d\" \\\n\t\t\t-e \"s/^-/-$prev /g\" \\\n\t\t\t-e \"s/^+/+$rev /g\" | patch $anno\n\tfi\n\tprev=$rev\ndone\n\n\n\n* gives a warning when the diff is empty\n* has a problem with \"\\ No newline at end of file\"\n"}]}