{"thread":{"id":"36956","subject":"Importing history to show up in a blame","startedAt":"2014-06-18T20:09:33Z","lastAt":"2014-06-18T20:09:33Z","messageCount":1,"participants":["Jason Pyeron"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"244583","messageId":"24554E1EBCD64D04B2B2B5E1A6280DF1@black","threadId":"36956","inReplyTo":null,"subject":"Importing history to show up in a blame","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2014-06-18T20:09:33Z","receivedAt":"2014-06-18T20:09:33Z","isPatch":false,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"The only way I have found so far to do this is to merge the branch on to a tmp\nbranch and then back!\n\nThe only other way I found seems real bad:\nhttp://stackoverflow.com/questions/16473363/tell-git-blame-to-use-imported-histo\nry\n\nAnd the way below does not work if there are edits already on master (that is\nnon-identical files).\n\nIs there a better way?\n\n-Jason\n\njpyeron@black /tmp/foo\n$ git --version\ngit version 1.8.4.21.g992c386\n\njpyeron@black /tmp/foo\n$ git init history\nInitialized empty Git repository in /tmp/foo/history/.git/\n\njpyeron@black /tmp/foo\n$ cd history\n\njpyeron@black /tmp/foo/history\n$ #make source.txt and commit ...\n\njpyeron@black /tmp/foo/history\n$ git checkout --orphan HISTORICAL\nSwitched to a new branch 'HISTORICAL'\n\njpyeron@black /tmp/foo/history\n$ # import each historical version and commit ...\n\njpyeron@black /tmp/foo/history\n$ git log  --oneline --graph && git blame source.txt && sha1sum.exe source.txt\n* 2889460 v6 - latest\n* 62e4a90 v5\n* bfdf128 v4\n* 416d32a v3\n* 241a7dc v2\n* 7ef41ad v1\n^7ef41ad (Jason Pyeron 2014-06-18 13:47:57 -0400 1) 1 the\n241a7dc5 (Jason Pyeron 2014-06-18 13:48:53 -0400 2) 2 quick\n62e4a90e (Jason Pyeron 2014-06-18 13:50:44 -0400 3) 3 brown\nbfdf1285 (Jason Pyeron 2014-06-18 13:49:55 -0400 4) 4 fox\n416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 5) 5 jumped\n416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 6) 6 over\n416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 7) 7 the\n416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 8) 8 lazy\n28894602 (Jason Pyeron 2014-06-18 13:51:03 -0400 9) 9 dogs\ncd49f005ab64dac61b2d420a7903fcd02b5f373f *source.txt\n\njpyeron@black /tmp/foo/history\n$ git checkout master\nSwitched to branch 'master'\n\njpyeron@black /tmp/foo/history\n$ git log  --oneline --graph && git blame source.txt && sha1sum.exe source.txt\n* f25b132 import of latest source\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 1) 1 the\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 2) 2 quick\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 3) 3 brown\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 4) 4 fox\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 5) 5 jumped\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 6) 6 over\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 7) 7 the\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 8) 8 lazy\n^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 9) 9 dogs\ncd49f005ab64dac61b2d420a7903fcd02b5f373f *source.txt\n\njpyeron@black /tmp/foo/history\n$ git checkout HISTORICAL\nSwitched to branch 'HISTORICAL'\n\njpyeron@black /tmp/foo/history\n$ git branch historymerge\n\njpyeron@black /tmp/foo/history\n$ git checkout historymerge\nSwitched to branch 'historymerge'\n\njpyeron@black /tmp/foo/history\n$ git merge master\nMerge made by the 'recursive' strategy.\n\njpyeron@black /tmp/foo/history\n$ git checkout master\nSwitched to branch 'master'\n\njpyeron@black /tmp/foo/history\n$ git merge historymerge\nUpdating f25b132..5a9408a\nFast-forward\n\njpyeron@black /tmp/foo/history\n$ git branch -d historymerge\nDeleted branch historymerge (was 5a9408a).\n\njpyeron@black /tmp/foo/history\n$ git log --oneline --graph && git blame source.txt && sha1sum.exe source.txt\n*   5a9408a Merge branch 'master' into historymerge\n|\\\n| * f25b132 import of latest source\n* 2889460 v6 - latest\n* 62e4a90 v5\n* bfdf128 v4\n* 416d32a v3\n* 241a7dc v2\n* 7ef41ad v1\n^7ef41ad (Jason Pyeron 2014-06-18 13:47:57 -0400 1) 1 the\n241a7dc5 (Jason Pyeron 2014-06-18 13:48:53 -0400 2) 2 quick\n62e4a90e (Jason Pyeron 2014-06-18 13:50:44 -0400 3) 3 brown\nbfdf1285 (Jason Pyeron 2014-06-18 13:49:55 -0400 4) 4 fox\n416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 5) 5 jumped\n416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 6) 6 over\n416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 7) 7 the\n416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 8) 8 lazy\n28894602 (Jason Pyeron 2014-06-18 13:51:03 -0400 9) 9 dogs\ncd49f005ab64dac61b2d420a7903fcd02b5f373f *source.txt\n\n\n\n\n--\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n-                                                               -\n- Jason Pyeron                      PD Inc. http://www.pdinc.us -\n- Principal Consultant              10 West 24th Street #100    -\n- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -\n-                                                               -\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nThis message is copyright PD Inc, subject to license 20080407P00.\n"}]}