{"thread":{"id":"32900","subject":"[PATCH] Documentation: filter-branch env-filter example","startedAt":"2013-02-13T19:47:43Z","lastAt":"2013-02-14T06:49:55Z","messageCount":2,"participants":["Tade","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"209493","messageId":"511BEDDF.7010800@hell.org.pl","threadId":"32900","inReplyTo":null,"subject":"[PATCH] Documentation: filter-branch env-filter example","fromName":"Tade","fromEmail":"yess@hell.org.pl","sentAt":"2013-02-13T19:47:43Z","receivedAt":"2013-02-13T19:47:43Z","isPatch":true,"sender":{"key":"yess@hell.org.pl","avatar":"https://avatars.githubusercontent.com/u/207712?v=4"},"body":"filter-branch --env-filter example that shows how to change the email address\nin all commits by a certain developer.\n---\n  Documentation/git-filter-branch.txt | 13 +++++++++++++\n  1 file changed, 13 insertions(+)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex dfd12c9..2664cec 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -329,6 +329,19 @@ git filter-branch --msg-filter '\n  ' HEAD~10..HEAD\n  --------------------------------------------------------\n  \n+You can modify committer/author personal information using `--env-filter`.\n+For example, to update some developer's email address use this command:\n+\n+--------------------------------------------------------\n+git filter-branch --env-filter '\n+\tif [ $GIT_AUTHOR_EMAIL =john@old.example.com  ]\n+\tthen\n+\t\tGIT_AUTHOR_EMAIL=john@new.example.com\n+\tfi\n+\texport GIT_AUTHOR_EMAIL\n+' -- --all\n+--------------------------------------------------------\n+\n  To restrict rewriting to only part of the history, specify a revision\n  range in addition to the new branch name.  The new branch name will\n  point to the top-most revision that a 'git rev-list' of this range\n-- 1.7.11.7\n"},{"id":"209508","messageId":"511C8913.9090203@viscovery.net","threadId":"32900","inReplyTo":"511BEDDF.7010800@hell.org.pl","subject":"Re: [PATCH] Documentation: filter-branch env-filter example","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2013-02-14T06:49:55Z","receivedAt":"2013-02-14T06:49:55Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 2/13/2013 20:47, schrieb Tade:\n> filter-branch --env-filter example that shows how to change the email address\n> in all commits by a certain developer.\n> ---\n\nYou should sign off your patch. Use a full real name, please.\n\n>  Documentation/git-filter-branch.txt | 13 +++++++++++++\n>  1 file changed, 13 insertions(+)\n> \n> diff --git a/Documentation/git-filter-branch.txt\n> b/Documentation/git-filter-branch.txt\n> index dfd12c9..2664cec 100644\n> --- a/Documentation/git-filter-branch.txt\n> +++ b/Documentation/git-filter-branch.txt\n> @@ -329,6 +329,19 @@ git filter-branch --msg-filter '\n>  ' HEAD~10..HEAD\n>  --------------------------------------------------------\n>  \n> +You can modify committer/author personal information using `--env-filter`.\n> +For example, to update some developer's email address use this command:\n> +\n> +--------------------------------------------------------\n> +git filter-branch --env-filter '\n> +    if [ $GIT_AUTHOR_EMAIL =john@old.example.com  ]\n\nThis should read\n\n\tif [ \"$GIT_AUTHOR_EMAIL\" = john@old.example.com  ]\n\n(double quotes, spaces around '='). The paragraph before the example talks\nabout both author and committer, but the example handles only the author;\nit should handle the committer as well.\n\n> +    then\n> +        GIT_AUTHOR_EMAIL=john@new.example.com\n> +    fi\n> +    export GIT_AUTHOR_EMAIL\n> +' -- --all\n> +--------------------------------------------------------\n> +\n\nThe place where you inserted the example is reasonable, IMO.\n\n>  To restrict rewriting to only part of the history, specify a revision\n>  range in addition to the new branch name.  The new branch name will\n>  point to the top-most revision that a 'git rev-list' of this range\n\n-- Hannes\n"}]}