{"thread":{"id":"42690","subject":"Problem Following file history through sub-tree import","startedAt":"2016-06-22T17:17:42Z","lastAt":"2016-06-22T17:17:42Z","messageCount":1,"participants":["Crabtree, Andrew"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"289872","messageId":"CS1PR84MB0133D7DE01AB62F197ECED4CF92C0@CS1PR84MB0133.NAMPRD84.PROD.OUTLOOK.COM","threadId":"42690","inReplyTo":null,"subject":"Problem Following file history through sub-tree import","fromName":"Crabtree, Andrew","fromEmail":"andrew.crabtree@hpe.com","sentAt":"2016-06-22T16:43:49Z","receivedAt":"2016-06-22T17:17:42Z","isPatch":false,"sender":{"key":"andrew.crabtree@hpe.com","avatar":null},"body":"\nHaving difficulty understanding how to invoke 'git log' to track the history of a file that was imported into a different location through a subtree merge.\nI had thought just '--follow' was needed, but I don't seem to be getting any results with that. \n\nExample below.\n\nThanks!\n~Andrew\n\ngit --version\n   git version 2.9.0\ncd /tmp\nmkdir subtree_test\ncd subtree_test\ngit init \ntouch foo\ngit add foo\ngit commit -m \"initial\"\ngit remote add git_src https://github.com/git/git\ngit fetch git_src\ngit merge --allow-unrelated-histories -s ours --no-commit git_src/master \ngit read-tree --prefix=git_src -u git_src/master\ngit commit -m \"import git as subtree\"\ncd git_src\ngit log pager.c\ncommit 22e7b2600b54f25314c399d45b1ea45d2427c754\nMerge: 8df5087 ab7797d\nAuthor: Andrew Crabtree <andrew.crabtree@hpe.com>\nDate:   Wed Jun 22 08:58:04 2016 -0700\n\n    import git as subtree\ngit log --follow pager.c\n# nothing \n\ngitk pager.c *\n# only shows merge commit 22e7b \n\ngit gui blame pager.c & \n# shows history as expected \n\n\ngit log HEAD^2 -- pager.c \ncommit c3b1e8d85133e2a19d372b7c166d5b49fcbbfef2\nMerge: 595bfef 708b8cc\nAuthor: Junio C Hamano <gitster@pobox.com>\nDate:   Wed Feb 24 13:26:01 2016 -0800\n\n    Merge branch 'jc/am-i-v-fix'\n    \n    The \"v(iew)\" subcommand of the interactive \"git am -i\" command was\n    broken in 2.6.0 timeframe when the command was rewritten in C.\n    \n    * jc/am-i-v-fix:\n      am -i: fix \"v\"iew\n      pager: factor out a helper to prepare a child process to run the pager\n      pager: lose a separate argv[]\n\ncommit 3e3a4a41b0dac564c0302ced4ccc423d0d39bc21\nAuthor: Junio C Hamano <gitster@pobox.com>\nDate:   Tue Feb 16 14:34:44 2016 -0800\n"}]}