Improve description of git filter-branch.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ralf Wildenhues 2008-03-20 22:30:32 +01:00 committed by Junio C Hamano
parent c8a0869290
commit bf7c90216d

View File

@ -25,7 +25,7 @@ Otherwise, all information (including original commit times or merge
information) will be preserved. information) will be preserved.
The command will only rewrite the _positive_ refs mentioned in the The command will only rewrite the _positive_ refs mentioned in the
command line (i.e. if you pass 'a..b', only 'b' will be rewritten). command line (e.g. if you pass 'a..b', only 'b' will be rewritten).
If you specify no filters, the commits will be recommitted without any If you specify no filters, the commits will be recommitted without any
changes, which would normally have no effect. Nevertheless, this may be changes, which would normally have no effect. Nevertheless, this may be
useful in the future for compensating for some git bugs or such, useful in the future for compensating for some git bugs or such,
@ -42,7 +42,7 @@ Always verify that the rewritten version is correct: The original refs,
if different from the rewritten ones, will be stored in the namespace if different from the rewritten ones, will be stored in the namespace
'refs/original/'. 'refs/original/'.
Note that since this operation is extensively I/O expensive, it might Note that since this operation is very I/O expensive, it might
be a good idea to redirect the temporary directory off-disk with the be a good idea to redirect the temporary directory off-disk with the
'-d' option, e.g. on tmpfs. Reportedly the speedup is very noticeable. '-d' option, e.g. on tmpfs. Reportedly the speedup is very noticeable.
@ -51,14 +51,15 @@ Filters
~~~~~~~ ~~~~~~~
The filters are applied in the order as listed below. The <command> The filters are applied in the order as listed below. The <command>
argument is always evaluated in shell using the 'eval' command (with the argument is always evaluated in the shell context using the 'eval' command
notable exception of the commit filter, for technical reasons). (with the notable exception of the commit filter, for technical reasons).
Prior to that, the $GIT_COMMIT environment variable will be set to contain Prior to that, the $GIT_COMMIT environment variable will be set to contain
the id of the commit being rewritten. Also, GIT_AUTHOR_NAME, the id of the commit being rewritten. Also, GIT_AUTHOR_NAME,
GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL,
and GIT_COMMITTER_DATE are set according to the current commit. If any and GIT_COMMITTER_DATE are set according to the current commit. The values
evaluation of <command> returns a non-zero exit status, the whole operation of these variables after the filters have run, are used for the new commit.
will be aborted. If any evaluation of <command> returns a non-zero exit status, the whole
operation will be aborted.
A 'map' function is available that takes an "original sha1 id" argument A 'map' function is available that takes an "original sha1 id" argument
and outputs a "rewritten sha1 id" if the commit has been already and outputs a "rewritten sha1 id" if the commit has been already
@ -71,9 +72,9 @@ OPTIONS
------- -------
--env-filter <command>:: --env-filter <command>::
This is the filter for modifying the environment in which This filter may be used if you only need to modify the environment
the commit will be performed. Specifically, you might want in which the commit will be performed. Specifically, you might
to rewrite the author/committer name/email/time environment want to rewrite the author/committer name/email/time environment
variables (see linkgit:git-commit[1] for details). Do not forget variables (see linkgit:git-commit[1] for details). Do not forget
to re-export the variables. to re-export the variables.
@ -149,7 +150,7 @@ definition impossible to preserve signatures at any rate.)
-d <directory>:: -d <directory>::
Use this option to set the path to the temporary directory used for Use this option to set the path to the temporary directory used for
rewriting. When applying a tree filter, the command needs to rewriting. When applying a tree filter, the command needs to
temporary checkout the tree to some directory, which may consume temporarily check out the tree to some directory, which may consume
considerable space in case of large projects. By default it considerable space in case of large projects. By default it
does this in the '.git-rewrite/' directory but you can override does this in the '.git-rewrite/' directory but you can override
that choice by this parameter. that choice by this parameter.