$ mkdir patches

$ quilt new test.diff
> Patch %{P}test.diff is now on top

$ echo foo > foo
$ quilt add foo
> File foo added to patch %{P}test.diff

$ quilt files
> foo
$ quilt patches foo
> %{P}test.diff
$ quilt patches "foo bar"

$ echo foo > "foo bar"
$ quilt add "foo bar"
> File foo bar added to patch %{P}test.diff

$ quilt files
> foo
> foo bar
$ quilt patches "foo bar"
> %{P}test.diff
$ quilt patches bar
$ quilt patches "foo bar baz"

$ quilt add "a: b [c]"
> File a: b [c] added to patch %{P}test.diff

$ quilt files
> a: b [c]
> foo
> foo bar
$ quilt patches 'a: b [c]'
> %{P}test.diff
$ quilt patches a
$ quilt patches b
$ quilt patches 'a: b c'

$ echo bar > "foo bar"
$ echo "new line" > "a: b [c]"
$ quilt diff -p ab
> Index: b/a: b [c]
> ===================================================================
> --- /dev/null
> +++ b/a: b [c]
> @@ -0,0 +1 @@
> +new line
> Index: b/foo bar
> ===================================================================
> --- a/foo bar
> +++ b/foo bar
> @@ -1 +1 @@
> -foo
> +bar

$ quilt refresh -p ab
> Refreshed patch %{P}test.diff
$ cat patches/test.diff
> Index: b/a: b [c]
> ===================================================================
> --- /dev/null
> +++ b/a: b [c]
> @@ -0,0 +1 @@
> +new line
> Index: b/foo bar
> ===================================================================
> --- a/foo bar
> +++ b/foo bar
> @@ -1 +1 @@
> -foo
> +bar

$ quilt refresh -p ab --sort
> Patch %{P}test.diff is unchanged
$ cat patches/test.diff
> Index: b/a: b [c]
> ===================================================================
> --- /dev/null
> +++ b/a: b [c]
> @@ -0,0 +1 @@
> +new line
> Index: b/foo bar
> ===================================================================
> --- a/foo bar
> +++ b/foo bar
> @@ -1 +1 @@
> -foo
> +bar

$ quilt grep bar
> foo bar:bar
$ quilt grep new
> a: b [c]:new line
$ quilt grep " "
> a: b [c]:new line

$ quilt remove "a: b [c]"
> File a: b [c] removed from patch %{P}test.diff

$ quilt files
> foo
> foo bar

$ quilt remove "foo bar"
> File foo bar removed from patch %{P}test.diff

$ quilt files
> foo
