All of lore.kernel.org
 help / color / mirror / Atom feed
From: Per Cederqvist <cederp@opera.com>
To: Jeff Sipek <jeffpc@josefsipek.net>
Cc: git@vger.kernel.org, Per Cederqvist <cederp@opera.com>
Subject: [GUILT 16/28] Fix backslash handling when creating names of imported patches.
Date: Fri, 21 Mar 2014 08:31:54 +0100	[thread overview]
Message-ID: <1395387126-13681-17-git-send-email-cederp@opera.com> (raw)
In-Reply-To: <1395387126-13681-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>
---
 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 a4119d6..6eb2f4e 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

  parent reply	other threads:[~2014-03-21  7:34 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21  7:31 [GUILT 00/28] Teach guilt import-commit how create legal patch names, and more Per Cederqvist
2014-03-21  7:31 ` [GUILT 01/28] The tests should not fail if guilt.diffstat is set Per Cederqvist
2014-03-21  7:31 ` [GUILT 02/28] Allow "guilt delete -f" to run from a dir which contains spaces Per Cederqvist
2014-03-21  7:31 ` [GUILT 03/28] Added test case for "guilt delete -f" Per Cederqvist
2014-03-21  7:31 ` [GUILT 04/28] Allow "guilt import-commit" to run from a dir which contains spaces Per Cederqvist
2014-03-23 17:04   ` Jeff Sipek
2014-03-23 19:57     ` Per Cederqvist
2014-03-23 20:07       ` Jeff Sipek
2014-03-23 21:13         ` Per Cederqvist
2014-05-06 18:27           ` Jeff Sipek
2014-03-21  7:31 ` [GUILT 05/28] "guilt new": Accept more than 4 arguments Per Cederqvist
2014-03-21  7:31 ` [GUILT 06/28] Fix and simplify the do_get_patch function Per Cederqvist
2014-03-23 17:09   ` Jeff Sipek
2014-03-23 21:03     ` Per Cederqvist
2014-05-06 19:08       ` Jeff Sipek
2014-05-07 20:44         ` Per Cederqvist
2014-03-21  7:31 ` [GUILT 07/28] Added test cases for "guilt fold" Per Cederqvist
2014-05-06 19:40   ` Jeff Sipek
2014-05-07 20:59     ` Per Cederqvist
2014-05-07 21:06       ` Jeff Sipek
2014-05-08 19:41         ` Per Cederqvist
2014-05-08 19:59           ` Jeff Sipek
2014-03-21  7:31 ` [GUILT 08/28] Added more test cases for "guilt new": empty patches Per Cederqvist
2014-03-21  7:31 ` [GUILT 09/28] Test suite: properly check the exit status of commands Per Cederqvist
2014-03-21  7:31 ` [GUILT 10/28] Run test_failed if the exit status of a test script is bad Per Cederqvist
2014-05-06 19:56   ` Jeff Sipek
2014-03-21  7:31 ` [GUILT 11/28] test suite: remove pointless redirection Per Cederqvist
2014-05-06 19:57   ` Jeff Sipek
2014-03-21  7:31 ` [GUILT 12/28] "guilt header": more robust header selection Per Cederqvist
2014-03-21  7:31 ` [GUILT 13/28] Check that "guilt header '.*'" fails Per Cederqvist
2014-03-21  7:31 ` [GUILT 14/28] Use "git check-ref-format" to validate patch names Per Cederqvist
2014-03-21  7:31 ` [GUILT 15/28] Produce legal patch names in guilt-import-commit Per Cederqvist
2014-03-21  7:31 ` Per Cederqvist [this message]
2014-03-21  7:31 ` [GUILT 17/28] "guilt graph" no longer loops when no patches are applied Per Cederqvist
2014-05-06 20:10   ` Jeff Sipek
2014-03-21  7:31 ` [GUILT 18/28] guilt-graph: Handle commas in branch names Per Cederqvist
2014-05-06 20:13   ` Jeff Sipek
2014-03-21  7:31 ` [GUILT 19/28] Check that "guilt graph" works when working on a branch with a comma Per Cederqvist
2014-05-06 20:15   ` Jeff Sipek
2014-05-13 21:33   ` Jeff Sipek
2014-05-13 21:35     ` Jeff Sipek
2014-03-21  7:31 ` [GUILT 20/28] "guilt graph": Handle patch names containing quotes Per Cederqvist
2014-03-21  7:57   ` Eric Sunshine
2014-05-06 20:24     ` Jeff Sipek
2014-05-08 20:18       ` Per Cederqvist
2014-03-21  7:31 ` [GUILT 21/28] The log.decorate setting should not influence import-commit Per Cederqvist
2014-05-06 20:41   ` Jeff Sipek
2014-03-21  7:32 ` [GUILT 22/28] The log.decorate setting should not influence patchbomb Per Cederqvist
2014-05-06 20:41   ` Jeff Sipek
2014-03-21  7:32 ` [GUILT 23/28] The log.decorate setting should not influence guilt rebase Per Cederqvist
2014-05-06 20:41   ` Jeff Sipek
2014-03-21  7:32 ` [GUILT 24/28] disp no longer processes backslashes Per Cederqvist
2014-05-07 21:15   ` Jeff Sipek
2014-03-21  7:32 ` [GUILT 25/28] "guilt push" now fails when there are no more patches to push Per Cederqvist
2014-05-07 22:04   ` Jeff Sipek
2014-05-08 21:37     ` Per Cederqvist
2014-03-21  7:32 ` [GUILT 26/28] "guilt pop" now fails when there are no more patches to pop Per Cederqvist
2014-03-21  7:32 ` [GUILT 27/28] Minor testsuite fix Per Cederqvist
2014-05-07 21:09   ` Jeff Sipek
2014-03-21  7:32 ` [GUILT 28/28] Added guilt.reusebranch configuration option Per Cederqvist
2014-03-21 20:39 ` [GUILT 00/28] Teach guilt import-commit how create legal patch names, and more 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395387126-13681-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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.