Skip to contentSkip to conversation

git apply fails to apply a renamed file in a new directory

PATCH Sam Ravnborg 2 participants 4 messages Jun 15, 2016 x86

lore
Share & tools
lore
#0 lore raw

I just stumbled on what looks like a simple bug in git apply. I had following diff:

arch/x86/configs/i386_defconfig renamed from arch/i386/defconfig +0 -0
similarity index 100%
rename from arch/i386/defconfig
rename to arch/x86/configs/i386_defconfig
arch/x86/configs/x86_64_defconfig renamed from arch/x86_64/defconfig +0 -0
similarity index 100%
rename from arch/x86_64/defconfig
rename to arch/x86/configs/x86_64_defconfig
Signature · 15 lines
1.5.3.4.1157.g0e74-dirty

When trying to apply this diff using:
git apply -p1 < .../patch

I noticed that the two defconfig files were deleted as expected,
but the renamed versions did not appear in the arch/x86/configs/
directory.
The configs/ directory did not exist and was not created.
Without looking at git apply I assume that the rename failed because
it is not prepared to rename a file to a directory that does not exist.

Buried in other stuff so I did not take a look myself..

	Sam
#1 lore raw

Sam Ravnborg, Thu, Oct 25, 2007 20:07:37 +0200:

Quoted 16 lines

I just stumbled on what looks like a simple bug in git apply. I had following diff:

arch/x86/configs/i386_defconfig renamed from arch/i386/defconfig +0 -0
similarity index 100%
rename from arch/i386/defconfig
rename to arch/x86/configs/i386_defconfig
arch/x86/configs/x86_64_defconfig renamed from arch/x86_64/defconfig +0 -0
similarity index 100%
rename from arch/x86_64/defconfig
rename to arch/x86/configs/x86_64_defconfig
Signature · 4 lines
1.5.3.4.1157.g0e74-dirty

When trying to apply this diff using:
git apply -p1 < .../patch

works here. Don't use -p1, it is assumed

#2 lore raw

Alex Riesen, Thu, Oct 25, 2007 23:30:38 +0200:

Quoted 4 lines

Sam Ravnborg, Thu, Oct 25, 2007 20:07:37 +0200:

Quoted 3 lines

I just stumbled on what looks like a simple bug in git apply. I had following diff:

Quoted 10 lines
Quoted 10 lines
arch/x86/configs/i386_defconfig renamed from arch/i386/defconfig +0 -0
similarity index 100%
rename from arch/i386/defconfig
rename to arch/x86/configs/i386_defconfig
arch/x86/configs/x86_64_defconfig renamed from arch/x86_64/defconfig +0 -0
similarity index 100%
rename from arch/x86_64/defconfig
rename to arch/x86/configs/x86_64_defconfig
Signature · 1 line
1.5.3.4.1157.g0e74-dirty

.1157...-dirty. Your git looks heavily modified. Could you try with a something like master of kernel.org?

Mine is based off d90a7fda355c251b8ffdd79617fb083c18245ec2 (builtin-fetch got merged).

Quoted 5 lines
Quoted 2 lines

When trying to apply this diff using:
git apply -p1 < .../patch

works here. Don't use -p1, it is assumed

#3 lore raw
Quoted 5 lines · Alex Riesen

Alex Riesen, Thu, Oct 25, 2007 23:30:38 +0200:

Quoted 4 lines

Sam Ravnborg, Thu, Oct 25, 2007 20:07:37 +0200:

Quoted 3 lines

I just stumbled on what looks like a simple bug in git apply. I had following diff:

Quoted 13 lines
Quoted 10 lines
Quoted 10 lines
arch/x86/configs/i386_defconfig renamed from arch/i386/defconfig +0 -0
similarity index 100%
rename from arch/i386/defconfig
rename to arch/x86/configs/i386_defconfig
arch/x86/configs/x86_64_defconfig renamed from arch/x86_64/defconfig +0 -0
similarity index 100%
rename from arch/x86_64/defconfig
rename to arch/x86/configs/x86_64_defconfig
Signature · 1 line
1.5.3.4.1157.g0e74-dirty

.1157...-dirty. Your git looks heavily modified. Could you try with a something like master of kernel.org?

I guess I still have Linus' rename stuff added - will update.

Quoted 9 lines

Mine is based off d90a7fda355c251b8ffdd79617fb083c18245ec2 (builtin-fetch got merged).

Quoted 5 lines
Quoted 2 lines

When trying to apply this diff using:
git apply -p1 < .../patch

works here. Don't use -p1, it is assumed

It seems to be a picnic[*] bug - at least I cannot reproduce it. Sorry for the noise but thanks for testing.

[*] Problem In Chair Not In Computer

Sam