Commit Graph

523 Commits (main)
 

Author SHA1 Message Date
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
Elijah Newren c8767ea56c Merge branch 'nz/clarify-design-rationale'
Signed-off-by: Elijah Newren <newren@gmail.com>
1 year ago
Nicolas Josef Zunker 1fabaa3cf8 README: clarify design rationale
Signed-off-by: Nicolas Josef Zunker <n.zunker@campus.tu-berlin.de>
1 year ago
Elijah Newren 52a9d7ed19 README.md: guide example-oriented learners to the examples
Signed-off-by: Elijah Newren <newren@gmail.com>
1 year ago
Elijah Newren 6d992c2272 README.md: tell windows user to read docs instead of taking random guesses
Windows users do not understand "just place the script into your $PATH",
but surprisingly decide that means they should take random guesses as to
what that means instead of reading the linked page that explains it in
more detail...and then complain that it was hard to figure out.

Make it clear that if they don't understand that statement, they also
should read the more detailed explanation page.

Signed-off-by: Elijah Newren <newren@gmail.com>
1 year ago
Elijah Newren 9da70bddfa INSTALL.md: more workarounds for the insanity of Windows
Apparently trying to use a direct download link for the git-filter-repo
script results in Windows trying to give the file an unwanted extension.
Warn users about that stupidity.

While at it, also:
  * note in the pre-reqs section that we have later hints for Windows
    users about installing Python
  * provide an additional link for installing Python on Windows that
    isn't generic instructions about using Python on Windows but helps
    users find the latest python to install from the Microsoft store

Reported-by: Radu Terec <raduterec@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren 49488f5393 INSTALL.md: be slightly more explicit in a few cases
A few changes:
  * mention pre-requisites
  * provide a direct link to the raw git-filter-repo file
  * note that `git_filter_repo.py` and `git-filter-repo` are filenames
  * mention for the windows folks that the python executable can be a
    full absolute path as well.

Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren 2878d8bc68 INSTALL.md: simplify instructions and suggest `python3 git-filter-repo`
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren be5ea9757f Merge branch 'am/abstract-install-binary'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren 111049a42a filter-lamely: fix a typo
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Aaron Madlon-Kay 5355610850 Makefile: abstract out the `install` binary used
The -D option to `install` is not portable. Abstract out the `install` binary
used so that other platforms can use e.g. ginstall to circumvent this problem.

Signed-off-by: Aaron Madlon-Kay <aaron@madlon-kay.com>
2 years ago
Elijah Newren cbc6535694 filter-repo: pass raw bytestring to regex compilation
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Markus Heidelberg b164ffc988 contrib: new tool to convert svn:externals to Git submodules
This is meant to be a post-processing step after SVN-to-Git conversion
by SubGit (https://subgit.com/), which creates a ".gitsvnextmodules"
file that we will use for svn:externals conversion.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren 4a416be87b Merge branch 'ri/mailmapping-empty-email-addresses'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren 9cf6121b34 lint-history: fix broken --refs option
Commit 3e153806ff (lint-history: Add --refs argument, 2021-12-30)
added a --refs argument to lint-history, but attempting to inject it
directly into the parsed args fields, bypassing some of the important
logic from FilteringOptions.parse_args() -- particularly the bit where
it translates an empty --refs into a request for '--all' as as list of
references.  I somehow overlooked this in my earlier review.  Fix the
problem now.

Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Riley Iverson 91f16fd5ed
Correct mailmapping of empty email addresses
`not old_email` doesn't distinguish between `None` and an empty string,
causing old emails specified as `<>` to apply to every single commit.

Signed-off-by: Riley Iverson <blepabyte@proton.me>
2 years ago
Elijah Newren 5651f62f4c Merge branch 'rh/lint-history-refs-option'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Robert Haschke 3e153806ff lint-history: Add --refs argument
Signed-off-by: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
2 years ago
Elijah Newren f955eb7ba5 Merge branch 'fm/clean-ignore-arg-passthru'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren f57759de44 Merge branch 'jm/grammo-fix'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Francis Charette Migneault 4896736247 clean-ignore: use arguments provided as input instead of enforced defaults
Signed-off-by: Francis Charette Migneault <francis.charette.migneault@gmail.com>
2 years ago
Francis Charette Migneault f887b2d7c9 clean-ignore: move commands under main function
Signed-off-by: Francis Charette Migneault <francis.charette.migneault@gmail.com>
2 years ago
Jonathan Malmaud 6731278c45 git-filter-repo.txt: fix small grammar error
Signed-off-by: Jonathan Malmaud <malmaud@gmail.com>
2 years ago
Elijah Newren 16abc01792 Merge branch 'mg/documentation-typos'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren bfb86c1b17 Merge branch 'kd/installation-makefile-improvements'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Todd Zullinger 70d781b05d git-filter-repo.txt: add missing `git-` prefix to fast-import link
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren 6e52d99979 Merge branch 'mh/ref-map-header'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren 585891f9d5 Merge branch 'mh/fix-filename-in-install-docs'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Elijah Newren d760d24cf7 Merge branch 'sr/git-2.35-fast-export-order-fix'
Signed-off-by: Elijah Newren <newren@gmail.com>
2 years ago
Stefano Rivera 838bdd19f6 Update expected test data for git 2.35
Commit order from fast-export --first-parent has changed in git 2.35,
see 726a228dfb

This will break the same tests on older git releases.

Fixes: #344
Signed-off-by: Stefano Rivera <stefano@rivera.za.net>
2 years ago
Mo-Gul 7b2840a948
doc: fix some typos
Signed-off-by: Stefan Pinnow <Mo-Gul@gmx.net>
2 years ago
Kevin Daudt e1e418018e Makefile: support DESTDIR
When packaging applications, the application is commonly installed into
a different location than it will end up on the users system. While
`prefix` can control where the files will be installed, it also affects
the location the `git_filter_repo` symlink points to. If the files are
then installed in a different location, the symlink is broken.

`DESTDIR` is a de facto standard variable to control where files are
installed, so that prefix can be used to specify where the files end up
on the end-users system. This allows a usecase like `make install
prefix=/usr DESTDIR=pkg`.

Signed-off-by: Kevin Daudt <me@ikke.info>
2 years ago
Kevin Daudt 4ef1aabd4d Makefile: create parent directories
cp requires the destination directories to already exist. If they do not
exist, it will fail. When packaging applications, it's common they are
installed in an empty directory where the expected directory structure
does not exist yet.

Use `install -D` to copy the files to copy the files so that parent
diretories are automatically created.

Signed-off-by: Kevin Daudt <me@ikke.info>
2 years ago
Markus Heidelberg 3fe2b5c3c9 filter-repo: prepend the header line to the "ref-map" file
The existance of a header has already been specified in the documentation.
Further adapt it to the real text implemented now.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
2 years ago
Markus Heidelberg 9cfde803db INSTALL.md: correct a filename with mixed underscore and dash
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
2 years ago
Elijah Newren fff5f43a15 Merge branch 'ek/run-mandb'
Signed-off-by: Elijah Newren <newren@gmail.com
2 years ago
erickeller ced9a0ba03 Update mandb after installing the man page
When manually installing the manpage, also update the mandb.

Signed-off-by: Eric Keller <keller.eric@gmail.com>
2 years ago
Elijah Newren 235fed3269 Makefile: avoid leaking GIT_INDEX_FILE shenanigans to additional commands
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
Elijah Newren 0cd8a1fd39 filter-repo: fix blob count when analyzing
Reported-by: Li Linchao
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
Elijah Newren 240ef0bcc2 README.md: clarify simple instruction rules and antecedent of `it`
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
Elijah Newren 933475ecf1 Make it clearer that --path* do not follow renames
The wording "exact paths" appears to not be clear enough for folks and I
keep repeatedly getting bug reports about filter-repo not following
renames.  Make it very explicit.

Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
Elijah Newren 05e3548b67 Merge branch 'rnd/add-report-dir-option'
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
rndbit e9d5ab3529 filter-repo: add option --report-dir to set custom analysis dir
--analyze is hardcoded to write to a subdirectory inside GIT_DIR.

When practicing filtering runs on a large repo it is desirable to keep
an unchanged copy read-only to reduce chance of user error. It is
desirable to be able to analyze a read-only repo without having to clone
it. This would save a lot of time and space.

Add --report-dir option to set a non-default destination directory for
writing analysis output to.

Signed-off-by: rndbit <rndbit@filter.bitman.net>
[en: fixed existing regression test broken by now not overwriting the
     analysis directory unconditionally, and also added a new test of
     the new behavior for code coverage.]
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
Elijah Newren a8ed6929d0 Merge branch 'rnd/fix-binary-blob-detection'
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
rndbit 993216739e filter-repo: add tests for --replace-text in binary blobs
The --replace-text failed to detect blobs as binary and incorrectly
applied to all blobs.
Prior to switch from python2 to python3 it incorrectly designated blobs
containing 0 character instead of NUL byte as binary and would have been
causing text replacements to apply to binary files and not apply to text
files containing 0 character.

Add regression tests with blobs containing; 0 character, NUL byte, and
both 0 character and NUL byte.

Signed-off-by: rndbit <rndbit@filter.bitman.net>
3 years ago
rndbit 9cfe2b4090 filter-repo: fix detection of binary blobs for --replace-text
Detection if blob is binary for the purpose of --replace-text always
fails and text replacement is applied to all blobs. This has changed
going to python3. With python2 the same code would still be wrong but
would manifest differently.

In the construct 'for x in b"..."' the x is
 - of type <int> in python3
 - of type <str> in python2
thus in python3 condition 'x == b"\0"' can not be true for any x due to
type difference.

Further, the search was supposed to look for NUL byte and not 0
character, thus change to b"\0" instead of b"0".

Signed-off-by: rndbit <rndbit@filter.bitman.net>
3 years ago
Elijah Newren d8e858aeca Merge branch 'sr/fix-file-used-in-version-calculation'
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
Gwyneth Morgan 129a3bcb8b filter-repo: add new --replace-message option
Like --replace-text, add an option --replace-message which replaces text
in commit/tag message bodies, so that users can easily replace text
without constructing a --message-callback.

Signed-off-by: Gwyneth Morgan <gwymor@tilde.club>
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago
Stefano Rivera e7728c38ae Calculate the version from the module, not the entry_point
When git-filter-repo is installed, sys.argv[0] will be an entry-point
stub, not the relevant Python module.

Signed-off-by: Stefano Rivera <stefano@rivera.za.net>
3 years ago
Elijah Newren c5af37f82c Makefile: avoid releasing with uncommitted changes
Signed-off-by: Elijah Newren <newren@gmail.com>
3 years ago