[Koha-devel] Replace git-filter-branch with git-filter-repo

Jonathan Druart jonathan.druart at bugs.koha-community.org
Thu Jun 16 09:26:23 CEST 2022


Hi devs,

[I sent this on Aug 26th 2021 but it never reached the list!]

You may have seen the following warning when signing off on patches
using the git alias

"""
WARNING: git-filter-branch has a glut of gotchas generating mangled
history
         rewrites.  Hit Ctrl-C before proceeding to abort, then 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.
Proceeding with filter-branch...
"""

And yes, it's very slow, `time git so 1` takes around 10 sec for me.

You can switch to git-filter-repo (https://github.com/newren/git-filter-repo).

First, install it (`pip3 install git-filter-repo` should do it,
otherwise read their install doc
https://github.com/newren/git-filter-repo/blob/main/INSTALL.md).

Then adjust the git alias (~/.gitconfig):

  so = "!f() { c=`expr $1 - 1`; git filter-repo --message-callback
'return message + b\"\\nSigned-off-by: Full Name <email>\"' --refs
HEAD~$c^..; }; f"

I am using 'so' but you may use something else as it's not what is on the wiki.
"Completely finished after 0.20 seconds."

Cheers,
Jonathan


More information about the Koha-devel mailing list