From: Per Cederqvist <cederp@opera.com>
To: Jeff Sipek <jeffpc@josefsipek.net>
Cc: git@vger.kernel.org, Per Cederqvist <cederp@opera.com>
Subject: [GUILT v4 16/33] Fix backslash handling when creating names of imported patches.
Date: Sun, 18 May 2014 23:59:52 +0200 [thread overview]
Message-ID: <1400450409-30998-17-git-send-email-cederp@opera.com> (raw)
In-Reply-To: <1400450409-30998-1-git-send-email-cederp@opera.com>
The 'echo $s' construct sometimes processes escape sequences. (This
happens, for instance, under Ubuntu 14.04 when /bin/sh is actually
dash.) We don't want that to happen when we are importing commits, so
use 'printf %s "$s"' instead.
(The -E option of bash that explicitly disables backslash expansion is
not portable; it is not supported by dash.)
Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
guilt-import-commit | 2 +-
regression/t-034.out | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/guilt-import-commit b/guilt-import-commit
index 6260c56..45f2404 100755
--- a/guilt-import-commit
+++ b/guilt-import-commit
@@ -30,7 +30,7 @@ for rev in `git rev-list $rhash`; do
# Try to convert the first line of the commit message to a
# valid patch name.
- fname=`echo $s | sed -e "s/&/and/g" -e "s/[ :]/_/g" -e "s,[/\\],-,g" \
+ fname=`printf %s "$s" | sed -e "s/&/and/g" -e "s/[ :]/_/g" -e "s,[/\\],-,g" \
-e "s/['\\[{}]//g" -e 's/]//g' -e 's/\*/-/g' \
-e 's/\?/-/g' -e 's/\.\.\.*/./g' -e 's/^\.//' \
-e 's/\.patch$//' -e 's/\.$//' | tr A-Z a-z`
diff --git a/regression/t-034.out b/regression/t-034.out
index 7bc9459..bda4399 100644
--- a/regression/t-034.out
+++ b/regression/t-034.out
@@ -236,7 +236,7 @@ Date: Mon Jan 1 00:00:00 2007 +0000
About to begin conversion...
Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541
Converting 2a8b1889 as can-have-embedded-single-slashes
-Converting 0a46f8fa as backslash-isorbidden
+Converting 0a46f8fa as backslash-is-forbidden
Converting aedb74fd as x
Converting 30187ed0 as cannot@have@the@sequence@at-brace
Converting 106e8e5a as cannot_end_in_
@@ -300,7 +300,7 @@ Applying patch..cannot@have@the@sequence@at-brace.patch
Patch applied.
Applying patch..x.patch
Patch applied.
-Applying patch..backslash-isorbidden.patch
+Applying patch..backslash-is-forbidden.patch
Patch applied.
Applying patch..can-have-embedded-single-slashes.patch
Patch applied.
@@ -311,7 +311,7 @@ Date: Mon Jan 1 00:00:00 2007 +0000
Can/have/embedded/single/slashes
-commit 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 (refs/patches/master/backslash-isorbidden.patch)
+commit 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 (refs/patches/master/backslash-is-forbidden.patch)
Author: Author Name <author@email>
Date: Mon Jan 1 00:00:00 2007 +0000
@@ -518,8 +518,6 @@ d .git/patches/master
d .git/refs/patches
d .git/refs/patches/master
f 06beca7069b9e576bd431f65d13862ed5d3e2a0f .git/patches/master/ctrlisforbidden.patch
-f 08267ec6783ea9d1adae55b275198f7594764ed0 .git/patches/master/series
-f 08267ec6783ea9d1adae55b275198f7594764ed0 .git/patches/master/status
f 09b7e9be44ae5ec3a4bb30f5ee9d4ebc2c042f64 .git/patches/master/two_consecutive_dots_(.)_is_forbidden.patch
f 0b971c9a17aeca2319c93d700ffd98acc2a93451 .git/patches/master/question-mark-is-forbidden.patch
f 2b8392f63d61efc12add554555adae30883993cc .git/patches/master/cannot-end-in-slash-.patch
@@ -529,7 +527,7 @@ f 34e07c584032df137f19bdb66d93f316f00a5ac8 .git/patches/master/tildeisforbidden
f 49bab499826b63deb2bd704629d60c7268c57aee .git/patches/master/the_sequence_-._is_forbidden.patch
f 5bcddb8ccb6e6e5e8a61e9e56cb2e0f70cbab2f5 .git/patches/master/cannot@have@the@sequence@at-brace.patch
f 637b982fe14a240de181ae63226b27e0c406b3dc .git/patches/master/asterisk-is-forbidden.patch
-f 698f8a7d41a64e3b6be1a3eba86574078b22a5f3 .git/patches/master/backslash-isorbidden.patch
+f 698f8a7d41a64e3b6be1a3eba86574078b22a5f3 .git/patches/master/backslash-is-forbidden.patch
f 7b103c3c7ae298cd2334f6f49da48bae1424f77b .git/patches/master/crisalsoforbidden.patch
f 9b810b8c63779c51d2e7f61ab59cd49835041563 .git/patches/master/x.patch
f a22958d9ae9976fd7b2b5a9d0bcd44bf7ad9b08a .git/patches/master/caretisforbidden.patch
@@ -537,6 +535,8 @@ f ab325bf5a432937fc6f231d3e8a773a62d53952b .git/patches/master/multiple-slashes
f cb9cffbd4465bddee266c20ccebd14eb687eaa89 .git/patches/master/delisforbidden.patch
f d0885a1a1fdee0fd1e4fedce3f7acd3100540bc4 .git/patches/master/openbracketisforbidden.patch
f d2903523fb66a346596eabbdd1bda4e52b266440 .git/patches/master/check-multiple-.-dots-.-foo.patch
+f da90de1c84138194524994e0bc3bc4ca8189c999 .git/patches/master/series
+f da90de1c84138194524994e0bc3bc4ca8189c999 .git/patches/master/status
f dfc11f76394059909671af036598c5fbe33001ba .git/patches/master/space_is_forbidden.patch
f e47474c52d6c893f36d0457f885a6dd1267742bb .git/patches/master/colon_is_forbidden.patch
f e7a5f8912592d9891e6159f5827c8b4f372cc406 .git/patches/master/the_sequence_.lock-_is_forbidden.patch
@@ -548,7 +548,7 @@ r 1626a11d979a1e9e775c766484172212277153df .git/refs/patches/master/asterisk-is
r 3a0d5ccef0359004fcaa9cee98fbd6a2c4432e74 .git/refs/patches/master/tildeisforbidden.patch
r 434e07cacdd8e7eb4723e67cb2d100b3a4121a3a .git/refs/patches/master/can-have-embedded-single-slashes.patch
r 74df14ab3a0ec9a0382998fbf167ebb1b0a36c6a .git/refs/patches/master/question-mark-is-forbidden.patch
-r 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 .git/refs/patches/master/backslash-isorbidden.patch
+r 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 .git/refs/patches/master/backslash-is-forbidden.patch
r 96a3e92c4df85f52362ce4f6d31983c462db9ae9 .git/refs/patches/master/a-component-may-not-end-in-foolock.patch
r 9fc9677b61880f9159838e89f714893e0a2fcafb .git/refs/patches/master/delisforbidden.patch
r a275ed5d7f10ea88c986852ee95a7d5a61663b5f .git/refs/patches/master/cannot@have@the@sequence@at-brace.patch
--
1.8.3.1
next prev parent reply other threads:[~2014-05-18 22:07 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 01/33] The tests should not fail if guilt.diffstat is set Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 02/33] Allow "guilt delete -f" to run from a dir which contains spaces Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 03/33] Added test case for "guilt delete -f" Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 04/33] Allow "guilt import-commit" to run from a dir which contains spaces Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 05/33] "guilt new": Accept more than 4 arguments Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 06/33] Fix the do_get_patch function Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 07/33] Added test cases for "guilt fold" Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 08/33] Added more test cases for "guilt new": empty patches Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 09/33] Test suite: properly check the exit status of commands Per Cederqvist
2015-01-22 14:27 ` Jeff Sipek
2014-05-18 21:59 ` [GUILT v4 10/33] Run test_failed if the exit status of a test script is bad Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 11/33] test suite: remove pointless redirection Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 12/33] "guilt header": more robust header selection Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 13/33] Check that "guilt header '.*'" fails Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 14/33] Use "git check-ref-format" to validate patch names Per Cederqvist
2015-01-22 14:18 ` Jeff Sipek
2014-05-18 21:59 ` [GUILT v4 15/33] Produce legal patch names in guilt-import-commit Per Cederqvist
2015-01-22 14:15 ` Jeff Sipek
2015-01-22 15:50 ` Per Cederqvist
2014-05-18 21:59 ` Per Cederqvist [this message]
2014-05-18 21:59 ` [GUILT v4 17/33] "guilt graph" no longer loops when no patches are applied Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 18/33] guilt-graph: Handle commas in branch names Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 19/33] Check that "guilt graph" works when working on a branch with a comma Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 20/33] "guilt graph": Handle patch names containing quotes Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 21/33] The log.decorate setting should not influence import-commit Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 22/33] The log.decorate setting should not influence patchbomb Per Cederqvist
2014-05-18 21:59 ` [GUILT v4 23/33] The log.decorate setting should not influence guilt rebase Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 24/33] disp no longer processes backslashes Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 25/33] "guilt push" now fails when there are no more patches to push Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 26/33] "guilt pop" now fails when there are no more patches to pop Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 27/33] Minor testsuite fix Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 28/33] Fix coding style errors in t-061.sh Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 29/33] Added guilt.reusebranch configuration option Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 30/33] Added a short style guide, and Emacs settings Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 31/33] Don't use "git log -p" in the test suite Per Cederqvist
2014-05-18 22:00 ` [GUILT v4 32/33] Improved doc and tests for guilt header Per Cederqvist
2015-01-22 13:56 ` Jeff Sipek
2014-05-18 22:00 ` [GUILT v4 33/33] Document the exit status of guilt push and guilt pop Per Cederqvist
2015-01-22 14:31 ` Jeff Sipek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400450409-30998-17-git-send-email-cederp@opera.com \
--to=cederp@opera.com \
--cc=git@vger.kernel.org \
--cc=jeffpc@josefsipek.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).