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

Make duplicated file format configurable #1315

Merged
merged 2 commits into from
Jul 4, 2023
Merged

Conversation

Limero
Copy link
Contributor

@Limero Limero commented Jun 24, 2023

This makes it possible to configure the format and order that will be used when creating duplicate files. By default, the format replicates the current behavior of putting ~1~ in the end.

Copy link
Collaborator

@joelim-work joelim-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks fine to me, thanks for working on this!

doc.go Show resolved Hide resolved
@Limero Limero force-pushed the dupfilefmt branch 2 times, most recently from d2ca5e0 to 7936949 Compare June 24, 2023 18:31
@gokcehan
Copy link
Owner

gokcehan commented Jul 3, 2023

@Limero Thank you for the patch. Regarding the expansions, would it be better to have %b instead of %f for the basename? I think we have %f refer to the full name in promptfmt. Maybe there could also be separate expansion for the full name as %f (e.g. %f = %b%e and the default could simply be %f.~%n~). What do you think?

@Limero
Copy link
Contributor Author

Limero commented Jul 3, 2023

@Limero Thank you for the patch. Regarding the expansions, would it be better to have %b instead of %f for the basename? I think we have %f refer to the full name in promptfmt. Maybe there could also be separate expansion for the full name as %f (e.g. %f = %b%e and the default could simply be %f.~%n~). What do you think?

Great idea! I changed basename to be %b and %f to be %b%e.

I was thinking of setting %f to the original file name variable, but decided to explicitly set it to basename+ext, so it's obvious when reading the code what it is.

@gokcehan gokcehan merged commit f20d0e5 into gokcehan:master Jul 4, 2023
4 checks passed
@gokcehan gokcehan mentioned this pull request Sep 17, 2023
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

Successfully merging this pull request may close these issues.

3 participants