Commit Graph

524 Commits

Author SHA1 Message Date
Theodore Ni
a59e67e791
fix duplicate setuptools entry point script
Signed-off-by: Theodore Ni <3806110+tjni@users.noreply.github.com>
2023-08-12 14:29:23 -07:00
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>
2023-04-12 08:43:12 -07:00
Elijah Newren
c8767ea56c Merge branch 'nz/clarify-design-rationale'
Signed-off-by: Elijah Newren <newren@gmail.com>
2023-03-27 20:25:32 -07:00
Nicolas Josef Zunker
1fabaa3cf8 README: clarify design rationale
Signed-off-by: Nicolas Josef Zunker <n.zunker@campus.tu-berlin.de>
2023-03-27 22:58:05 +02:00
Elijah Newren
52a9d7ed19 README.md: guide example-oriented learners to the examples
Signed-off-by: Elijah Newren <newren@gmail.com>
2023-01-03 13:26:39 -08:00
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>
2023-01-03 12:49:48 -08:00
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>
2022-11-07 10:30:40 -08:00
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>
2022-10-18 12:49:17 -07:00
Elijah Newren
2878d8bc68 INSTALL.md: simplify instructions and suggest python3 git-filter-repo
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-10-14 11:31:40 -07:00
Elijah Newren
be5ea9757f Merge branch 'am/abstract-install-binary'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-10-12 15:45:56 -07:00
Elijah Newren
111049a42a filter-lamely: fix a typo
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-10-12 15:40:44 -07:00
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>
2022-10-13 07:01:57 +09:00
Elijah Newren
cbc6535694 filter-repo: pass raw bytestring to regex compilation
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-10-08 21:42:32 -07:00
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>
2022-10-05 20:55:56 -07:00
Elijah Newren
4a416be87b Merge branch 'ri/mailmapping-empty-email-addresses'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-10-03 15:22:02 -07:00
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>
2022-10-03 15:04:52 -07:00
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>
2022-10-04 10:35:18 +13:00
Elijah Newren
5651f62f4c Merge branch 'rh/lint-history-refs-option'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-09-29 09:24:26 -07:00
Robert Haschke
3e153806ff lint-history: Add --refs argument
Signed-off-by: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
2022-09-29 15:23:19 +02:00
Elijah Newren
f955eb7ba5 Merge branch 'fm/clean-ignore-arg-passthru'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-09-27 00:49:07 -07:00
Elijah Newren
f57759de44 Merge branch 'jm/grammo-fix'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-09-27 00:45:26 -07:00
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>
2022-09-26 16:20:17 -04:00
Francis Charette Migneault
f887b2d7c9 clean-ignore: move commands under main function
Signed-off-by: Francis Charette Migneault <francis.charette.migneault@gmail.com>
2022-09-26 16:20:03 -04:00
Jonathan Malmaud
6731278c45 git-filter-repo.txt: fix small grammar error
Signed-off-by: Jonathan Malmaud <malmaud@gmail.com>
2022-09-26 11:29:19 -07:00
Elijah Newren
16abc01792 Merge branch 'mg/documentation-typos'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-09-24 17:39:03 -07:00
Elijah Newren
bfb86c1b17 Merge branch 'kd/installation-makefile-improvements'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-09-24 17:33:58 -07:00
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>
2022-09-24 16:56:00 -07:00
Elijah Newren
6e52d99979 Merge branch 'mh/ref-map-header'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-09-24 16:08:01 -07:00
Elijah Newren
585891f9d5 Merge branch 'mh/fix-filename-in-install-docs'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-09-24 15:59:13 -07:00
Elijah Newren
d760d24cf7 Merge branch 'sr/git-2.35-fast-export-order-fix'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-05-27 21:32:24 -07:00
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>
2022-03-06 12:34:15 -04:00
Mo-Gul
7b2840a948
doc: fix some typos
Signed-off-by: Stefan Pinnow <Mo-Gul@gmx.net>
2022-02-14 07:19:09 +01:00
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>
2022-01-31 10:03:48 +01:00
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>
2022-01-31 09:53:06 +01:00
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>
2022-01-17 16:49:04 +01:00
Markus Heidelberg
9cfde803db INSTALL.md: correct a filename with mixed underscore and dash
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
2021-12-23 12:10:56 +01:00
Elijah Newren
fff5f43a15 Merge branch 'ek/run-mandb'
Signed-off-by: Elijah Newren <newren@gmail.com
2021-12-01 13:02:03 -08:00
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>
2021-12-01 21:12:26 +01:00
Elijah Newren
235fed3269 Makefile: avoid leaking GIT_INDEX_FILE shenanigans to additional commands
Signed-off-by: Elijah Newren <newren@gmail.com>
2021-11-15 14:54:30 -08:00
Elijah Newren
0cd8a1fd39 filter-repo: fix blob count when analyzing
Reported-by: Li Linchao
Signed-off-by: Elijah Newren <newren@gmail.com>
2021-11-12 09:03:56 -08:00
Elijah Newren
240ef0bcc2 README.md: clarify simple instruction rules and antecedent of it
Signed-off-by: Elijah Newren <newren@gmail.com>
2021-11-09 13:42:46 -08:00
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>
2021-11-09 10:01:06 -08:00
Elijah Newren
05e3548b67 Merge branch 'rnd/add-report-dir-option'
Signed-off-by: Elijah Newren <newren@gmail.com>
2021-11-08 22:10:41 -08:00
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>
2021-11-08 22:10:19 -08:00
Elijah Newren
a8ed6929d0 Merge branch 'rnd/fix-binary-blob-detection'
Signed-off-by: Elijah Newren <newren@gmail.com>
2021-11-06 19:38:32 -07:00
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>
2021-09-02 16:39:11 +00:00
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>
2021-09-02 16:38:44 +00:00
Elijah Newren
d8e858aeca Merge branch 'sr/fix-file-used-in-version-calculation'
Signed-off-by: Elijah Newren <newren@gmail.com>
2021-08-25 07:53:59 -07:00
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>
2021-08-25 07:51:39 -07:00
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>
2021-08-24 14:22:46 -07:00