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>
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>
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>
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>
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>
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>
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>
`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>
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>
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>
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>
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>
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>
--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>
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>
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>
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>
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>