You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git-filter-repo/contrib/filter-repo-demos
Markus Heidelberg 4bc9022afc convert-svnexternals: fix parsing of wrongly transformed SVN revisions
SVN revision numbers from svn:externals property, which are a multiple
of 1024 (2^10), are transformed by SubGit to contain a binary suffix
("k", "m" and "g" have been checked) in .gitsvnextmodules file.
These aren't valid revision numbers in SVN either.

Examples:
  1024 -> 1k
  2048 -> 2k
  1048576 -> 1m
  1049600 -> 1025k
  1073741824 -> 1g

This led to the following error:
    svn_rev = int(parsed_config[section]['revision'])
ValueError: invalid literal for int() with base 10: '1k'

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Elijah Newren <newren@gmail.com>
1 year ago
..
README.md contrib: new tool to convert svn:externals to Git submodules 2 years ago
barebones-example contrib: rename no-op-example to barebones-example 4 years ago
bfg-ish bfg-ish: add some sanity checks on the specified repo 3 years ago
clean-ignore clean-ignore: use arguments provided as input instead of enforced defaults 2 years ago
convert-svnexternals convert-svnexternals: fix parsing of wrongly transformed SVN revisions 1 year ago
filter-branch-ish contrib: new filter-repo demo named filter-lamely (or filter-branch-ish) 5 years ago
filter-lamely filter-lamely: fix a typo 2 years ago
insert-beginning contrib: clarify a few points of usage 5 years ago
lint-history lint-history: fix broken --refs option 2 years ago
signed-off-by filter-repo: improve support for partial history rewrites 5 years ago

README.md

Background

filter-repo is not merely a history rewriting tool, it also contains a library that can be used to write new history rewriting tools. This directory contains several examples showing the breadth of different things that could be done.

Quick overview

Command                         Description
barebones-example Simple example with no modifications to filter-repo behavior, just showing what to import and run.
insert-beginning Add a new file (e.g. LICENSE/COPYING) to the beginning of history.
signed-off-by Add a Signed-off-by tag to a range of commits
lint-history Run some lint command on all non-binary files in history.
clean-ignore Delete files from history which match current gitignore rules.
filter-lamely (or filterbranchish) A nearly bug compatible re-implementation of filter-branch (the git testsuite passes using it instead of filter-branch), with some performance tricks to make it several times faster (though it's still glacially slow compared to filter-repo).
bfg-ish A re-implementation of most of BFG Repo Cleaner, with new features and bug fixes.
convert-svnexternals Insert Git submodules according to SVN externals.

Purpose

Please note that the point of these examples is not to provide new complete tools, but simply to demonstrate that extremely varied history rewriting tools can be created which automatically inherit lots of useful base functionality: rewriting hashes in commit messages, pruning commits that become empty, handling filenames with funny characters, non-standard encodings, handling of replace refs, etc. (Additional examples of using filter-repo as a library can also be found in the testsuite.) My sincerest hope is that these examples provide lots of useful functionality, but that each is missing at least one critical piece for your usecase. Go forth and extend and improve.

Usage

All the examples require a symlink to git-filter-repo in your PYTHONPATH named git_filter_repo.py in order to run; also, all have a --help flag to get a description of their usage and flags.