{"thread":{"id":"21186","subject":"meaning of HEAD in context of filter-branch","startedAt":"2009-10-11T02:43:57Z","lastAt":"2009-10-12T10:41:39Z","messageCount":3,"participants":["bill lam","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124587","messageId":"20091011024357.GA9021@debian.b2j","threadId":"21186","inReplyTo":null,"subject":"meaning of HEAD in context of filter-branch","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2009-10-11T02:43:57Z","receivedAt":"2009-10-11T02:43:57Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"I tried to process some files that changed between each commit using\nthe command\n\ngit filter-branch --tree-filter 'git diff --name-only HEAD^.. | foo\n\nhowever it seems that HEAD is fixed to mean the HEAD of the current\ntip before starting git-filter-branch, by trying like this\n\n$ git rev-list -1 HEAD^\n2bf95faed2d51c338ea6fa93e7bb6cc9c1bc759b\n\ngit filter-branch --tree-filter 'git rev-list -1 HEAD^ >>/tmp/sha' -- --all\n$ cat /tmp/sha\n2bf95faed2d51c338ea6fa93e7bb6cc9c1bc759b\n2bf95faed2d51c338ea6fa93e7bb6cc9c1bc759b\n2bf95faed2d51c338ea6fa93e7bb6cc9c1bc759b\n2bf95faed2d51c338ea6fa93e7bb6cc9c1bc759b\n\n\nhow to get the HEAD during filter-branch or other workaround?\n\n-- \nregards,\n====================================================\nGPG key 1024D/4434BAB3 2008-08-24\ngpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3\n"},{"id":"124597","messageId":"m27hv2s22f.fsf@igel.home","threadId":"21186","inReplyTo":"20091011024357.GA9021@debian.b2j","subject":"Re: meaning of HEAD in context of filter-branch","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2009-10-11T09:38:16Z","receivedAt":"2009-10-11T09:38:16Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"bill lam <cbill.lam@gmail.com> writes:\n\n> how to get the HEAD during filter-branch or other workaround?\n\n>From git-filter-index(1):\n\n   Filters\n       The filters are applied in the order as listed below. The <command>\n       argument is always evaluated in the shell context using the eval\n       command (with the notable exception of the commit filter, for technical\n       reasons). Prior to that, the $GIT_COMMIT environment variable will be\n                                    ^^^^^^^^^^^\n       set to contain the id of the commit being rewritten.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"124685","messageId":"20091012104139.GB3937@debian.b2j","threadId":"21186","inReplyTo":"m27hv2s22f.fsf@igel.home","subject":"Re: meaning of HEAD in context of filter-branch","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2009-10-12T10:41:39Z","receivedAt":"2009-10-12T10:41:39Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"On Sun, 11 Oct 2009, Andreas Schwab wrote:\n>        reasons). Prior to that, the $GIT_COMMIT environment variable will be\n>                                     ^^^^^^^^^^^\n\nThanks. This is what I should use.\n\n-- \nregards,\n====================================================\nGPG key 1024D/4434BAB3 2008-08-24\ngpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3\n"}]}