Elijah Newren <new...@gmail.com> writes:

> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> index 5c5afa2b98..f805965d87 100755
> --- a/git-filter-branch.sh
> +++ b/git-filter-branch.sh
> @@ -83,6 +83,19 @@ set_ident () {
>       finish_ident COMMITTER
>  }
>  
> +if [ -z "$FILTER_BRANCH_SQUELCH_WARNING" -a \
> +     -z "$GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS" ]; then

This is probably the only place where [] instead of "test" is used
in our shell scripts.

if test -z 
"$FILTER_BRANCH_SQUELCH_WARNING$GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS"
then
    ...

> +     cat <<EOF
> +WARNING: git-filter-branch has a glut of gotchas generating mangled history
> +         rewrites.  Please use an alternative filtering tool such as 'git
> +         filter-repo' (https://github.com/newren/git-filter-repo/) instead.
> +         See the filter-branch manual page for more details; to squelch
> +         this warning, set FILTER_BRANCH_SQUELCH_WARNING=1.
> +
> +EOF
> +     sleep 5
> +fi

This should say it is "sleeping while showing the message and can
safely be killed before starting to do any harm"; alternatively it
should lose the "sleep".  The user would have fear against typing ^C
to get out of a bulk history rewrite command, and the message itself
is making the fear worse.  If your goal is to discourage its use,
then it would be a good idea to make it clear when it is safe to
kill it before going and studying the alternative.  Otherwise, the
sleep does not help that much---the main complaint is that filter
branch is too slow, so the user has plenty of time to read the
message anyway, right? ;-)

>  USAGE="[--setup <command>] [--subdirectory-filter <directory>] [--env-filter 
> <command>]
>       [--tree-filter <command>] [--index-filter <command>]
>       [--parent-filter <command>] [--msg-filter <command>]

Reply via email to