diff options
author | Dave Chinner <david@fromorbit.com> | 2015-07-02 13:33:17 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-07-02 13:33:17 +1000 |
commit | 522c30688d3e1ae23dda8d654f0d958d214c9141 (patch) | |
tree | 112a0c5b5f5242e3175d5a0ec8e24dc4b3a43a3e | |
parent | 9e65dfe16ea74a8ebdc2d31e80481bef1d4aea42 (diff) | |
download | xfsprogs-dev-libxfs-commit-script.tar.gz |
libxfs-apply: ensure guilt import retains commit messageslibxfs-commit-script
The commit message attached to each patch is being filtered out
during the process of preparing it for import via guilt. This
results in commits without the corresponding commit message.
Massage the patch format to ensure that guilt imports the commit
message along with the code changes.
Also, older versions of filterdiff do not handle git diff metadata
correctly, so add a version check on filterdiff to make sure we use
a working version.
Signed-off-by: Dave Chinner <david@fromorbit.com>
-rwxr-xr-x | tools/libxfs-apply | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/libxfs-apply b/tools/libxfs-apply index acc53815ca..4a8c8a68cb 100755 --- a/tools/libxfs-apply +++ b/tools/libxfs-apply @@ -28,6 +28,24 @@ fail() exit } +# filterdiff 0.3.4 is the first version that handles git diff metadata (almost) +# correctly. It just doesn't work properly in prior versions, so those versions +# can't be used to extract the commit message prior to the diff. Hence just +# abort and tell the user to upgrade if an old version is detected. We need to +# check against x.y.z version numbers here. +_version=`filterdiff --version | cut -d " " -f 5` +_major=`echo $_version | cut -d "." -f 1` +_minor=`echo $_version | cut -d "." -f 2` +_patch=`echo $_version | cut -d "." -f 3` +if [ $_major -eq 0 ]; then + if [ $_minor -lt 3 ]; then + fail "filterdiff $_version found. 0.3.4 or greater is required." + fi + if [ $_minor -eq 3 -a $_patch -le 3 ]; then + fail "filterdiff $_version found. 0.3.4 or greater is required." + fi +fi + # We should see repository contents we recognise, both at the source and # destination. Kernel repositorys will have fs/xfs/libxfs, and xfsprogs # repositories will have libxcmd. @@ -123,6 +141,7 @@ filter_kernel_patch() # Create the new patch filterdiff \ + --verbose \ -I $_libxfs_files \ --strip=1 \ --addoldprefix=a/fs/xfs/ \ @@ -148,6 +167,7 @@ filter_xfsprogs_patch() # Create the new patch filterdiff \ + --verbose \ -I $_libxfs_files \ --strip=3 \ --addoldprefix=a/ \ |