{"thread":{"id":"707","subject":"[PATCH] adjust git-deltafy-script to the new diff-tree output format","startedAt":"2005-05-24T01:58:00Z","lastAt":"2005-05-24T01:58:00Z","messageCount":1,"participants":["Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"3836","messageId":"Pine.LNX.4.62.0505232122390.16151@localhost.localdomain","threadId":"707","inReplyTo":null,"subject":"[PATCH] adjust git-deltafy-script to the new diff-tree output format","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2005-05-24T01:58:00Z","receivedAt":"2005-05-24T01:58:00Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"\nAlso prevent 'sort' from sorting on the sha1 which was screwing the \nhistory listing.\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n\ndiff --git a/git-deltafy-script b/git-deltafy-script\n--- a/git-deltafy-script\n+++ b/git-deltafy-script\n@@ -23,8 +23,9 @@ curr_file=\"\"\n \n git-rev-list HEAD |\n git-diff-tree -r --stdin |\n-sed -n '/^\\*/ s/^.*->\\(.\\{41\\}\\)\\(.*\\)$/\\2 \\1/p' | sort | uniq |\n-while read file sha1; do\n+awk '/^:/ { if ($5 == \"M\" || $5 == \"N\") print $4, $6 }' |\n+LC_ALL=C sort -s -k 2 | uniq |\n+while read sha1 file; do\n \tif [ \"$file\" == \"$curr_file\" ]; then\n \t\tlist=\"$list $sha1\"\n \telse\n"}]}