diff mbox

UBUNTU: [Debian] consider renames in gen-auto-reconstruct

Message ID 20161221111633.29432-1-cascardo@canonical.com
State New
Headers show

Commit Message

Thadeu Lima de Souza Cascardo Dec. 21, 2016, 11:16 a.m. UTC
Recent git versions have changed the rename detection to default when
using git-diff. Previous behavior would allow the reconstruct script to
remove the renamed files, which are added in the diff, but not removed.

Using --no-renames option will revert to the previous behavior when
using those recent git versions.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 debian/scripts/misc/gen-auto-reconstruct | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Luis Henriques Dec. 21, 2016, 1:42 p.m. UTC | #1
On Wed, Dec 21, 2016 at 09:16:33AM -0200, Thadeu Lima de Souza Cascardo wrote:
> Recent git versions have changed the rename detection to default when
> using git-diff. Previous behavior would allow the reconstruct script to
> remove the renamed files, which are added in the diff, but not removed.
> 
> Using --no-renames option will revert to the previous behavior when
> using those recent git versions.

Yeah, looks like git >= 2.9.0 has enabled rename detection by default.
Since I'm still prep'ing kernels in a xenial environment, I've never seen
any problems.

Anyway, this should be applied to xenial and above.

Cheers,
--
Luís

> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
>  debian/scripts/misc/gen-auto-reconstruct | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/debian/scripts/misc/gen-auto-reconstruct b/debian/scripts/misc/gen-auto-reconstruct
> index 83c0428..a76e341 100755
> --- a/debian/scripts/misc/gen-auto-reconstruct
> +++ b/debian/scripts/misc/gen-auto-reconstruct
> @@ -26,7 +26,7 @@ fi
>  (
>  	# Identify all new symlinks since the proffered tag.
>  	echo "# Recreate any symlinks created since the orig."
> -	git diff "$tag.." --raw | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
> +	git diff "$tag.." --raw --no-renames | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
>  	while read name
>  	do
>  		link=$( readlink "$name" )
> @@ -36,7 +36,7 @@ fi
>  
>  	# Identify all removed files since the proffered tag.
>  	echo "# Remove any files deleted from the orig."
> -	git diff "$tag.." --raw | awk '(/^:/ && $5 == "D") { print $NF }' | \
> +	git diff "$tag.." --raw --no-renames | awk '(/^:/ && $5 == "D") { print $NF }' | \
>  	while read name
>  	do
>  		echo "rm -f '$name'"
> @@ -49,7 +49,7 @@ fi
>  (
>  	# Identify all new symlinks since the proffered tag.
>  	echo "# Ignore any symlinks created since the orig which are rebuilt by reconstruct."
> -	git diff "$tag.." --raw | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
> +	git diff "$tag.." --raw --no-renames | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
>  	while read name
>  	do
>  		echo "extend-diff-ignore=$name"
> -- 
> 2.9.3
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Tim Gardner Jan. 9, 2017, 2:27 p.m. UTC | #2
Should be applied to X/Y/Z and unstable, right ?
Thadeu Lima de Souza Cascardo Jan. 9, 2017, 2:36 p.m. UTC | #3
On Mon, Jan 09, 2017 at 07:27:34AM -0700, Tim Gardner wrote:
> Should be applied to X/Y/Z and unstable, right ?
> 

That's right. Thanks.
Cascardo.

> -- 
> Tim Gardner tim.gardner@canonical.com
Luis Henriques Jan. 9, 2017, 4:16 p.m. UTC | #4
Applied to xenial and yakkety master-next branches.

Cheers,
--
Luís
diff mbox

Patch

diff --git a/debian/scripts/misc/gen-auto-reconstruct b/debian/scripts/misc/gen-auto-reconstruct
index 83c0428..a76e341 100755
--- a/debian/scripts/misc/gen-auto-reconstruct
+++ b/debian/scripts/misc/gen-auto-reconstruct
@@ -26,7 +26,7 @@  fi
 (
 	# Identify all new symlinks since the proffered tag.
 	echo "# Recreate any symlinks created since the orig."
-	git diff "$tag.." --raw | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
+	git diff "$tag.." --raw --no-renames | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
 	while read name
 	do
 		link=$( readlink "$name" )
@@ -36,7 +36,7 @@  fi
 
 	# Identify all removed files since the proffered tag.
 	echo "# Remove any files deleted from the orig."
-	git diff "$tag.." --raw | awk '(/^:/ && $5 == "D") { print $NF }' | \
+	git diff "$tag.." --raw --no-renames | awk '(/^:/ && $5 == "D") { print $NF }' | \
 	while read name
 	do
 		echo "rm -f '$name'"
@@ -49,7 +49,7 @@  fi
 (
 	# Identify all new symlinks since the proffered tag.
 	echo "# Ignore any symlinks created since the orig which are rebuilt by reconstruct."
-	git diff "$tag.." --raw | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
+	git diff "$tag.." --raw --no-renames | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
 	while read name
 	do
 		echo "extend-diff-ignore=$name"