git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Sipek <jeffpc@josefsipek.net>
To: Per Cederqvist <cederp@opera.com>
Cc: git@vger.kernel.org
Subject: Re: [GUILT v2 16/29] Fix backslash handling when creating names of imported patches.
Date: Tue, 13 May 2014 18:09:57 -0400	[thread overview]
Message-ID: <20140513220957.GN4791@meili.valhalla.31bits.net> (raw)
In-Reply-To: <1400013065-27919-17-git-send-email-cederp@opera.com>

On Tue, May 13, 2014 at 10:30:52PM +0200, Per Cederqvist wrote:
> The 'echo %s' construct sometimes processes escape sequences.  (This

%s?  Should this be $s?

Otherwise, looks good.

> 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 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
> 

-- 
I have always wished for my computer to be as easy to use as my telephone;
my wish has come true because I can no longer figure out how to use my
telephone.
		- Bjarne Stroustrup

  reply	other threads:[~2014-05-13 22:10 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 20:30 [GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 01/29] The tests should not fail if guilt.diffstat is set Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 02/29] Allow "guilt delete -f" to run from a dir which contains spaces Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 03/29] Added test case for "guilt delete -f" Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 04/29] Allow "guilt import-commit" to run from a dir which contains spaces Per Cederqvist
2014-05-13 21:06   ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 05/29] "guilt new": Accept more than 4 arguments Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 06/29] Fix the do_get_patch function Per Cederqvist
2014-05-13 21:13   ` Jeff Sipek
2014-05-14  8:46     ` Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 07/29] Added test cases for "guilt fold" Per Cederqvist
2014-05-13 21:30   ` Jeff Sipek
2014-05-14  8:49     ` Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 08/29] Added more test cases for "guilt new": empty patches Per Cederqvist
2014-05-14 17:10   ` Jeff Sipek
2014-05-14 20:38     ` Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 09/29] Test suite: properly check the exit status of commands Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 10/29] Run test_failed if the exit status of a test script is bad Per Cederqvist
2014-05-13 21:58   ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 11/29] test suite: remove pointless redirection Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 12/29] "guilt header": more robust header selection Per Cederqvist
2014-05-15 22:46   ` Jeff Sipek
2014-05-16  9:51     ` Per Cederqvist
2014-05-16 12:55       ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 13/29] Check that "guilt header '.*'" fails Per Cederqvist
2014-05-15 22:47   ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 14/29] Use "git check-ref-format" to validate patch names Per Cederqvist
2014-05-15 23:00   ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 15/29] Produce legal patch names in guilt-import-commit Per Cederqvist
2014-05-15 23:21   ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 16/29] Fix backslash handling when creating names of imported patches Per Cederqvist
2014-05-13 22:09   ` Jeff Sipek [this message]
2014-05-14  8:56     ` Per Cederqvist
2014-05-14 13:06       ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 17/29] "guilt graph" no longer loops when no patches are applied Per Cederqvist
2014-05-13 21:53   ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 18/29] guilt-graph: Handle commas in branch names Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 19/29] Check that "guilt graph" works when working on a branch with a comma Per Cederqvist
2014-05-13 21:36   ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 20/29] "guilt graph": Handle patch names containing quotes Per Cederqvist
2014-05-13 21:49   ` Jeff Sipek
2014-05-13 20:30 ` [GUILT v2 21/29] The log.decorate setting should not influence import-commit Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 22/29] The log.decorate setting should not influence patchbomb Per Cederqvist
2014-05-13 20:30 ` [GUILT v2 23/29] The log.decorate setting should not influence guilt rebase Per Cederqvist
2014-05-13 20:31 ` [GUILT v2 24/29] disp no longer processes backslashes Per Cederqvist
2014-05-13 21:44   ` Jeff Sipek
2014-05-13 20:31 ` [GUILT v2 25/29] "guilt push" now fails when there are no more patches to push Per Cederqvist
2014-05-13 21:41   ` Jeff Sipek
2014-05-14  9:27     ` Per Cederqvist
2014-05-14 13:07       ` Jeff Sipek
2014-05-13 20:31 ` [GUILT v2 26/29] "guilt pop" now fails when there are no more patches to pop Per Cederqvist
2014-05-13 22:23   ` Jeff Sipek
2014-05-13 20:31 ` [GUILT v2 27/29] Minor testsuite fix Per Cederqvist
2014-05-13 20:31 ` [GUILT v2 28/29] Added guilt.reusebranch configuration option Per Cederqvist
2014-05-14 15:53   ` Jeff Sipek
2014-05-15  7:37     ` Per Cederqvist
2014-05-15 14:29       ` Jeff Sipek
2014-05-13 20:31 ` [GUILT v2 29/29] Added a short style guide, and Emacs settings Per Cederqvist
2014-05-13 21:00   ` Jeff Sipek
2014-05-13 20:45 ` [GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more Theodore Ts'o
2014-05-13 20:54   ` Jeff Sipek
2014-05-13 21:29     ` Per Cederqvist
2014-05-14  9:49       ` Per Cederqvist

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=20140513220957.GN4791@meili.valhalla.31bits.net \
    --to=jeffpc@josefsipek.net \
    --cc=cederp@opera.com \
    --cc=git@vger.kernel.org \
    /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 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 NNTP newsgroup(s).