diff options
author | Eric Sandeen <sandeen@redhat.com> | 2018-03-08 20:35:22 -0600 |
---|---|---|
committer | Eric Sandeen <sandeen@redhat.com> | 2018-03-08 20:35:22 -0600 |
commit | f50eb2c32b50c9bc4913f2374869380c5969573c (patch) | |
tree | 01f754d0595c430a6d1b297c888ad96843cd2fcc | |
parent | 2ce8bff527b559cb0257042c99f4e51efb877132 (diff) | |
download | xfsprogs-dev-f50eb2c32b50c9bc4913f2374869380c5969573c.tar.gz |
xfsprogs: new libxfs-apply option for Signed-off-by: tag
Technically when a maintainer moves a patch from another project,
they should add their Signed-off-by: tag. Get that info automatically
from git-config, and add an option to to override it if desired,
to make that easy when cross-porting libxfs patches
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rwxr-xr-x | tools/libxfs-apply | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/libxfs-apply b/tools/libxfs-apply index e7d7e0abcb..fe07e45eb4 100755 --- a/tools/libxfs-apply +++ b/tools/libxfs-apply @@ -8,7 +8,7 @@ usage() echo $* echo echo "Usage:" - echo " libxfs-apply [--verbose] --source <repodir> --commit <commit_id>" + echo " libxfs-apply [--verbose] --sob <name/email> --source <repodir> --commit <commit_id>" echo " libxfs-apply --patch <patchfile>" echo echo "libxfs-apply should be run in the destination git repository." @@ -73,6 +73,7 @@ while [ $# -gt 0 ]; do --source) REPO=$2 ; shift ;; --patch) PATCH=$2; shift ;; --commit) COMMIT_ID=$2 ; shift ;; + --sob) SIGNED_OFF_BY=$2 ; shift ;; --verbose) VERBOSE=true ;; *) usage ;; esac @@ -274,6 +275,20 @@ fixup_header_format() print $0 }' > $_hdr.new + # Remove the last line if it contains only whitespace + sed -i '${/^[[:space:]]*$/d;}' $_hdr.new + + # Add Signed-off-by: header if specified + if [ ! -z ${SIGNED_OFF_BY+x} ]; then + echo "Signed-off-by: $SIGNED_OFF_BY" >> $_hdr.new + else # get it from git config if present + SOB_NAME=`git config --get user.name` + SOB_EMAIL=`git config --get user.email` + if [ ! -z ${SOB_NAME+x} ]; then + echo "Signed-off-by: $SOB_NAME <$SOB_EMAIL>" >> $_hdr.new + fi + fi + # now output the new patch cat $_hdr.new $_diff |