You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add the ability to set the filename's used for create_patch and merge #2
Right now users are unable to set their own filenames, which appear when displaying a patch or when a merge has conflicts. There should be some interface which makes it easy for user's to overwrite the currently used defaults. A few options include:
Adding the ability to set the names via an option in DiffOptions and MergeOptions
Introduce a new thin wrapper File which is a tuple (filename, contents) which are passed into the create_patch and merge methods instead of just passing in their contents.
I was looking at implementing this because I'd like it in guppy, and I'm wondering whether we need to treat filenames slightly differently than we do not. I did some investigation and it looks like git diff escapes filenames that aren't UTF-8. On Linux (tested on zsh):
Activity
sunshowers commentedon Dec 23, 2020
I was looking at implementing this because I'd like it in guppy, and I'm wondering whether we need to treat filenames slightly differently than we do not. I did some investigation and it looks like
git diffescapes filenames that aren't UTF-8. On Linux (tested on zsh):prints
diff --git "a/foobar\224" "b/foobar\224" new file mode 100644 index 0000000..e69de29Think maybe we should do the same thing, unless there's another use case I might be missing.
sunshowers commentedon Dec 23, 2020
Ah nvm:
prints filenames without escaping them. Oh well.
Allow custom original and modified file names in DiffOptions.
kpcyrd commentedon Apr 15, 2024
I was wondering the same,
Patch::newdoes pretty much what I need but isn't public.For other people running into this issue, there's a crate that can be used in the meantime: https://crates.io/crates/diffy-fork-filenames
Allow custom original and modified file names in DiffOptions.
chore: release v0.4.3 (bmwill#2)