--- oslo-series-final/0015-Produce-legal-patch-names-in-guilt-import-commit.patch +++ oslo-series-v2/v2-0015-Produce-legal-patch-names-in-guilt-import-commit.patch @@ -1,7 +1,7 @@ -From 61d0951eda5e03c8717da21aabe574a4c40e69f9 Mon Sep 17 00:00:00 2001 +From 64c47b9855c2ad2523dd6efb0e6ddcc04c8c2222 Mon Sep 17 00:00:00 2001 From: Per Cederqvist -Date: Wed, 19 Mar 2014 21:43:01 +0100 -Subject: [GUILT 15/28] Produce legal patch names in guilt-import-commit. +Date: Tue, 13 May 2014 21:03:55 +0200 +Subject: [GUILT v2 15/29] Produce legal patch names in guilt-import-commit. To: Jeff Sipek Cc: git@vger.kernel.org @@ -17,10 +17,10 @@ Signed-off-by: Per Cederqvist --- - guilt-import-commit | 22 +- + guilt-import-commit | 20 +- regression/t-034.out | 567 +++++++++++++++++++++++++++++++++++++++++++++++++++ - regression/t-034.sh | 72 +++++++ - 3 files changed, 659 insertions(+), 2 deletions(-) + regression/t-034.sh | 71 +++++++ + 3 files changed, 656 insertions(+), 2 deletions(-) create mode 100644 regression/t-034.out create mode 100755 regression/t-034.sh diff --git a/guilt-import-commit b/guilt-import-commit index 9488ded..a4119d6 100755 --- a/guilt-import-commit +++ b/guilt-import-commit - @@ -28,19 +28,37 @@ disp "Current head: `cat \"$GIT_DIR\"/refs/heads/\`git_branch\``" >&2 + @@ -28,19 +28,35 @@ disp "Current head: `git rev-parse \`git_branch\``" >&2 for rev in `git rev-list $rhash`; do s=`git log --pretty=oneline -1 $rev | cut -c 42-` [...] + -e 's/\?/-/g' -e 's/\.\.\.*/./g' -e 's/^\.//' \ + -e 's/\.patch$//' -e 's/\.$//' | tr A-Z a-z` + - + if ! valid_patchname "$fname" - + then + + if ! valid_patchname "$fname"; then + # Try harder to make it a legal commit name by + # removing all but a few safe characters. + fname=`echo $fname|tr -d -c _a-zA-Z0-9---/\\n` + fi - + if ! valid_patchname "$fname" - + then + + if ! valid_patchname "$fname"; then + # If we failed to derive a legal patch name, use the + # name "x". (If this happens, we likely have to + # append a suffix to make the name unique.) [...] ( do_make_header $rev diff --git a/regression/t-034.sh b/regression/t-034.sh new file mode 100755 index 0000000..1055ddb --- /dev/null +++ b/regression/t-034.sh - @@ -0,0 +1,72 @@ + @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Test import-commit [...] + +b() +{ - + printf "%b" "$1" + + printf "%b" "$1" +} + +cmd setup_git_repo [...] +cmd guilt init +cmd guilt import-commit base..HEAD + - +for patch in .git/patches/master/*.patch - +do + +for patch in .git/patches/master/*.patch; do + touch -a -m -t "$TOUCH_DATE" "$patch" +done + [...] +cmd list_files +cmd guilt pop -a --