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

combinediff should accept an arbitrary number of files #50

Open
jamesderlin opened this issue Mar 17, 2021 · 4 comments
Open

combinediff should accept an arbitrary number of files #50

jamesderlin opened this issue Mar 17, 2021 · 4 comments

Comments

@jamesderlin
Copy link

splitdiff is able to split a single patch file into multiple (potentially many) patch files. combinediff is able to combine exactly two patch files.

Why is combinediff not a proper inverse of splitdiff? I think that using combinediff to undo the work of splitdiff ought to be straightforward, but it instead seems awkward:

touch combined.tmp
for i in *.patch; do
  combinediff combined.tmp "$i" > combined.tmp.new
  mv -f combined.tmp.new combined.tmp
done
mv combined.tmp combined.patch

I need to:

  1. Create an empty file as the initial running result.
  2. Use a shell for loop, which I usually try to avoid.
  3. Since I want to write to the same file I'm reading from, I need to pipe output to a temporary file first (or use sponge from moreutils).

(Is there a better way?)

It would be much nicer if combinediff accepted an arbitrary number of files on the command-line and expected them to be in order. For non-overlapping patches, I then could simply use combinediff *.

I'm using patchutils 0.4.2.

@jamesderlin
Copy link
Author

Oh, if all of the patches are non-overlapping, I could just cat them all together.

@sergiomb2
Copy link
Contributor

hello , one day I'd like have time to fix some of these legit issues and also document some important features .
but now I have a doubt , where do I find a "a patch file composed of several incremental patches" ?, or what is a "a patch file composed of several incremental patches" ?

@lxop
Copy link

lxop commented Nov 22, 2022

The first thing I can think of for a patch composed of several incremental patches is combining Linux kernel patches: if I want to see the difference between kernel 5.10 and 5.15, I need to combine patch-5.11, patch-5.12, patch-13, patch-14, and patch-15. I'm trying to do this at the moment using shell redirection:

combinediff <(combinediff patch-5.11 patch-5.12) patch-5.13

or

combinediff patch-5.11 patch-5.12 | combinediff - patch-5.13

but it is not working properly for me - while I do get output, I also get an error message

combinediff: hunk-splitting is required in this case, but is not yet implemented
combinediff: use the -U option to work around this

and the patches aren't properly merged. The -U suggestion doesn't help.

@jamesderlin
Copy link
Author

but now I have a doubt , where do I find a "a patch file composed of several incremental patches" ?, or what is a "a patch file composed of several incremental patches" ?

I'm not sure what you're quoting since my original comment didn't mention anything about "incremental patches". I'm simply requesting that combinediff be able to easily undo splitdiff.

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

3 participants