Add option --reference to lb-format
With lb-format
it's possible to prepare a patch with the changes required to fix the formatting of files modified in a branch, e.g.:
lb-format --format-patch changes.patch origin/master
but it does not modify the files (only creates the patch file).
Recently a problem was found in the generated patch for a special case (missing newline at end of file), so there was no easy way to reformat only the requested subset of files without going through the patch step.
It would be good to add the possibility of invoking lb-format
as:
lb-format --reference origin/master
to have the same effect of
lb-format --format-patch - origin/master | patch -p1
but avoiding possible bugs in the generated patch.