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

Feature: Renaming/removing files on the fly #130

Open
frej opened this issue Jun 15, 2018 · 4 comments
Open

Feature: Renaming/removing files on the fly #130

frej opened this issue Jun 15, 2018 · 4 comments
Labels
contribution-required Maintainer has no time and/or no plans to work on this, interested parties should submit a patch feature-request This is a feature request

Comments

@frej
Copy link
Owner

frej commented Jun 15, 2018

In #95 @atykhyy suggests a --filter-names flag along the lines of --filter-contents for a allowing files to be renamed and/or removed during conversion.

I'm open for suggestions, but do we really need a filter for this? Can we not just use a mapping file like we are using for authors and branch names? Do we want to extend the mapping file to support regexps with capture in order to easily rename files?

Regardless of the choice of filter or mapping file we also have to decide how this feature interacts with the --filter-contents and filename encoding conversion. Should --filter-names override the filename conversion or be applied before/after the filename is given to the content conversion filter?

@Himura2la
Copy link

Himura2la commented Jun 16, 2018

Mapping files are better, because they explicitly define all actions and the result is predictable.
The most rock-solid way is mapping without any regexes or globs. The mapping can be like this:

"dir1/dir2"="dir1/Dir2"
"dir1/.git"=

The second line should remove the dir1/.git from history.
The first line will rename dir2 to Dir2. These are the two transformations I needed.

I also think that --filter-names is not the best name, maybe --filter-tree or --filter-files of --filter-paths?

I tend to filter contents after filtering names. It can be faster if some paths are cut out. And we need to explicitly state the order of application everywere we can.

@frej
Copy link
Owner Author

frej commented Jun 17, 2018 via email

@Himura2la
Copy link

Empty string for deletion is less intuitive than no string at all, but if it's much easier, there should not be a problem.

@frej frej added the contribution-required Maintainer has no time and/or no plans to work on this, interested parties should submit a patch label Jun 22, 2018
@frej
Copy link
Owner Author

frej commented Jun 22, 2018

I don't feel strongly for either variant, so I guess it depends on the ambition level of the contributor :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution-required Maintainer has no time and/or no plans to work on this, interested parties should submit a patch feature-request This is a feature request
Projects
None yet
Development

No branches or pull requests

2 participants