Skip to content
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

Apply inverted '--path' filtering after '--path-rename'? #504

Open
MarkusMit opened this issue Sep 21, 2023 · 2 comments
Open

Apply inverted '--path' filtering after '--path-rename'? #504

MarkusMit opened this issue Sep 21, 2023 · 2 comments

Comments

@MarkusMit
Copy link

I have a repository like this:

my-repo/
├── folder_a/
├── folder_b/
│   ├── folder_b_1/
│   ├── folder_b_2/
│   └── folder_b_3/
├── folder_c/
...
└── folder_z/

and - as part of a bigger restructuring - I want to change it like this:
folder_b_3 should be moved up to root, and folder folder_b with all its remaining contents should be removed:

my-repo/
├── folder_a/
├── folder_b_3/
├── folder_c/
...
└── folder_z/

I tried to do this with inverted path filtering (--invert-paths), but it seems the --path filtering is always executed before the --path-rename regardless of the order of the commands:

python3 'git-filter-repo' --force --invert-paths              \
            --path-rename 'folder_b/folder_b_3/:folder_b_3/'  \
            --path 'folder_b/' 

So, the current (undesired) result is, that nothing of folder_b survives:

my-repo/
├── folder_a/
├── folder_c/
...
└── folder_z/

Since "ordering issues" are mentioned with (positive) path filtering and renames in the user manual, I thought it should also be considered accordingly with inverted path filtering.

@newren
Copy link
Owner

newren commented Aug 2, 2024

Yeah, sorry, can you split this into two steps?

   python3 'git-filter-repo' --force \
            --path-rename 'folder_b/folder_b_3/:folder_b_3/'
   python3 'git-filter-repo' --invert-paths \
            --path 'folder_b/' 

@MarkusMit
Copy link
Author

Yeah, since this was already some months ago, I already found a solution for it. ;-)

But my main intend was anyway that this behaviour may be worth mentioning in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants