
Dear Gerlando Falauto,
In message 50164F3A.6050409@keymile.com you wrote:
boards.cfg | 4 +- include/configs/km82xx.h | 149 +++++++++++++++++++++++++++++++++++++++++++ include/configs/mgcoge.h | 93 --------------------------- include/configs/mgcoge3ne.h | 93 --------------------------- 4 files changed, 151 insertions(+), 188 deletions(-) create mode 100644 include/configs/km82xx.h delete mode 100644 include/configs/mgcoge.h delete mode 100644 include/configs/mgcoge3ne.h
Can you please try creating this patch with git format-patch with options "-M" and "-C", please? I think git should do better to recognize this rename / merge of two files.
I tried this but to no avail, the resulting patch is still the same. Same for patch number 4.
I guess git gets confused by the fact that we are merging two files into one.
No, git can handle this pretty well if you tell it what you are doing. I just retested this; the result is:
--- file.1 | 64 --------------------------------------------------- file.2 => file.common | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 64 deletions(-) delete mode 100644 file.1 rename file.2 => file.common (63%)
What I could do is to split this commit so that, for instance, first we rename one of the files and then (on a separate commit) we move the content of one into the other.
No, this can and should be done in a single commit, for example like this:
1. run: git mv include/configs/mgcoge.h include/configs/km82xx.h 2. merge include/configs/mgcoge3ne.h into include/configs/km82xx.h 3. run: git rm include/configs/mgcoge3ne.h
git format-patch -M -C will then recognize what you did.
Question is, is this really worth the effort? Is there a common practice for such reworks?
Yes, if possible we want that git tracks such renames / merges. And here it seems easily possible.
Best regards,
Wolfgang Denk