Skip to content

combinediff should accept an arbitrary number of files #50

@jamesderlin

Description

@jamesderlin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions