[U-Boot] [PATCH 4/7] powerpc/82xx: move km/km82xx-common.h within km82xx.h

Gerlando Falauto gerlando.falauto at keymile.com
Mon Jul 30 20:28:17 CEST 2012


On 07/27/2012 07:31 PM, Wolfgang Denk wrote:
> Dear Gerlando Falauto,
>
> In message<1343402200-32020-5-git-send-email-gerlando.falauto at keymile.com>  you wrote:
>> The only file including km82xx-common.h is km82xx.h.
>> So there is no need to have it as a separate file.
>>
>> Signed-off-by: Gerlando Falauto<gerlando.falauto at keymile.com>
>> ---
>>   include/configs/km/km82xx-common.h |  317 ------------------------------------
>>   include/configs/km82xx.h           |  290 ++++++++++++++++++++++++++++++++-
>>   2 files changed, 289 insertions(+), 318 deletions(-)
>>   delete mode 100644 include/configs/km/km82xx-common.h
>
> Please also try with -M -C and see if this changes anything.

For this one patch I can't get git to detect renames.
I tried with git 1.7.1, 1.7.10.4, 1.7.11.3:

-> git commit --amend
[xxx f9981ff] powerpc/82xx: move km/km82xx-common.h within km82xx.h
  1 files changed, 124 insertions(+), 4 deletions(-)
  rename include/configs/{km/km82xx-common.h => km82xx.h} (75%)

Notice how git commit DOES detect the rename, but the following 
format-patch does NOT:

-> git format-patch -M -C --stdout -1
 From f9981ff849562c9d466d9429e0ec9a510a0d4b3c Mon Sep 17 00:00:00 2001
From: Gerlando Falauto <gerlando.falauto at keymile.com>
Date: Tue, 10 Jul 2012 18:13:27 +0200
Subject: [PATCH] ...
...
---
  include/configs/km/km82xx-common.h |  317 
------------------------------------
  include/configs/km82xx.h           |  290 
++++++++++++++++++++++++++++++++-
  2 files changed, 289 insertions(+), 318 deletions(-)
  delete mode 100644 include/configs/km/km82xx-common.h
...
  #endif /* __CONFIG_H */
-- 
1.7.10.4

I guess the reason behind this is that km82xx.h is already existing.
Again, git can somehow track renames (i.e. one file's gone, another 
one's brand new), but it does not detect "merging" of files.

As a matter of fact, if I rename the target file, i.e.:
-> git mv include/configs/km82xx.h include/configs/km82xx-tmp.h
-> git commit --amend
[xxx 49c85c3] powerpc/82xx: move km/km82xx-common.h within km82xx.h
  2 files changed, 124 insertions(+), 153 deletions(-)
  rename include/configs/{km/km82xx-common.h => km82xx-tmp.h} (75%)
  delete mode 100644 include/configs/km82xx.h

-> ~/bin/git format-patch -M -C -1 --stdout

 From 49c85c351f65330746836bf90a06443a6b095b1e Mon Sep 17 00:00:00 2001
From: Gerlando Falauto <gerlando.falauto at keymile.com>
Date: Tue, 10 Jul 2012 18:13:27 +0200
Subject: [PATCH] ...

...
---
  .../configs/{km/km82xx-common.h => km82xx-tmp.h}   |  128 
++++++++++++++++-
  include/configs/km82xx.h                           |  149 
--------------------
  2 files changed, 124 insertions(+), 153 deletions(-)
  rename include/configs/{km/km82xx-common.h => km82xx-tmp.h} (75%)
  delete mode 100644 include/configs/km82xx.h

diff --git a/include/configs/km/km82xx-common.h 
b/include/configs/km82xx-tmp.h
similarity index 75%
rename from include/configs/km/km82xx-common.h
rename to include/configs/km82xx-tmp.h
index 2c763bb..9bfb8df 100644

THEN, AND ONLY THEN, do I get a rename detected.
And we would need an extra patch to rename it back...

Anyway, I believe the above patch, if applied to a tree with a slightly 
different (let's say updated) km82xx.h, would fail upon the deletion of 
km82xx.h, but would apply cleanly on km82xx-common.h (introducing 
outdated chunks of km82xx.h though). Is that what we really want?

Thanks,
Gerlando


More information about the U-Boot mailing list