Re: [PATCH v5 3/4] Recommend git-filter-repo instead of git-filter-branch
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 3, 2019, 21:40 UTC
- Message-ID
- <xmqqo901rrcs.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190903185524.13467-4-newren@gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 10 quoted lines
> 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" ]; thenThis 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
...Show 10 quoted lines
> + 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>]