-
Notifications
You must be signed in to change notification settings - Fork 702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--dry-run
removes quotation marks from paths in fast-export.filtered
#585
Comments
Oh and in case it matters, this is the filter-repo command I'm running (actual paths modified): git-filter-repo --dry-run \
--invert-paths \
--path Path/To/A/File/CodeToRemove.swift \
--path Path/To/A/File/CodeToRemoveTests.swift \
--path Path/To/Another/File/MoreCodeToRemove.swift |
Does applying this diff do what you want?
|
Hmm, nope, no change to the diff when I use that patch. Using this patch seems to fix it though: diff --git a/git-filter-repo b/git-filter-repo
index 9cce52a..be3885c 100755
--- a/git-filter-repo
+++ b/git-filter-repo
@@ -195,7 +195,7 @@ class PathQuoting:
# pqsc = PathQuoting._special_chars
# if any(pqsc[x] for x in set(unquoted_string)):
# Option 2, perf hack: do minimal amount of quoting required by fast-import
- if unquoted_string.startswith(b'"') or b'\n' in unquoted_string:
+ if unquoted_string.startswith(b'"') or b'\n' in unquoted_string or b' ' in unquoted_string:
pqe = PathQuoting._escape
return b'"' + b''.join(pqe[x] for x in unquoted_string) + b'"'
return unquoted_string I don't know what the other implications of adding that would be though. What do you think? |
Oh, cool, glad you found the needed change. I'm reticent to apply it as-is, though, because it'll likely slow things down for the general case (this function is called quite a lot), and make the comment on the line above it a lie. A few possible paths forward:
Thoughts? |
The last option seems the best to me. I unfortunately don't have the time to do the implementation myself. I'm happy to test things with my specific use-case though if you or someone else takes up the task. |
I'm using the
--dry-run
flag right now to get a sense of what changesgit-filter-repo
will make to my repository on certain commands. When run agit diff
of the resultingfast-export.original
andfast-export.filtered
files, I noticed that quotation marks are being removed from paths that have spaces in them.For example, running
results in the following output in the shell:
Is that expected behavior? Is there some way I can prevent these changes so that the diff is more useful?
The text was updated successfully, but these errors were encountered: