All of lore.kernel.org
 help / color / mirror / Atom feed
* [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more
@ 2014-05-18 21:59 Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 01/33] The tests should not fail if guilt.diffstat is set Per Cederqvist
                   ` (32 more replies)
  0 siblings, 33 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

This is version 4 of the patch series I sent back on 21 Mar 2014.  I
have addressed all feedback to date, update the documentation where
needed, improved the error handling in the "cmd" and "shouldfail"
functions in the test suite, fixed compatibility with older Git
versions, and added signed-off-by lines from Jeff Sipek for those
commits that I have received an explicit approval from him (but only
if I have not made any other change to that particular commit).

I have added two new patches:

* Patch 32/33 adds documentation and test cases for the new regexp
functionality of "guilt header".  This could be folded into patch 12.

* Patch 33/33 adds documentation for the exit value of "guilt push"
and "guilt pop".  This could be folded into patches 25-26.

To see how the patches have evolved, you might find
http://www.lysator.liu.se/~ceder/guilt-oslo-2014-v4/ useful.  It
displays diffs of all the patches between v3 and v4, in pdiffdiff
output format.

Here is the original blurb for the series, slightly edited:

I recently found myself sitting on a train with a computer in front of
me.  I tried to use "guilt import-commit", which seemed to work, but
when I tried to "guilt push" the commits I had just imported I got
some errors.  It turned out that "guilt import-commit" had generated
invalid patch names.

I decided to fix the issue, and write a test case that demonstrated
the problem.

One thing led to another, and here I am, a few late nights at a hotel
and a return trip on the train later, submitting a patch series in 28
parts.  Sorry about the number of patches, but this is what happens
when you uncover a bug while writing a test case for the bug you
uncovered while writing a test case for your original problem.

The patch series consists of:

 - A number of fixes to the test suite.

 - A number of bug fixes which I hope are non-controversial.  Most of
   the fixes have test cases.

 - Changed behavior: "guilt push" when there is nothing more to push
   now uses exit status 1.  This makes it possible to write shell
   loops such as "while guilt push; do make test||break; done".  Also,
   "guilt pop" when no patches are applied also uses exit status 1.
   (This aligns "guilt push" and "guilt pop" with how "hg qpush" and
   "hg qpop" has worked for several years.)

 - Changed behavior: by default, guilt no longer changes branch when
   you push a patch.  You need to do "git config guilt.reusebranch
   false" to re-enable that.  This patch sets the default value of
   guilt.reusebranch to true; it should in my opinion change to false
   a year or two after the next release.

 - The humble beginnings of a coding style guide.

A more detailed overview of the patches:

1. Some tests fail if "git config guilt.diffstat true" is in effect.

2-4. Some commands fail if run from a directory with spaces in its
     name.

5. "guilt new" had an overly restrictive argument parser.

6-8. guilt.diffstat could break "guilt fold" and "guilt new".

9-10. The test suite did not test exit status properly.

11. Remove pointless redirections in the test suite.

12-13. "guilt header" tried to check if a patch existed, but the check
        was broken.

14-16. Various parts of guilt tried to ensure that patch names were
       legal git branch names, but failed.

17-20. "guilt graph" failed when no patch was applied, and when a
       branch name contained a comma or a quote.

21-23. "git config log.decorate short" caused "guilt import-commit",
       "guilt patchbomb" and "guilt rebase" to fail in various ways.

24. Patches may contain backslashes, but various informative messages
    from guilt did backslash processing.

25-26. "guilt push" and "guilt pop" should fail when there is nothing
       to do.

28. Fix coding style problems in a test case.

27, 29. These two commits were things I intended to contribute a while
       back, when contributing the "Change git branch when patches are
       applied" change (commit 67d3af63f422).  These commits makes
       that behavior optional, and it defaults to being disabled, so
       that you can use both Guilt v0.35 (and earlier) and the current
       Guilt code against the same repo.  These commits add some code
       complexity, and you might want to skip them if you think the
       current behavior is better.

30. A coding style guide, with Emacs support.

31. Avoid using "git log -p".

32. Test case + doc for "guilt header".

33. Doc for "guilt push" and "guilt pop."

This patch series is also available on
http://repo.or.cz/w/guilt/ceder.git in the "oslo-2014-v4" branch.  If
you already have a copy of guilt, you should be able to fetch that
branch with something like:

    git remote add ceder http://repo.or.cz/r/guilt/ceder.git
    git fetch ceder refs/heads/oslo-2014-v4:refs/remotes/ceder/oslo-2014-v4

A few of the regression/t-*.out files contain non-ASCII characters.  I
hope they survive the mail transfer; if not, please use the repo above
to fetch the commits.

Per Cederqvist (33):
  The tests should not fail if guilt.diffstat is set.
  Allow "guilt delete -f" to run from a dir which contains spaces.
  Added test case for "guilt delete -f".
  Allow "guilt import-commit" to run from a dir which contains spaces.
  "guilt new": Accept more than 4 arguments.
  Fix the do_get_patch function.
  Added test cases for "guilt fold".
  Added more test cases for "guilt new": empty patches.
  Test suite: properly check the exit status of commands.
  Run test_failed if the exit status of a test script is bad.
  test suite: remove pointless redirection.
  "guilt header": more robust header selection.
  Check that "guilt header '.*'" fails.
  Use "git check-ref-format" to validate patch names.
  Produce legal patch names in guilt-import-commit.
  Fix backslash handling when creating names of imported patches.
  "guilt graph" no longer loops when no patches are applied.
  guilt-graph: Handle commas in branch names.
  Check that "guilt graph" works when working on a branch with a comma.
  "guilt graph": Handle patch names containing quotes.
  The log.decorate setting should not influence import-commit.
  The log.decorate setting should not influence patchbomb.
  The log.decorate setting should not influence guilt rebase.
  disp no longer processes backslashes.
  "guilt push" now fails when there are no more patches to push.
  "guilt pop" now fails when there are no more patches to pop.
  Minor testsuite fix.
  Fix coding style errors in t-061.sh.
  Added guilt.reusebranch configuration option.
  Added a short style guide, and Emacs settings.
  Don't use "git log -p" in the test suite.
  Improved doc and tests for guilt header.
  Document the exit status of guilt push and guilt pop.

 .dir-locals.el                 |   3 +
 Documentation/Contributing     |  15 +
 Documentation/guilt-header.txt |   5 +-
 Documentation/guilt-pop.txt    |   3 +
 Documentation/guilt-push.txt   |   3 +
 guilt                          |  89 +++-
 guilt-delete                   |   2 +-
 guilt-fork                     |   2 +-
 guilt-graph                    |  13 +-
 guilt-header                   |  29 +-
 guilt-import                   |   2 +-
 guilt-import-commit            |  30 +-
 guilt-new                      |   9 +-
 guilt-patchbomb                |   2 +-
 guilt-pop                      |  17 +-
 guilt-push                     |  19 +-
 guilt-rebase                   |   2 +-
 regression/run-tests           |  10 +-
 regression/scaffold            |  25 +-
 regression/t-020.out           | 924 +++++++----------------------------------
 regression/t-020.sh            |  73 +++-
 regression/t-021.out           | 901 +---------------------------------------
 regression/t-021.sh            |  18 +-
 regression/t-025.out           | 426 ++++++++++++++++++-
 regression/t-025.sh            |  14 +-
 regression/t-026.out           |  15 +
 regression/t-026.sh            |   5 +-
 regression/t-028.out           |  16 +
 regression/t-028.sh            |   9 +-
 regression/t-032.out           |   4 +-
 regression/t-032.sh            |   2 +-
 regression/t-033.out           |  90 ++++
 regression/t-033.sh            |  61 +++
 regression/t-034.out           | 569 +++++++++++++++++++++++++
 regression/t-034.sh            |  73 ++++
 regression/t-035.out           | 467 +++++++++++++++++++++
 regression/t-035.sh            |  61 +++
 regression/t-061.out           |   1 -
 regression/t-061.sh            |  12 +-
 regression/t-062.out           | 420 +++++++++++++++++++
 regression/t-062.sh            | 130 ++++++
 41 files changed, 2800 insertions(+), 1771 deletions(-)
 create mode 100644 .dir-locals.el
 create mode 100644 regression/t-033.out
 create mode 100755 regression/t-033.sh
 create mode 100644 regression/t-034.out
 create mode 100755 regression/t-034.sh
 create mode 100644 regression/t-035.out
 create mode 100755 regression/t-035.sh
 create mode 100644 regression/t-062.out
 create mode 100755 regression/t-062.sh

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GUILT v4 01/33] The tests should not fail if guilt.diffstat is set.
  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 ` 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
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Explicitly set guilt.diffstat to its default value.  Without this, the
027 test (and possibly others) fail if guilt.diffstat is set to true
in ~/.gitconfig.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/scaffold | 1 +
 1 file changed, 1 insertion(+)

diff --git a/regression/scaffold b/regression/scaffold
index 546d8c6..5c8b73e 100644
--- a/regression/scaffold
+++ b/regression/scaffold
@@ -87,6 +87,7 @@ function setup_git_repo
 	# Explicitly set config that the tests rely on.
 	git config log.date default
 	git config log.decorate no
+	git config guilt.diffstat false
 }
 
 function setup_guilt_repo
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 02/33] Allow "guilt delete -f" to run from a dir which contains spaces.
  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 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 03/33] Added test case for "guilt delete -f" Per Cederqvist
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-delete | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guilt-delete b/guilt-delete
index 3e394f8..967ac10 100755
--- a/guilt-delete
+++ b/guilt-delete
@@ -49,7 +49,7 @@ series_remove_patch "$patch"
 
 guilt_hook "delete" "$patch"
 
-[ ! -z "$force" ] && rm -f $GUILT_DIR/$branch/$patch
+[ ! -z "$force" ] && rm -f "$GUILT_DIR/$branch/$patch"
 
 exit 0
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 03/33] Added test case for "guilt delete -f".
  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 ` 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
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Ensure that the file really is deleted.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-026.out | 15 +++++++++++++++
 regression/t-026.sh  |  5 ++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/regression/t-026.out b/regression/t-026.out
index 3b9fb14..be50b48 100644
--- a/regression/t-026.out
+++ b/regression/t-026.out
@@ -29,3 +29,18 @@ f 7848194fd2e9ee0eb6589482900687d799d60a12  .git/patches/master/series
 f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+% guilt new delete-me
+% guilt pop
+All patches popped.
+% guilt delete -f delete-me
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7848194fd2e9ee0eb6589482900687d799d60a12  .git/patches/master/series
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
diff --git a/regression/t-026.sh b/regression/t-026.sh
index 0ccdf85..e25d0df 100755
--- a/regression/t-026.sh
+++ b/regression/t-026.sh
@@ -20,4 +20,7 @@ cmd guilt delete add
 
 cmd list_files
 
-# FIXME: test delete -f
+cmd guilt new delete-me
+cmd guilt pop
+cmd guilt delete -f delete-me
+cmd list_files
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 04/33] Allow "guilt import-commit" to run from a dir which contains spaces.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (2 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 03/33] Added test case for "guilt delete -f" Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 05/33] "guilt new": Accept more than 4 arguments Per Cederqvist
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-import-commit | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/guilt-import-commit b/guilt-import-commit
index 20dcee2..f14647c 100755
--- a/guilt-import-commit
+++ b/guilt-import-commit
@@ -23,7 +23,7 @@ if ! must_commit_first; then
 fi
 
 disp "About to begin conversion..." >&2
-disp "Current head: `cat $GIT_DIR/refs/heads/\`git_branch\``" >&2
+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-`
@@ -46,7 +46,7 @@ for rev in `git rev-list $rhash`; do
 		do_make_header $rev
 		echo ""
 		git diff --binary $rev^..$rev
-	) > $GUILT_DIR/$branch/$fname
+	) > "$GUILT_DIR/$branch/$fname"
 
 	# FIXME: grab the GIT_AUTHOR_DATE from the commit object and set the
 	# timestamp on the patch
@@ -68,6 +68,6 @@ for rev in `git rev-list $rhash`; do
 done
 
 disp "Done." >&2
-disp "Current head: `cat $GIT_DIR/refs/heads/\`git_branch\``" >&2
+disp "Current head: `git rev-parse \`git_branch\``" >&2
 
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 05/33] "guilt new": Accept more than 4 arguments.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (3 preceding siblings ...)
  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 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 06/33] Fix the do_get_patch function Per Cederqvist
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

The argument parser arbitrarily refused to accept more than 4
arguments.  That made it impossible to run "guilt new -f -s -m msg
patch".  Removed the checks for the number of arguments from the
"guilt new" parser -- the other checks that are already there are
enough to catch all errors.

Give a better error message if "-m" isn't followed by a message
argument.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-new | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/guilt-new b/guilt-new
index bb68924..9528438 100755
--- a/guilt-new
+++ b/guilt-new
@@ -11,10 +11,6 @@ fi
 
 _main() {
 
-if [ $# -lt 1 ] || [ $# -gt 4 ]; then
-	usage
-fi
-
 while [ $# -gt 0 ] ; do
 	case "$1" in
 		-f)
@@ -31,6 +27,9 @@ while [ $# -gt 0 ] ; do
 			fi
 			;;
 		-m)
+			if [ $# -eq 1 ]; then
+				usage
+			fi
 			msg="$2"
 			shift
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 06/33] Fix the do_get_patch function.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (4 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 05/33] "guilt new": Accept more than 4 arguments Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 07/33] Added test cases for "guilt fold" Per Cederqvist
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

A patch file consists of:

(1) the description
(2) optional diffstat
(3) the patches

When extracting the patch, we only want part 3.  The do_get_patch used
to give us part 2 and part 3.  That made for instance this series of
operations fail if guilt.diffstat is true:

    $ guilt new empty-1
    $ guilt new empty-2
    $ guilt pop
    Now at empty-1
    $ guilt fold empty-2
    $ guilt pop
    All patches popped.
    $ guilt push
    Applying patch..empty-1
    fatal: unrecognized input
    To force apply this patch, use 'guilt push -f'

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guilt b/guilt
index 8701481..3fc524e 100755
--- a/guilt
+++ b/guilt
@@ -334,7 +334,7 @@ do_get_patch()
 {
 	awk '
 BEGIN{}
-/^(diff |---$|--- )/ {patch = 1}
+/^(diff |--- )/ {patch = 1}
 patch == 1 {print $0}
 END{}
 ' < "$1"
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 07/33] Added test cases for "guilt fold".
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (5 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 06/33] Fix the do_get_patch function Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 08/33] Added more test cases for "guilt new": empty patches Per Cederqvist
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Test that we can combine any combination of patches with empty and
non-empty messages, both with and without guilt.diffstat.  (All
patches are empty.)

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-035.out | 467 +++++++++++++++++++++++++++++++++++++++++++++++++++
 regression/t-035.sh  |  61 +++++++
 2 files changed, 528 insertions(+)
 create mode 100644 regression/t-035.out
 create mode 100755 regression/t-035.sh

diff --git a/regression/t-035.out b/regression/t-035.out
new file mode 100644
index 0000000..cc16fb4
--- /dev/null
+++ b/regression/t-035.out
@@ -0,0 +1,467 @@
+% setup_repo
+% git config guilt.diffstat true
+%% empty + empty (diffstat=true)
+% guilt new empty-1
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty-1
+Patch applied.
+% guilt new empty-2
+% guilt pop
+Now at empty-1.
+% guilt push
+Applying patch..empty-2
+Patch applied.
+% guilt pop
+Now at empty-1.
+% guilt fold empty-2
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty-1
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 4ea806e306f0228a8ef41f186035e7b04097f1f2  .git/patches/master/status
+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty-1
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f d28d87b88c1e24d637e390dc3603cfa7c1715711  .git/patches/master/series
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+r bde3d337af70f36836ad606c800d194006f883b3  .git/refs/patches/master/empty-1
+% guilt pop
+All patches popped.
+% guilt delete -f empty-1
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+%% empty + nonempty (diffstat=true)
+% guilt new empty
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty
+Patch applied.
+% guilt new -f -s -m A commit message. nonempty
+% guilt pop
+Now at empty.
+% guilt push
+Applying patch..nonempty
+Patch applied.
+% guilt pop
+Now at empty.
+% guilt fold nonempty
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 15aab0fd8b937eb3bb01841693f35dcb75da2faf  .git/patches/master/status
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty~
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 683678040eef9334d6329e00d5b9babda3e65b57  .git/patches/master/empty
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f a26a22287b500a2a372e42c2bab03599bbe37cdf  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/empty
+% guilt pop
+All patches popped.
+% guilt delete -f empty
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty~
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+%% nonempty + empty (diffstat=true)
+% guilt new -f -s -m A commit message. nonempty
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..nonempty
+Patch applied.
+% guilt new empty
+% guilt pop
+Now at nonempty.
+% guilt push
+Applying patch..empty
+Patch applied.
+% guilt pop
+Now at nonempty.
+% guilt fold empty
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..nonempty
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 683678040eef9334d6329e00d5b9babda3e65b57  .git/patches/master/nonempty
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f c47ddc01337e3bb67a9968a8823a5ba12be67f77  .git/patches/master/series
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+f f7f068d44bf796d0f7cd14d27d1f48d6e659816a  .git/patches/master/status
+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/nonempty
+% guilt pop
+All patches popped.
+% guilt delete -f nonempty
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+%% nonempty + nonempty (diffstat=true)
+% guilt new -f -s -m A commit message. nonempty-1
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..nonempty-1
+Patch applied.
+% guilt new -f -s -m Another commit message. nonempty-2
+% guilt pop
+Now at nonempty-1.
+% guilt push
+Applying patch..nonempty-2
+Patch applied.
+% guilt pop
+Now at nonempty-1.
+% guilt fold nonempty-2
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..nonempty-1
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 3b526c794741fb2d6b463f3245ab2f260fa74b7b  .git/patches/master/status
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 669c9685ce791098bb3573f80af6d720a3689f80  .git/patches/master/nonempty-1
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f a88f2625f128cfa307a52c8c2e84ed6c32a78d2b  .git/patches/master/series
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+r 895dfbc21bde85fcc666a353a6bd32eaec939082  .git/refs/patches/master/nonempty-1
+% guilt pop
+All patches popped.
+% guilt delete -f nonempty-1
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+% git config guilt.diffstat false
+%% empty + empty (diffstat=false)
+% guilt new empty-1
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty-1
+Patch applied.
+% guilt new empty-2
+% guilt pop
+Now at empty-1.
+% guilt push
+Applying patch..empty-2
+Patch applied.
+% guilt pop
+Now at empty-1.
+% guilt fold empty-2
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty-1
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 4ea806e306f0228a8ef41f186035e7b04097f1f2  .git/patches/master/status
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f d28d87b88c1e24d637e390dc3603cfa7c1715711  .git/patches/master/series
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+r bde3d337af70f36836ad606c800d194006f883b3  .git/refs/patches/master/empty-1
+% guilt pop
+All patches popped.
+% guilt delete -f empty-1
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+%% empty + nonempty (diffstat=false)
+% guilt new empty
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty
+Patch applied.
+% guilt new -f -s -m A commit message. nonempty
+% guilt pop
+Now at empty.
+% guilt push
+Applying patch..nonempty
+Patch applied.
+% guilt pop
+Now at empty.
+% guilt fold nonempty
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 15aab0fd8b937eb3bb01841693f35dcb75da2faf  .git/patches/master/status
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty~
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f a26a22287b500a2a372e42c2bab03599bbe37cdf  .git/patches/master/series
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/empty
+% guilt pop
+All patches popped.
+% guilt delete -f empty
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty~
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+%% nonempty + empty (diffstat=false)
+% guilt new -f -s -m A commit message. nonempty
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..nonempty
+Patch applied.
+% guilt new empty
+% guilt pop
+Now at nonempty.
+% guilt push
+Applying patch..empty
+Patch applied.
+% guilt pop
+Now at nonempty.
+% guilt fold empty
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..nonempty
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f c47ddc01337e3bb67a9968a8823a5ba12be67f77  .git/patches/master/series
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+f f7f068d44bf796d0f7cd14d27d1f48d6e659816a  .git/patches/master/status
+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/nonempty
+% guilt pop
+All patches popped.
+% guilt delete -f nonempty
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+%% nonempty + nonempty (diffstat=false)
+% guilt new -f -s -m A commit message. nonempty-1
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..nonempty-1
+Patch applied.
+% guilt new -f -s -m Another commit message. nonempty-2
+% guilt pop
+Now at nonempty-1.
+% guilt push
+Applying patch..nonempty-2
+Patch applied.
+% guilt pop
+Now at nonempty-1.
+% guilt fold nonempty-2
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..nonempty-1
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 3b526c794741fb2d6b463f3245ab2f260fa74b7b  .git/patches/master/status
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f a88f2625f128cfa307a52c8c2e84ed6c32a78d2b  .git/patches/master/series
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+r 895dfbc21bde85fcc666a353a6bd32eaec939082  .git/refs/patches/master/nonempty-1
+% guilt pop
+All patches popped.
+% guilt delete -f nonempty-1
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~
+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
diff --git a/regression/t-035.sh b/regression/t-035.sh
new file mode 100755
index 0000000..c347e47
--- /dev/null
+++ b/regression/t-035.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# Test the fold code
+#
+
+source "$REG_DIR/scaffold"
+
+cmd setup_repo
+
+function fixup_time_info
+{
+	cmd guilt pop
+	touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
+	cmd guilt push
+}
+
+function empty_patch
+{
+	cmd guilt new "empty$1"
+	fixup_time_info "empty$1"
+}
+
+function nonempty_patch
+{
+	if [ "$1" = -2 ]; then
+		msg="Another commit message."
+	else
+		msg="A commit message."
+	fi
+
+	cmd guilt new -f -s -m "$msg" "nonempty$1"
+	fixup_time_info "nonempty$1"
+}
+
+for using_diffstat in true false; do
+	cmd git config guilt.diffstat $using_diffstat
+	for patcha in empty nonempty; do
+		for patchb in empty nonempty; do
+
+			if [ $patcha = $patchb ]; then
+				suffixa=-1
+				suffixb=-2
+			else
+				suffixa=
+				suffixb=
+			fi
+
+			echo "%% $patcha + $patchb (diffstat=$using_diffstat)"
+			${patcha}_patch $suffixa
+			${patchb}_patch $suffixb
+			cmd guilt pop
+			cmd guilt fold $patchb$suffixb
+			fixup_time_info $patcha$suffixa
+			cmd list_files
+			cmd guilt pop
+			cmd guilt delete -f $patcha$suffixa
+			cmd list_files
+
+		done
+	done
+done
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 08/33] Added more test cases for "guilt new": empty patches.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (6 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 07/33] Added test cases for "guilt fold" Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 09/33] Test suite: properly check the exit status of commands Per Cederqvist
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Test that empty patches are handled correctly, both with and without
the guilt.diffstat configuration option.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-020.out | 269 +++++++++++++++++++++++++++++++++++++++++++++++++++
 regression/t-020.sh  |  60 ++++++++++++
 2 files changed, 329 insertions(+)

diff --git a/regression/t-020.out b/regression/t-020.out
index af45734..42433dc 100644
--- a/regression/t-020.out
+++ b/regression/t-020.out
@@ -1128,3 +1128,272 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+% guilt new empty.patch
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty.patch
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch
+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
+r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch
+% git log -p
+commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    patch empty.patch
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+
+diff --git a/def b/def
+new file mode 100644
+index 0000000..8baef1b
+--- /dev/null
++++ b/def
+@@ -0,0 +1 @@
++abc
+% git config guilt.diffstat true
+% guilt refresh
+Patch empty.patch refreshed
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty.patch
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty.patch
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch~
+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
+r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch
+% git log -p
+commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    patch empty.patch
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+
+diff --git a/def b/def
+new file mode 100644
+index 0000000..8baef1b
+--- /dev/null
++++ b/def
+@@ -0,0 +1 @@
++abc
+% git config guilt.diffstat false
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty.patch
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ad87a0bdb8cf0a57cfc384633edabbb9c2bfa1b  .git/patches/master/empty.patch
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch~
+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
+r 8ed27228b117c0c88abf3d586bcc43c68e975cea  .git/refs/patches/master/empty.patch
+% git log -p
+commit 8ed27228b117c0c88abf3d586bcc43c68e975cea
+Author: Per Cederqvist <ceder@lysator.liu.se>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Fix a bug.
+    
+    This commit fixes a serious bug.
+    
+    FIXME:
+        - add a test case
+        - track down the bug
+        - actually fix it
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+
+diff --git a/def b/def
+new file mode 100644
+index 0000000..8baef1b
+--- /dev/null
++++ b/def
+@@ -0,0 +1 @@
++abc
+% git config guilt.diffstat true
+% guilt refresh
+Patch empty.patch refreshed
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty.patch
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 0803c721968056410df61400bb239380d033b9d5  .git/patches/master/empty.patch
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ad87a0bdb8cf0a57cfc384633edabbb9c2bfa1b  .git/patches/master/empty.patch~
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
+r 8ed27228b117c0c88abf3d586bcc43c68e975cea  .git/refs/patches/master/empty.patch
+% git log -p
+commit 8ed27228b117c0c88abf3d586bcc43c68e975cea
+Author: Per Cederqvist <ceder@lysator.liu.se>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Fix a bug.
+    
+    This commit fixes a serious bug.
+    
+    FIXME:
+        - add a test case
+        - track down the bug
+        - actually fix it
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+
+diff --git a/def b/def
+new file mode 100644
+index 0000000..8baef1b
+--- /dev/null
++++ b/def
+@@ -0,0 +1 @@
++abc
+% git config guilt.diffstat false
+% guilt refresh
+Patch empty.patch refreshed
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..empty.patch
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 0803c721968056410df61400bb239380d033b9d5  .git/patches/master/empty.patch~
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ad87a0bdb8cf0a57cfc384633edabbb9c2bfa1b  .git/patches/master/empty.patch
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
+r 8ed27228b117c0c88abf3d586bcc43c68e975cea  .git/refs/patches/master/empty.patch
+% git log -p
+commit 8ed27228b117c0c88abf3d586bcc43c68e975cea
+Author: Per Cederqvist <ceder@lysator.liu.se>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Fix a bug.
+    
+    This commit fixes a serious bug.
+    
+    FIXME:
+        - add a test case
+        - track down the bug
+        - actually fix it
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+
+diff --git a/def b/def
+new file mode 100644
+index 0000000..8baef1b
+--- /dev/null
++++ b/def
+@@ -0,0 +1 @@
++abc
+% guilt delete empty.patch
+Cannot delete an applied patch
+% guilt pop -a
+All patches popped.
+% guilt delete -f empty.patch
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 0803c721968056410df61400bb239380d033b9d5  .git/patches/master/empty.patch~
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+% git log -p
+commit d4850419ccc1146c7169f500725ce504b9774ed0
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+
+diff --git a/def b/def
+new file mode 100644
+index 0000000..8baef1b
+--- /dev/null
++++ b/def
+@@ -0,0 +1 @@
++abc
diff --git a/regression/t-020.sh b/regression/t-020.sh
index cdd08ba..c165884 100755
--- a/regression/t-020.sh
+++ b/regression/t-020.sh
@@ -5,6 +5,13 @@
 
 source "$REG_DIR/scaffold"
 
+function fixup_time_info
+{
+	cmd guilt pop
+	touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
+	cmd guilt push
+}
+
 cmd setup_repo
 
 #
@@ -69,6 +76,59 @@ done
 
 cmd list_files
 
+# push an empty patch with no commit message
+cmd guilt new empty.patch
+fixup_time_info empty.patch
+cmd list_files
+cmd git log -p
+
+# Ensure we can push the empty patch even when guilt.diffstat is true.
+cmd git config guilt.diffstat true
+cmd guilt refresh
+fixup_time_info empty.patch
+cmd list_files
+cmd git log -p
+cmd git config guilt.diffstat false
+
+# Let the patch have a commit message, but no data.
+cat > .git/patches/master/empty.patch <<EOF
+Fix a bug.
+
+From: Per Cederqvist <ceder@lysator.liu.se>
+
+This commit fixes a serious bug.
+
+FIXME:
+    - add a test case
+    - track down the bug
+    - actually fix it
+EOF
+
+fixup_time_info empty.patch
+cmd list_files
+cmd git log -p
+
+# And once more, with an empty diffstat.
+
+cmd git config guilt.diffstat true
+cmd guilt refresh
+fixup_time_info empty.patch
+cmd list_files
+cmd git log -p
+
+# Restore the diffstat setting and remove the empty patch.
+cmd git config guilt.diffstat false
+cmd guilt refresh
+fixup_time_info empty.patch
+cmd list_files
+cmd git log -p
+# (Cannot delete an applied patch)
+shouldfail guilt delete empty.patch
+cmd guilt pop -a
+cmd guilt delete -f empty.patch
+cmd list_files
+cmd git log -p
+
 # FIXME:
 #   --all
 #   -a
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 09/33] Test suite: properly check the exit status of commands.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (7 preceding siblings ...)
  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 ` 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
                   ` (23 subsequent siblings)
  32 siblings, 1 reply; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

The "cmd" and "shouldfail" functions checked the exit status of the
replace_path function instead of the actual command that was running.
(The $? construct checks the exit status of the last command in a
pipeline, not the first command.)

Print an explicit error message if a command that should fail actually
succeeds.

Updated t-032.sh, which used "shouldfail" instead of "cmd" in one
place.  (The comment in the script makes it clear that the command is
expected to succeed.)

Signed-off-by: Per Cederqvist <cederp@opera.com>
---
 regression/scaffold | 23 ++++++++++++++++-------
 regression/t-032.sh |  2 +-
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/regression/scaffold b/regression/scaffold
index 5c8b73e..2e04c83 100644
--- a/regression/scaffold
+++ b/regression/scaffold
@@ -51,19 +51,28 @@ function filter_dd
 function cmd
 {
 	echo "% $@"
-	"$@" 2>&1 | replace_path && return 0
-	return 1
+	if ! (
+		exec 3>&1
+		rv=`(("$@" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1`
+		exit $rv
+	) ; then
+		echo "% FAIL: The above command should succeed but failed."
+		exit 1
+	fi
 }
 
 # usage: shouldfail <cmd>..
 function shouldfail
 {
 	echo "% $@"
-	(
-		"$@" 2>&1 || return 0
-		return 1
-	) | replace_path
-	return $?
+	if (
+		exec 3>&1
+		rv=`(("$@" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1`
+		exit $rv
+	) ; then
+		echo "% FAIL: The above command should fail but succeeded."
+		exit 1
+	fi
 }
 
 # usage: list_files
diff --git a/regression/t-032.sh b/regression/t-032.sh
index b1d5f19..bba401e 100755
--- a/regression/t-032.sh
+++ b/regression/t-032.sh
@@ -28,7 +28,7 @@ shouldfail guilt import -P foo3 foo
 cmd guilt import -P foo2 foo
 
 # ok
-shouldfail guilt import foo
+cmd guilt import foo
 
 # duplicate patch name (implicit)
 shouldfail guilt import foo
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 10/33] Run test_failed if the exit status of a test script is bad.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (8 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 09/33] Test suite: properly check the exit status of commands Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 11/33] test suite: remove pointless redirection Per Cederqvist
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

There were two problems with the old code:

 - Since "set -e" is in effect (that is set in scaffold) the run-test
   script exited immediately if a t-*.sh script failed.  This is not
   nice, as we want the error report that test_failed prints.

 - The code ran "cd -" between running the t-*.sh script and checking
   the exit status, so the exit status was lost.  (Actually, the exit
   status was saved in $ERR, but nothing ever looked at $ERR.)

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/run-tests | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/regression/run-tests b/regression/run-tests
index a10e796..8e0af9f 100755
--- a/regression/run-tests
+++ b/regression/run-tests
@@ -55,11 +55,15 @@ function run_test
 
 	# run the test
 	cd "$REPODIR" > /dev/null
-	"$REG_DIR/t-$1.sh" 2>&1 > "$LOGFILE"
-	ERR=$?
+	if "$REG_DIR/t-$1.sh" 2>&1 > "$LOGFILE"; then
+		ERR=false
+	else
+		ERR=true
+	fi
+
 	cd - > /dev/null
 
-	[ $? -ne 0 ] && test_failed
+	$ERR && test_failed
 	diff -u "t-$1.out" "$LOGFILE" || test_failed
 
 	echo "done."
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 11/33] test suite: remove pointless redirection.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (9 preceding siblings ...)
  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 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 12/33] "guilt header": more robust header selection Per Cederqvist
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

The shouldfail function already redirects stderr to stdout, so there
is no need to do the same in t-028.sh and t-021.sh.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-021.sh | 2 +-
 regression/t-025.sh | 2 +-
 regression/t-028.sh | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/regression/t-021.sh b/regression/t-021.sh
index 6337d7b..614e870 100755
--- a/regression/t-021.sh
+++ b/regression/t-021.sh
@@ -61,7 +61,7 @@ for n in `_seq -2 $npatches`; do
 	if [ $n -gt 0 ]; then
 		cmd guilt pop -n $n
 	else
-		shouldfail guilt pop -n $n 2>&1
+		shouldfail guilt pop -n $n
 	fi
 
 	cmd list_files
diff --git a/regression/t-025.sh b/regression/t-025.sh
index 3824608..985fed4 100755
--- a/regression/t-025.sh
+++ b/regression/t-025.sh
@@ -44,7 +44,7 @@ shouldfail guilt new "white space"
 cmd list_files
 
 for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do
-	shouldfail guilt new "$pname" 2>&1
+	shouldfail guilt new "$pname"
 
 	cmd list_files
 done
diff --git a/regression/t-028.sh b/regression/t-028.sh
index 8480100..88e9adb 100755
--- a/regression/t-028.sh
+++ b/regression/t-028.sh
@@ -29,6 +29,6 @@ guilt series | while read n; do
 	cmd guilt header $n
 done
 
-shouldfail guilt header non-existant 2>&1
+shouldfail guilt header non-existant
 
 # FIXME: how do we check that -e works?
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 12/33] "guilt header": more robust header selection.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (10 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 11/33] test suite: remove pointless redirection Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 13/33] Check that "guilt header '.*'" fails Per Cederqvist
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

If you run something like "guilt header '.*'" the command would crash,
because the grep comand that tries to ensure that the patch exist
would detect a match, but the later code expected the match to be
exact.

Fixed by comparing exact strings.

And as a creeping feature "guilt header" will now try to use the
supplied patch name as an unanchored regexp if no exact match was
found.  If the regexp yields a unique match, it is used; if more than
one patch matches, the names of all patches are listed and the command
fails.  (Exercise left to the reader: generalized this so that "guilt
push" also accepts a unique regular expression.)

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-header | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/guilt-header b/guilt-header
index 41e00cc..c3d24f9 100755
--- a/guilt-header
+++ b/guilt-header
@@ -45,10 +45,33 @@ esac
 [ -z "$patch" ] && die "No patches applied."
 
 # check that patch exists in the series
-ret=`get_full_series | grep -e "^$patch\$" | wc -l`
-if [ $ret -eq 0 ]; then
-	die "Patch $patch is not in the series"
+TMP_FULL_SERIES=`get_tmp_file series`
+get_full_series > "$TMP_FULL_SERIES"
+found_patch=
+while read x; do
+	if [ "$x" = "$patch" ]; then
+		found_patch="$patch"
+		break
+	fi
+done < "$TMP_FULL_SERIES"
+if [ -z "$found_patch" ]; then
+	TMP_MATCHES=`get_tmp_file series`
+	grep "$patch" < "$TMP_FULL_SERIES" > "$TMP_MATCHES"
+	nr=`wc -l < $TMP_MATCHES`
+	if [ $nr -gt 1 ]; then
+		echo "$patch does not uniquely identify a patch. Did you mean any of these?" >&2
+		sed 's/^/  /' "$TMP_MATCHES" >&2
+		rm -f "$TMP_MATCHES" "$TMP_FULL_SERIES"
+		exit 1
+	elif [ $nr -eq 0 ]; then
+		rm -f "$TMP_MATCHES" "$TMP_FULL_SERIES"
+		die "Patch $patch is not in the series"
+	fi
+	found_patch=`cat $TMP_MATCHES`
+	rm -f "$TMP_MATCHES"
 fi
+rm -f "$TMP_FULL_SERIES"
+patch="$found_patch"
 
 # FIXME: warn if we're editing an applied patch
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 13/33] Check that "guilt header '.*'" fails.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (11 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 12/33] "guilt header": more robust header selection Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 14/33] Use "git check-ref-format" to validate patch names Per Cederqvist
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-028.out | 7 +++++++
 regression/t-028.sh  | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/regression/t-028.out b/regression/t-028.out
index 1564c09..ea72a3a 100644
--- a/regression/t-028.out
+++ b/regression/t-028.out
@@ -49,3 +49,10 @@ Signed-off-by: Commiter Name <commiter@email>
 
 % guilt header non-existant
 Patch non-existant is not in the series
+% guilt header .*
+.* does not uniquely identify a patch. Did you mean any of these?
+  modify
+  add
+  remove
+  mode
+  patch-with-some-desc
diff --git a/regression/t-028.sh b/regression/t-028.sh
index 88e9adb..2ce0378 100755
--- a/regression/t-028.sh
+++ b/regression/t-028.sh
@@ -31,4 +31,8 @@ done
 
 shouldfail guilt header non-existant
 
+# This is an evil variant of a non-existant patch.  However, this
+# patch name is a regexp that just happens to match an existing patch.
+shouldfail guilt header '.*'
+
 # FIXME: how do we check that -e works?
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 14/33] Use "git check-ref-format" to validate patch names.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (12 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 13/33] Check that "guilt header '.*'" fails Per Cederqvist
@ 2014-05-18 21:59 ` 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
                   ` (18 subsequent siblings)
  32 siblings, 1 reply; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

The valid_patchname now lets "git check-ref-format" do its job instead
of trying (and failing) to implement the same rules.  See
git-check-ref-format(1) for a list of the rules.  Re-implement rules
added to "git check-ref-format" after Git 1.5.0, so that guilt rejects
the same names no matter what version of Git we are using (but
versions prior to 1.5.0 are not supported).

Refer to the git-check-ref-format(1) man page in the error messages
produced when valid_patchname indicates that the name is bad.

Added testcases that breaks most of the rules in that man-page.

Signed-off-by: Per Cederqvist <cederp@opera.com>
---
 guilt                |  46 +++++-
 guilt-fork           |   2 +-
 guilt-import         |   2 +-
 guilt-new            |   2 +-
 regression/t-025.out | 426 +++++++++++++++++++++++++++++++++++++++++++++++++--
 regression/t-025.sh  |  12 +-
 regression/t-032.out |   4 +-
 7 files changed, 474 insertions(+), 20 deletions(-)

diff --git a/guilt b/guilt
index 3fc524e..9567a78 100755
--- a/guilt
+++ b/guilt
@@ -132,14 +132,50 @@ fi
 # usage: valid_patchname <patchname>
 valid_patchname()
 {
+	# Once we only support Git 1.7.8 and newer, the command below
+	# could be replaced with:
+	#
+	#     git check-ref-format --allow-onelevel "$1"
+	#
+	# Instead, we arbitrarily prepend one level.  The result
+	# should be the same, and this is portable to all existing
+	# versions of Git.
+	git check-ref-format a/"$1"
+	if [ $? -ne 0 ]; then
+		return 1
+	fi
+
+	# We want to reject all names that Git 2.0.0 rejects.  In case
+	# we are running an older version, we explicitly check some
+	# cases that were added to Git after version 1.5.0.  This code
+	# aims to support Git version 1.5.0 and newer.
+
+	# Git 1.7.6.4 and newer rejects the DEL character.
+	if [ `echo "$1"|tr -d '\177'` != "$1" ]; then
+		return 1
+	fi
+
+	# Git 1.7.8 and newer rejects refs that start or end with
+	# slash or contain multiple adjacent slashes.
 	case "$1" in
-		/*|./*|../*|*/./*|*/../*|*/.|*/..|*/|*\ *|*\	*)
+		/*|*/|*//*)
 			return 1;;
-		*:*)
-			return 1;;
-		*)
-			return 0;;
 	esac
+
+	# Git 1.7.8 and newer rejects refname components that end in
+	# .lock.
+	case "$1" in
+		*.lock/*|*.lock)
+			return 1;;
+	esac
+
+	# Git 1.8.5 and newer rejects refnames that are made up of the
+	# single character "@".
+	if [ "$1" = "@" ]; then
+		return 1
+	fi
+
+	return 0
 }
 
 get_branch()
diff --git a/guilt-fork b/guilt-fork
index a85d391..6447e55 100755
--- a/guilt-fork
+++ b/guilt-fork
@@ -37,7 +37,7 @@ else
 fi
 
 if ! valid_patchname "$newpatch"; then
-	die "The specified patch name contains invalid characters (:)."
+	die "The specified patch name is invalid according to git-check-ref-format(1)."
 fi
 
 if [ -e "$GUILT_DIR/$branch/$newpatch" ]; then
diff --git a/guilt-import b/guilt-import
index 3e9b3bb..928e325 100755
--- a/guilt-import
+++ b/guilt-import
@@ -40,7 +40,7 @@ if [ -e "$GUILT_DIR/$branch/$newname" ]; then
 fi
 
 if ! valid_patchname "$newname"; then
-	die "The specified patch name contains invalid characters (:)."
+	die "The specified patch name is invalid according to git-check-ref-format(1)."
 fi
 
 # create any directories as needed
diff --git a/guilt-new b/guilt-new
index 9528438..9f7fa44 100755
--- a/guilt-new
+++ b/guilt-new
@@ -64,7 +64,7 @@ fi
 
 if ! valid_patchname "$patch"; then
 	disp "Patchname is invalid." >&2
-	die "it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace"
+	die "It must follow the rules in git-check-ref-format(1)."
 fi
 
 # create any directories as needed
diff --git a/regression/t-025.out b/regression/t-025.out
index 7811ab1..01bc406 100644
--- a/regression/t-025.out
+++ b/regression/t-025.out
@@ -141,7 +141,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new white space
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -211,7 +211,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new /abc
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -235,7 +235,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new ./blah
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -259,7 +259,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new ../blah
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -283,7 +283,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/./blah
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -307,7 +307,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/../blah
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -331,7 +331,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/.
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -355,7 +355,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/..
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -379,7 +379,415 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new abc.lock
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new a/b.lock/c
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new cr
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new ctrl-a\x01
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new formfeed\f
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new del\x7f
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new tilde~
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new caret^
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new colon:
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new questionmark?
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new asterisk*
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new open[bracket
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new consecutive//slashes
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new trailing-dot.
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new bad@{seq
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new @
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new backslash\
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
diff --git a/regression/t-025.sh b/regression/t-025.sh
index 985fed4..8c439fc 100755
--- a/regression/t-025.sh
+++ b/regression/t-025.sh
@@ -43,7 +43,17 @@ shouldfail guilt new "white space"
 
 cmd list_files
 
-for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do
+b()
+{
+    printf "%b" "$1"
+}
+
+for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. \
+	abc/.. abc/ abc.lock a/b.lock/c `b 'cr\r'` `b 'ctrl-a\001'` \
+	`b 'formfeed\f'` `b 'del\177'` "tilde~" "caret^" "colon:" \
+	"questionmark?" "asterisk*" "open[bracket" "consecutive//slashes" \
+	"trailing-dot." "bad@{seq" "@" "backslash\\"
+do
 	shouldfail guilt new "$pname"
 
 	cmd list_files
diff --git a/regression/t-032.out b/regression/t-032.out
index 53f0370..4e65db0 100644
--- a/regression/t-032.out
+++ b/regression/t-032.out
@@ -1,7 +1,7 @@
 % setup_repo
 % touch foo foo:baz
 % guilt import -P foo:bar foo
-The specified patch name contains invalid characters (:).
+The specified patch name is invalid according to git-check-ref-format(1).
 % guilt import -P foo:bar foo2
 Specified file does not exist.
 % guilt import -P foo foo2
@@ -15,4 +15,4 @@ Already tracking a patch under that name.
 Already tracking a patch under that name.
 % guilt import -P foo,bar foo
 % guilt import foo:baz
-The specified patch name contains invalid characters (:).
+The specified patch name is invalid according to git-check-ref-format(1).
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 15/33] Produce legal patch names in guilt-import-commit.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (13 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 14/33] Use "git check-ref-format" to validate patch names Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2015-01-22 14:15   ` Jeff Sipek
  2014-05-18 21:59 ` [GUILT v4 16/33] Fix backslash handling when creating names of imported patches Per Cederqvist
                   ` (17 subsequent siblings)
  32 siblings, 1 reply; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Try harder to create patch names that adhere to the rules in
git-check-ref-format(1) when deriving a patch name from the commit
message.  Verify that the derived name using "git check-ref-format",
and as a final fallback simply use the patch name "x" (to ensure that
the code is future-proof in case new rules are added in the future).

Always append a ".patch" suffix to the patch name.

Added test cases.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-import-commit  |  20 +-
 regression/t-034.out | 567 +++++++++++++++++++++++++++++++++++++++++++++++++++
 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 f14647c..6260c56 100755
--- a/guilt-import-commit
+++ b/guilt-import-commit
@@ -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-`
 
+	# 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" \
 			-e "s/['\\[{}]//g" -e 's/]//g' -e 's/\*/-/g' \
-			-e 's/\?/-/g' | tr A-Z a-z`
+			-e 's/\?/-/g' -e 's/\.\.\.*/./g' -e 's/^\.//' \
+			-e 's/\.patch$//' -e 's/\.$//' | tr A-Z a-z`
+
+	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 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.)
+		fname=x
+	fi
 
 	disp "Converting `echo $rev | cut -c 1-8` as $fname"
 
 	mangle_prefix=1
 	fname_base=$fname
-	while [ -f "$GUILT_DIR/$branch/$fname" ]; do
+	while [ -f "$GUILT_DIR/$branch/$fname.patch" ]; do
 		fname="$fname_base-$mangle_prefix"
 	        mangle_prefix=`expr $mangle_prefix + 1`
 		disp "Patch under that name exists...trying '$fname'"
 	done
+	fname="$fname".patch
 
 	(
 		do_make_header $rev
diff --git a/regression/t-034.out b/regression/t-034.out
new file mode 100644
index 0000000..7bc9459
--- /dev/null
+++ b/regression/t-034.out
@@ -0,0 +1,567 @@
+% setup_git_repo
+% git tag base
+% create_commit a The sequence /. is forbidden.
+[master eebb76e] The sequence /. is forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+ create mode 100644 a
+% create_commit a The sequence .lock/ is forbidden.
+[master 45e81b5] The sequence .lock/ is forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a A/component/may/not/end/in/foo.lock
+[master bbf3f59] A/component/may/not/end/in/foo.lock
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Two consecutive dots (..) is forbidden.
+[master 1535e67] Two consecutive dots (..) is forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Check/multiple/../dots/...../foo..patch
+[master 48eb60c] Check/multiple/../dots/...../foo..patch
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Space is forbidden.
+[master 10dea83] Space is forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Tilde~is~forbidden.
+[master 70a83b7] Tilde~is~forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Caret^is^forbidden.
+[master ee6ef2c] Caret^is^forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Colon:is:forbidden.
+[master c077fe2] Colon:is:forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Del\x7fis\x7fforbidden.
+[master 589ee30] Del\x7fis\x7fforbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% git branch some-branch
+% git tag some-tag
+% create_commit a Ctrl\x01is\x02forbidden.
+[master e63cdde] Ctrl\x01is\x02forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a CR
is
also
forbidden.
+[master 21ad093] CR
is
also
forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Question-mark?is?forbidden.
+[master be2fa9b] Question-mark?is?forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Asterisk*is*forbidden.
+[master af7b50f] Asterisk*is*forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Open[bracket[is[forbidden.
+[master 689f618] Open[bracket[is[forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Multiple/slashes//are//forbidden.
+[master 6e7d52a] Multiple/slashes//are//forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Cannot/end/in/slash/
+[master 95bb6cd] Cannot/end/in/slash/
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Cannot end in ..
+[master 106e8e5] Cannot end in ..
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Cannot@{have@{the@{sequence@{at-brace.
+[master 30187ed] Cannot@{have@{the@{sequence@{at-brace.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a @
+[master aedb74f] @
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Backslash\is\forbidden.
+[master 0a46f8f] Backslash\is\forbidden.
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% create_commit a Can/have/embedded/single/slashes
+[master 2a8b188] Can/have/embedded/single/slashes
+ Author: Author Name <author@email>
+ 1 file changed, 1 insertion(+)
+% git log
+commit 2a8b1889aa5066193bac978e6bf5073ffcfa6541
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Can/have/embedded/single/slashes
+
+commit 0a46f8fa7c8c5a6f1039f842fe5cbd21d3a2a2a6
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Backslash\is\forbidden.
+
+commit aedb74fd8388282fd7af50cb191a7f62bfc45eb5
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    @
+
+commit 30187ed0f47d12df9cedcbb846647d0d52130c12
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Cannot@{have@{the@{sequence@{at-brace.
+
+commit 106e8e5a8cceec7297af97376ca5f93506643d0b
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Cannot end in ..
+
+commit 95bb6cd7edf7b1e634a1e7d02c8faa99e39cbbf2
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Cannot/end/in/slash/
+
+commit 6e7d52a7dacc684225c11b4edd2bac25fb52bd9b
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Multiple/slashes//are//forbidden.
+
+commit 689f618085195775d204898254154b8bb50897a5
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Open[bracket[is[forbidden.
+
+commit af7b50f93854bc5f46de5a389c1f3dea081eae2f
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Asterisk*is*forbidden.
+
+commit be2fa9b5c5788dc05c4036f1b8197a1d33169610
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Question-mark?is?forbidden.
+
+commit 21ad093a0c1b4a96285180a3d7b99a4045ef9202
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    CR
is
also
forbidden.
+
+commit e63cdde7a1c90b66d7d411683528200f3f067d5f
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Ctrl\x01is\x02forbidden.
+
+commit 589ee305a82aacf155529e75cbc84e661c37c83d
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Del\x7fis\x7fforbidden.
+
+commit c077fe203fd18036fb00b56eec1763673d1769c6
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Colon:is:forbidden.
+
+commit ee6ef2cc9dd5525409300377b013c0d9734bd931
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Caret^is^forbidden.
+
+commit 70a83b705a2602a9493aba7f8f22e7abd13adc63
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Tilde~is~forbidden.
+
+commit 10dea8380135f4d10cd10324e13da659261ceda3
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Space is forbidden.
+
+commit 48eb60cddaefdaac5f78655f9028a9da741a18d1
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Check/multiple/../dots/...../foo..patch
+
+commit 1535e67718949abf72f843685a1672ebfe4bd21f
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Two consecutive dots (..) is forbidden.
+
+commit bbf3f5926e11d97b08cdb6e833c9deb603453d1b
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    A/component/may/not/end/in/foo.lock
+
+commit 45e81b5163ec3ed656b058ac3fd95b8986824e0f
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    The sequence .lock/ is forbidden.
+
+commit eebb76e96913d2dc78aef5f233fadc74af770b3b
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    The sequence /. is forbidden.
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+% guilt init
+% guilt import-commit base..HEAD
+About to begin conversion...
+Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541
+Converting 2a8b1889 as can-have-embedded-single-slashes
+Converting 0a46f8fa as backslash-isorbidden
+Converting aedb74fd as x
+Converting 30187ed0 as cannot@have@the@sequence@at-brace
+Converting 106e8e5a as cannot_end_in_
+Converting 95bb6cd7 as cannot-end-in-slash-
+Converting 6e7d52a7 as multiple-slashes--are--forbidden
+Converting 689f6180 as openbracketisforbidden
+Converting af7b50f9 as asterisk-is-forbidden
+Converting be2fa9b5 as question-mark-is-forbidden
+Converting 21ad093a as crisalsoforbidden
+Converting e63cdde7 as ctrlisforbidden
+Converting 589ee305 as delisforbidden
+Converting c077fe20 as colon_is_forbidden
+Converting ee6ef2cc as caretisforbidden
+Converting 70a83b70 as tildeisforbidden
+Converting 10dea838 as space_is_forbidden
+Converting 48eb60cd as check-multiple-.-dots-.-foo
+Converting 1535e677 as two_consecutive_dots_(.)_is_forbidden
+Converting bbf3f592 as a-component-may-not-end-in-foolock
+Converting 45e81b51 as the_sequence_.lock-_is_forbidden
+Converting eebb76e9 as the_sequence_-._is_forbidden
+Done.
+Current head: d4850419ccc1146c7169f500725ce504b9774ed0
+% guilt push -a
+Applying patch..the_sequence_-._is_forbidden.patch
+Patch applied.
+Applying patch..the_sequence_.lock-_is_forbidden.patch
+Patch applied.
+Applying patch..a-component-may-not-end-in-foolock.patch
+Patch applied.
+Applying patch..two_consecutive_dots_(.)_is_forbidden.patch
+Patch applied.
+Applying patch..check-multiple-.-dots-.-foo.patch
+Patch applied.
+Applying patch..space_is_forbidden.patch
+Patch applied.
+Applying patch..tildeisforbidden.patch
+Patch applied.
+Applying patch..caretisforbidden.patch
+Patch applied.
+Applying patch..colon_is_forbidden.patch
+Patch applied.
+Applying patch..delisforbidden.patch
+Patch applied.
+Applying patch..ctrlisforbidden.patch
+Patch applied.
+Applying patch..crisalsoforbidden.patch
+Patch applied.
+Applying patch..question-mark-is-forbidden.patch
+Patch applied.
+Applying patch..asterisk-is-forbidden.patch
+Patch applied.
+Applying patch..openbracketisforbidden.patch
+Patch applied.
+Applying patch..multiple-slashes--are--forbidden.patch
+Patch applied.
+Applying patch..cannot-end-in-slash-.patch
+Patch applied.
+Applying patch..cannot_end_in_.patch
+Patch applied.
+Applying patch..cannot@have@the@sequence@at-brace.patch
+Patch applied.
+Applying patch..x.patch
+Patch applied.
+Applying patch..backslash-isorbidden.patch
+Patch applied.
+Applying patch..can-have-embedded-single-slashes.patch
+Patch applied.
+% git log --decorate
+commit 434e07cacdd8e7eb4723e67cb2d100b3a4121a3a (HEAD, refs/patches/master/can-have-embedded-single-slashes.patch, guilt/master)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Can/have/embedded/single/slashes
+
+commit 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 (refs/patches/master/backslash-isorbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Backslash\is\forbidden.
+
+commit ea46f435d4d8f3c5349dce1aabc1a39fbf7ef803 (refs/patches/master/x.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    @
+
+commit a275ed5d7f10ea88c986852ee95a7d5a61663b5f (refs/patches/master/cannot@have@the@sequence@at-brace.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Cannot@{have@{the@{sequence@{at-brace.
+
+commit f091fee39457e64ebd35410c1cf95e6613816a54 (refs/patches/master/cannot_end_in_.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Cannot end in ..
+
+commit 025672497aff5c910c8ff86aaedc662f14c2f4ad (refs/patches/master/cannot-end-in-slash-.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Cannot/end/in/slash/
+
+commit f13e243c7c56f39422567a431bccceec8b789596 (refs/patches/master/multiple-slashes--are--forbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Multiple/slashes//are//forbidden.
+
+commit edef5e925083d445f71c170d3293fac9619bc7a2 (refs/patches/master/openbracketisforbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Open[bracket[is[forbidden.
+
+commit 1626a11d979a1e9e775c766484172212277153df (refs/patches/master/asterisk-is-forbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Asterisk*is*forbidden.
+
+commit 74df14ab3a0ec9a0382998fbf167ebb1b0a36c6a (refs/patches/master/question-mark-is-forbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Question-mark?is?forbidden.
+
+commit ec46429125abdb0c5ac2b46cc399bdcd7cfc73fd (refs/patches/master/crisalsoforbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    CR
is
also
forbidden.
+
+commit 01524f9921af2a041cc88c068f76baa39e436cb2 (refs/patches/master/ctrlisforbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Ctrl\x01is\x02forbidden.
+
+commit 9fc9677b61880f9159838e89f714893e0a2fcafb (refs/patches/master/delisforbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Del\x7fis\x7fforbidden.
+
+commit 10433fd7206b7f79aabb4da514710d93c8deed4a (refs/patches/master/colon_is_forbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Colon:is:forbidden.
+
+commit fb1edb753c97ec865ceea316420b1df586caaa2b (refs/patches/master/caretisforbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Caret^is^forbidden.
+
+commit 3a0d5ccef0359004fcaa9cee98fbd6a2c4432e74 (refs/patches/master/tildeisforbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Tilde~is~forbidden.
+
+commit ea22c3b49c448dba8d7eaa6b805f9f1bc83fbedc (refs/patches/master/space_is_forbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Space is forbidden.
+
+commit db6ea8252440b04811344336f510a5469b2ddab0 (refs/patches/master/check-multiple-.-dots-.-foo.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Check/multiple/../dots/...../foo..patch
+
+commit fe07105cd62660f4440ad24b9fc7dfdd9e71d764 (refs/patches/master/two_consecutive_dots_(.)_is_forbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Two consecutive dots (..) is forbidden.
+
+commit 96a3e92c4df85f52362ce4f6d31983c462db9ae9 (refs/patches/master/a-component-may-not-end-in-foolock.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    A/component/may/not/end/in/foo.lock
+
+commit ee4f0f96dfc9c94f5410c1e6414f9004325a37fc (refs/patches/master/the_sequence_.lock-_is_forbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    The sequence .lock/ is forbidden.
+
+commit fdcb23c3072209bea3d9e0a2594132b936c5347e (refs/patches/master/the_sequence_-._is_forbidden.patch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    The sequence /. is forbidden.
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0 (tag: base, master)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+% git log --decorate some-branch
+commit 589ee305a82aacf155529e75cbc84e661c37c83d (tag: some-tag, some-branch)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Del\x7fis\x7fforbidden.
+
+commit c077fe203fd18036fb00b56eec1763673d1769c6
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Colon:is:forbidden.
+
+commit ee6ef2cc9dd5525409300377b013c0d9734bd931
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Caret^is^forbidden.
+
+commit 70a83b705a2602a9493aba7f8f22e7abd13adc63
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Tilde~is~forbidden.
+
+commit 10dea8380135f4d10cd10324e13da659261ceda3
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Space is forbidden.
+
+commit 48eb60cddaefdaac5f78655f9028a9da741a18d1
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Check/multiple/../dots/...../foo..patch
+
+commit 1535e67718949abf72f843685a1672ebfe4bd21f
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    Two consecutive dots (..) is forbidden.
+
+commit bbf3f5926e11d97b08cdb6e833c9deb603453d1b
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    A/component/may/not/end/in/foo.lock
+
+commit 45e81b5163ec3ed656b058ac3fd95b8986824e0f
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    The sequence .lock/ is forbidden.
+
+commit eebb76e96913d2dc78aef5f233fadc74af770b3b
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    The sequence /. is forbidden.
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0 (tag: base, master)
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+% list_files
+d .git/patches
+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
+f 2cd7c9ad392e071be03c051c6793e9b1e31d33c4  .git/patches/master/can-have-embedded-single-slashes.patch
+f 3136e448a4c820f6d2642f9d894c4087d3d109ab  .git/patches/master/cannot_end_in_.patch
+f 34e07c584032df137f19bdb66d93f316f00a5ac8  .git/patches/master/tildeisforbidden.patch
+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 7b103c3c7ae298cd2334f6f49da48bae1424f77b  .git/patches/master/crisalsoforbidden.patch
+f 9b810b8c63779c51d2e7f61ab59cd49835041563  .git/patches/master/x.patch
+f a22958d9ae9976fd7b2b5a9d0bcd44bf7ad9b08a  .git/patches/master/caretisforbidden.patch
+f ab325bf5a432937fc6f231d3e8a773a62d53952b  .git/patches/master/multiple-slashes--are--forbidden.patch
+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 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
+f edfaa5e06bd662ae1f6a642834324fd9b849bbd9  .git/patches/master/a-component-may-not-end-in-foolock.patch
+r 01524f9921af2a041cc88c068f76baa39e436cb2  .git/refs/patches/master/ctrlisforbidden.patch
+r 025672497aff5c910c8ff86aaedc662f14c2f4ad  .git/refs/patches/master/cannot-end-in-slash-.patch
+r 10433fd7206b7f79aabb4da514710d93c8deed4a  .git/refs/patches/master/colon_is_forbidden.patch
+r 1626a11d979a1e9e775c766484172212277153df  .git/refs/patches/master/asterisk-is-forbidden.patch
+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 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
+r db6ea8252440b04811344336f510a5469b2ddab0  .git/refs/patches/master/check-multiple-.-dots-.-foo.patch
+r ea22c3b49c448dba8d7eaa6b805f9f1bc83fbedc  .git/refs/patches/master/space_is_forbidden.patch
+r ea46f435d4d8f3c5349dce1aabc1a39fbf7ef803  .git/refs/patches/master/x.patch
+r ec46429125abdb0c5ac2b46cc399bdcd7cfc73fd  .git/refs/patches/master/crisalsoforbidden.patch
+r edef5e925083d445f71c170d3293fac9619bc7a2  .git/refs/patches/master/openbracketisforbidden.patch
+r ee4f0f96dfc9c94f5410c1e6414f9004325a37fc  .git/refs/patches/master/the_sequence_.lock-_is_forbidden.patch
+r f091fee39457e64ebd35410c1cf95e6613816a54  .git/refs/patches/master/cannot_end_in_.patch
+r f13e243c7c56f39422567a431bccceec8b789596  .git/refs/patches/master/multiple-slashes--are--forbidden.patch
+r fb1edb753c97ec865ceea316420b1df586caaa2b  .git/refs/patches/master/caretisforbidden.patch
+r fdcb23c3072209bea3d9e0a2594132b936c5347e  .git/refs/patches/master/the_sequence_-._is_forbidden.patch
+r fe07105cd62660f4440ad24b9fc7dfdd9e71d764  .git/refs/patches/master/two_consecutive_dots_(.)_is_forbidden.patch
+% guilt pop -a
+All patches popped.
diff --git a/regression/t-034.sh b/regression/t-034.sh
new file mode 100755
index 0000000..f41f958
--- /dev/null
+++ b/regression/t-034.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+#
+# Test import-commit
+#
+
+function create_commit
+{
+	echo $1 >> $1 &&
+		git add $1 &&
+		git commit -m"$2"
+}
+
+source "$REG_DIR/scaffold"
+
+b()
+{
+	printf "%b" "$1"
+}
+
+cmd setup_git_repo
+
+cmd git tag base
+
+# Create a series of commits whose first line of the commit message
+# each violates one of the rules in get-check-ref-format(1).
+
+cmd create_commit a "The sequence /. is forbidden."
+cmd create_commit a "The sequence .lock/ is forbidden."
+cmd create_commit a "A/component/may/not/end/in/foo.lock"
+cmd create_commit a "Two consecutive dots (..) is forbidden."
+cmd create_commit a "Check/multiple/../dots/...../foo..patch"
+cmd create_commit a "Space is forbidden."
+cmd create_commit a "Tilde~is~forbidden."
+cmd create_commit a "Caret^is^forbidden."
+cmd create_commit a "Colon:is:forbidden."
+cmd create_commit a `b 'Del\177is\177forbidden.'`
+# Create a branch and a tag from the current commit, to ensure that
+# doing so does not affect how the commit is imported.
+cmd git branch some-branch
+cmd git tag some-tag
+cmd create_commit a `b 'Ctrl\001is\002forbidden.'`
+cmd create_commit a `b 'CR\ris\ralso\rforbidden.'`
+cmd create_commit a "Question-mark?is?forbidden."
+cmd create_commit a "Asterisk*is*forbidden."
+cmd create_commit a "Open[bracket[is[forbidden."
+cmd create_commit a "Multiple/slashes//are//forbidden."
+cmd create_commit a "Cannot/end/in/slash/"
+cmd create_commit a "Cannot end in .."
+cmd create_commit a "Cannot@{have@{the@{sequence@{at-brace."
+cmd create_commit a "@"
+cmd create_commit a "Backslash\\is\\forbidden."
+
+# Slash is sometimes allowed; this is not problematic.
+cmd create_commit a "Can/have/embedded/single/slashes"
+
+cmd git log
+
+# Import all the commits to guilt.
+cmd guilt init
+cmd guilt import-commit base..HEAD
+
+for patch in .git/patches/master/*.patch; do
+	touch -a -m -t "$TOUCH_DATE" "$patch"
+done
+
+# If push and pop works, the names we created are good.
+cmd guilt push -a
+cmd git log --decorate
+cmd git log --decorate some-branch
+cmd list_files
+cmd guilt pop -a
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 16/33] Fix backslash handling when creating names of imported patches.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (14 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 15/33] Produce legal patch names in guilt-import-commit Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 17/33] "guilt graph" no longer loops when no patches are applied Per Cederqvist
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

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

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 17/33] "guilt graph" no longer loops when no patches are applied.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (15 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 16/33] Fix backslash handling when creating names of imported patches Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 18/33] guilt-graph: Handle commas in branch names Per Cederqvist
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Give an error message if no patches are applied.  Added a test case
that never terminates unless this fix is applied.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-graph          |  9 +++++++--
 regression/t-033.out |  3 +++
 regression/t-033.sh  | 13 +++++++++++++
 3 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 regression/t-033.out
 create mode 100755 regression/t-033.sh

diff --git a/guilt-graph b/guilt-graph
index b3469dc..56d0e77 100755
--- a/guilt-graph
+++ b/guilt-graph
@@ -17,8 +17,13 @@ fi
 
 patchname="$1"
 
-bottom=`git rev-parse refs/patches/$branch/$(head_n 1 < "$applied")`
-base=`git rev-parse $bottom^`
+bottompatch=$(head_n 1 < "$applied")
+if [ -z "$bottompatch" ]; then
+	echo "No patch applied." >&2
+	exit 1
+fi
+
+base=`git rev-parse "refs/patches/${branch}/${bottompatch}^"`
 
 if [ -z "$patchname" ]; then
 	top=`git rev-parse HEAD`
diff --git a/regression/t-033.out b/regression/t-033.out
new file mode 100644
index 0000000..76613f9
--- /dev/null
+++ b/regression/t-033.out
@@ -0,0 +1,3 @@
+% setup_repo
+% guilt graph
+No patch applied.
diff --git a/regression/t-033.sh b/regression/t-033.sh
new file mode 100755
index 0000000..a3a8981
--- /dev/null
+++ b/regression/t-033.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+#
+# Test the graph code
+#
+
+source "$REG_DIR/scaffold"
+
+cmd setup_repo
+
+# Check that "guilt graph" gives a proper "No patch applied" error
+# message when no patches are applied.  (An older version of guilt
+# used to enter an endless loop in this situation.)
+shouldfail guilt graph
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 18/33] guilt-graph: Handle commas in branch names.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (16 preceding siblings ...)
  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 ` 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
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

This fix relies on the fact that git branch names can not contain ":".

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-graph | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guilt-graph b/guilt-graph
index 56d0e77..924a63e 100755
--- a/guilt-graph
+++ b/guilt-graph
@@ -51,7 +51,7 @@ safebranch=`echo "$branch"|sed 's%/%\\\\/%g'`
 while [ "$current" != "$base" ]; do
 	pname=`git show-ref | sed -n -e "
 /^$current refs\/patches\/$safebranch/ {
-	s,^$current refs/patches/$branch/,,
+	s:^$current refs/patches/$branch/::
 	p
 	q
 }"`
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 19/33] Check that "guilt graph" works when working on a branch with a comma.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (17 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 18/33] guilt-graph: Handle commas in branch names Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 20/33] "guilt graph": Handle patch names containing quotes Per Cederqvist
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

git branch names can contain commas.  Check that "guilt graph" works
even in that case.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-033.out | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 regression/t-033.sh  | 39 +++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+)

diff --git a/regression/t-033.out b/regression/t-033.out
index 76613f9..3d1c61f 100644
--- a/regression/t-033.out
+++ b/regression/t-033.out
@@ -1,3 +1,68 @@
 % setup_repo
 % guilt graph
 No patch applied.
+%% Testing branch a,graph
+% git checkout -b a,graph master
+Switched to a new branch 'a,graph'
+% guilt init
+% guilt new a.patch
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..a.patch
+Patch applied.
+% guilt graph
+digraph G {
+# checking rev 95275d7c05c6a6176d3941374115b91272877f6c
+	"95275d7c05c6a6176d3941374115b91272877f6c" [label="a.patch"]
+}
+% git add file.txt
+% guilt refresh
+Patch a.patch refreshed
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..a.patch
+Patch applied.
+% guilt graph
+digraph G {
+# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d
+	"ff2775f8d1dc753f635830adcc3a067e0b681e2d" [label="a.patch"]
+}
+%% Adding an unrelated file in a new patch. No deps.
+% guilt new b.patch
+% git add file2.txt
+% guilt refresh
+Patch b.patch refreshed
+% guilt pop
+Now at a.patch.
+% guilt push
+Applying patch..b.patch
+Patch applied.
+% guilt graph
+digraph G {
+# checking rev c7014443c33d2b0237293687ceb9cbd38313df65
+	"c7014443c33d2b0237293687ceb9cbd38313df65" [label="b.patch"]
+# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d
+	"ff2775f8d1dc753f635830adcc3a067e0b681e2d" [label="a.patch"]
+}
+%% Changing a file already changed in the first patch adds a dependency.
+% guilt new c.patch
+% git add file.txt
+% guilt refresh
+Patch c.patch refreshed
+% guilt pop
+Now at b.patch.
+% guilt push
+Applying patch..c.patch
+Patch applied.
+% guilt graph
+digraph G {
+# checking rev 891bc14b5603474c9743fd04f3da888644413dc5
+	"891bc14b5603474c9743fd04f3da888644413dc5" [label="c.patch"]
+# checking rev c7014443c33d2b0237293687ceb9cbd38313df65
+	"c7014443c33d2b0237293687ceb9cbd38313df65" [label="b.patch"]
+# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d
+	"ff2775f8d1dc753f635830adcc3a067e0b681e2d" [label="a.patch"]
+	"891bc14b5603474c9743fd04f3da888644413dc5" -> "ff2775f8d1dc753f635830adcc3a067e0b681e2d"; // ?
+}
diff --git a/regression/t-033.sh b/regression/t-033.sh
index a3a8981..fac081e 100755
--- a/regression/t-033.sh
+++ b/regression/t-033.sh
@@ -3,6 +3,13 @@
 # Test the graph code
 #
 
+function fixup_time_info
+{
+	cmd guilt pop
+	touch -a -m -t "$TOUCH_DATE" ".git/patches/a,graph/$1"
+	cmd guilt push
+}
+
 source "$REG_DIR/scaffold"
 
 cmd setup_repo
@@ -11,3 +18,35 @@ cmd setup_repo
 # message when no patches are applied.  (An older version of guilt
 # used to enter an endless loop in this situation.)
 shouldfail guilt graph
+
+echo "%% Testing branch a,graph"
+cmd git checkout -b a,graph master
+
+cmd guilt init
+
+cmd guilt new a.patch
+
+fixup_time_info a.patch
+cmd guilt graph
+
+cmd echo a >> file.txt
+cmd git add file.txt
+cmd guilt refresh
+fixup_time_info a.patch
+cmd guilt graph
+
+echo "%% Adding an unrelated file in a new patch. No deps."
+cmd guilt new b.patch
+cmd echo b >> file2.txt
+cmd git add file2.txt
+cmd guilt refresh
+fixup_time_info b.patch
+cmd guilt graph
+
+echo "%% Changing a file already changed in the first patch adds a dependency."
+cmd guilt new c.patch
+cmd echo c >> file.txt
+cmd git add file.txt
+cmd guilt refresh
+fixup_time_info c.patch
+cmd guilt graph
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 20/33] "guilt graph": Handle patch names containing quotes.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (18 preceding siblings ...)
  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 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 21/33] The log.decorate setting should not influence import-commit Per Cederqvist
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Quote quotes with a backslash in the "guilt graph" output.  Otherwise,
the "dot" file could contain syntax errors.

Added a test case.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-graph          |  2 ++
 regression/t-033.out | 22 ++++++++++++++++++++++
 regression/t-033.sh  |  9 +++++++++
 3 files changed, 33 insertions(+)

diff --git a/guilt-graph b/guilt-graph
index 924a63e..0857e0d 100755
--- a/guilt-graph
+++ b/guilt-graph
@@ -57,6 +57,8 @@ while [ "$current" != "$base" ]; do
 }"`
 	[ -z "$pname" ] && pname="?"
 
+	pname="`printf \"%s\" \"$pname\" | sed 's/\"/\\\\\"/g'`"
+
 	disp "# checking rev $current"
 	disp "	\"$current\" [label=\"$pname\"]"
 
diff --git a/regression/t-033.out b/regression/t-033.out
index 3d1c61f..c120d4f 100644
--- a/regression/t-033.out
+++ b/regression/t-033.out
@@ -66,3 +66,25 @@ digraph G {
 	"ff2775f8d1dc753f635830adcc3a067e0b681e2d" [label="a.patch"]
 	"891bc14b5603474c9743fd04f3da888644413dc5" -> "ff2775f8d1dc753f635830adcc3a067e0b681e2d"; // ?
 }
+% guilt new a-"better&quicker'-patch.patch
+% git add file.txt
+% guilt refresh
+Patch a-"better&quicker'-patch.patch refreshed
+% guilt pop
+Now at c.patch.
+% guilt push
+Applying patch..a-"better&quicker'-patch.patch
+Patch applied.
+% guilt graph
+digraph G {
+# checking rev bc7df666a646739eaf559af23cab72f2bfd01f0e
+	"bc7df666a646739eaf559af23cab72f2bfd01f0e" [label="a-\"better&quicker'-patch.patch"]
+# checking rev 891bc14b5603474c9743fd04f3da888644413dc5
+	"891bc14b5603474c9743fd04f3da888644413dc5" [label="c.patch"]
+	"bc7df666a646739eaf559af23cab72f2bfd01f0e" -> "891bc14b5603474c9743fd04f3da888644413dc5"; // ?
+# checking rev c7014443c33d2b0237293687ceb9cbd38313df65
+	"c7014443c33d2b0237293687ceb9cbd38313df65" [label="b.patch"]
+# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d
+	"ff2775f8d1dc753f635830adcc3a067e0b681e2d" [label="a.patch"]
+	"891bc14b5603474c9743fd04f3da888644413dc5" -> "ff2775f8d1dc753f635830adcc3a067e0b681e2d"; // ?
+}
diff --git a/regression/t-033.sh b/regression/t-033.sh
index fac081e..9fe1827 100755
--- a/regression/t-033.sh
+++ b/regression/t-033.sh
@@ -50,3 +50,12 @@ cmd git add file.txt
 cmd guilt refresh
 fixup_time_info c.patch
 cmd guilt graph
+
+# A patch name that contains funky characters, including unbalanced
+# quotes.
+cmd guilt new "a-\"better&quicker'-patch.patch"
+cmd echo d >> file.txt
+cmd git add file.txt
+cmd guilt refresh
+fixup_time_info "a-\"better&quicker'-patch.patch"
+cmd guilt graph
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 21/33] The log.decorate setting should not influence import-commit.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (19 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 20/33] "guilt graph": Handle patch names containing quotes Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 22/33] The log.decorate setting should not influence patchbomb Per Cederqvist
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Use --no-decorate in the call to git log that tries to read the commit
message to produce patch names.  Otherwise, if the user has set
log.decorate to short or full, the patch name will be less useful.

Modify the t-034.sh test case to demonstrate that this is needed.

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 | 2 ++
 regression/t-034.sh  | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/guilt-import-commit b/guilt-import-commit
index 45f2404..1da7c8e 100755
--- a/guilt-import-commit
+++ b/guilt-import-commit
@@ -26,7 +26,7 @@ disp "About to begin conversion..." >&2
 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-`
+	s=`git log --no-decorate --pretty=oneline -1 $rev | cut -c 42-`
 
 	# Try to convert the first line of the commit message to a
 	# valid patch name.
diff --git a/regression/t-034.out b/regression/t-034.out
index bda4399..5d81bd4 100644
--- a/regression/t-034.out
+++ b/regression/t-034.out
@@ -232,6 +232,7 @@ Date:   Mon Jan 1 00:00:00 2007 +0000
     
     Signed-off-by: Commiter Name <commiter@email>
 % guilt init
+% git config log.decorate short
 % guilt import-commit base..HEAD
 About to begin conversion...
 Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541
@@ -259,6 +260,7 @@ Converting 45e81b51 as the_sequence_.lock-_is_forbidden
 Converting eebb76e9 as the_sequence_-._is_forbidden
 Done.
 Current head: d4850419ccc1146c7169f500725ce504b9774ed0
+% git config log.decorate no
 % guilt push -a
 Applying patch..the_sequence_-._is_forbidden.patch
 Patch applied.
diff --git a/regression/t-034.sh b/regression/t-034.sh
index f41f958..648d009 100755
--- a/regression/t-034.sh
+++ b/regression/t-034.sh
@@ -57,7 +57,9 @@ cmd git log
 
 # Import all the commits to guilt.
 cmd guilt init
+cmd git config log.decorate short
 cmd guilt import-commit base..HEAD
+cmd git config log.decorate no
 
 for patch in .git/patches/master/*.patch; do
 	touch -a -m -t "$TOUCH_DATE" "$patch"
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 22/33] The log.decorate setting should not influence patchbomb.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (20 preceding siblings ...)
  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 ` Per Cederqvist
  2014-05-18 21:59 ` [GUILT v4 23/33] The log.decorate setting should not influence guilt rebase Per Cederqvist
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-patchbomb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guilt-patchbomb b/guilt-patchbomb
index 1231418..164b10c 100755
--- a/guilt-patchbomb
+++ b/guilt-patchbomb
@@ -47,7 +47,7 @@ if [ $? -ne 0 ]; then
 fi
 
 # display the list of commits to be sent as patches
-git log --pretty=oneline "$r" | cut -c 1-8,41- | $pager
+git log --no-decorate --pretty=oneline "$r" | cut -c 1-8,41- | $pager
 
 _disp "Are these what you want to send? [Y/n] "
 read n
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 23/33] The log.decorate setting should not influence guilt rebase.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (21 preceding siblings ...)
  2014-05-18 21:59 ` [GUILT v4 22/33] The log.decorate setting should not influence patchbomb Per Cederqvist
@ 2014-05-18 21:59 ` Per Cederqvist
  2014-05-18 22:00 ` [GUILT v4 24/33] disp no longer processes backslashes Per Cederqvist
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-rebase | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guilt-rebase b/guilt-rebase
index fd28e48..a1714a0 100755
--- a/guilt-rebase
+++ b/guilt-rebase
@@ -66,7 +66,7 @@ pop_all_patches
 git merge --no-commit $upstream > /dev/null 2> /dev/null
 
 disp ""
-log=`git log -1 --pretty=oneline`
+log=`git log -1 --no-decorate --pretty=oneline`
 disp "HEAD is now at `echo $log | cut -c 1-7`... `echo "$log" | cut -c 41-`"
 
 #
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 24/33] disp no longer processes backslashes.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (22 preceding siblings ...)
  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 ` 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
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Only one invocation of "disp" or "_disp" actually needed backslash
processing.  In quite a few instances, it was wrong to do backslash
processing, as the message contained data derived from the user.

Created the new function "disp_e" that should be used when backslash
processing is required, and changed "disp" and "_disp" to use printf
code "%s" instead of "%b".

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/guilt b/guilt
index 9567a78..0500500 100755
--- a/guilt
+++ b/guilt
@@ -36,15 +36,24 @@ usage()
 	exit 1
 }
 
-# echo -n is a bashism, use printf instead
+# Print arguments, but no trailing newline.
+# (echo -n is a bashism, use printf instead)
 _disp()
 {
-	printf "%b" "$*"
+	printf "%s" "$*"
 }
 
-# echo -e is a bashism, use printf instead
+# Print arguments.
+# (echo -E is a bashism, use printf instead)
 disp()
 {
+	printf "%s\n" "$*"
+}
+
+# Print arguments, processing backslash sequences.
+# (echo -e is a bashism, use printf instead)
+disp_e()
+{
 	printf "%b\n" "$*"
 }
 
@@ -117,7 +126,7 @@ else
 
 	disp ""
 	disp "Example:"
-	disp "\tguilt push"
+	disp_e "\tguilt push"
 
 	# now, let's exit
 	exit 1
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 25/33] "guilt push" now fails when there are no more patches to push.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (23 preceding siblings ...)
  2014-05-18 22:00 ` [GUILT v4 24/33] disp no longer processes backslashes Per Cederqvist
@ 2014-05-18 22:00 ` 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
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

This makes it easier to script operations on the entire queue, for
example run the test suite on each patch in the queue:

    guilt pop -a;while guilt push; do make test||break; done

This brings "guilt push" in line with the push operation in Mercurial
Queues (hg qpush), which fails when there are no patches to apply.

Updated the test suite.

"guilt push -a" still does not fail.  (It successfully manages to
ensure that all patches are pushed, even if it did not have to do
anything to make it so.)

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-push           | 19 ++++++-----
 regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 regression/t-020.sh  | 13 +++++++-
 3 files changed, 113 insertions(+), 8 deletions(-)

diff --git a/guilt-push b/guilt-push
index 67687e7..39c125e 100755
--- a/guilt-push
+++ b/guilt-push
@@ -56,6 +56,12 @@ fi
 patch="$1"
 [ ! -z "$all" ] && patch="-a"
 
+# Treat "guilt push" as "guilt push -n 1".
+if [ -z "$patch" ]; then
+	patch=1
+	num=t
+fi
+
 if [ "$patch" = "-a" ]; then
 	# we are supposed to push all patches, get the last one out of
 	# series
@@ -65,7 +71,7 @@ if [ "$patch" = "-a" ]; then
 		die "There are no patches to push."
 	fi
 elif [ ! -z "$num" ]; then
-	# we are supposed to pop a set number of patches
+	# we are supposed to push a set number of patches
 
 	[ "$patch" -lt 0 ] && die "Invalid number of patches to push."
 
@@ -78,11 +84,6 @@ elif [ ! -z "$num" ]; then
 	# clamp to minimum
 	[ $tidx -lt $eidx ] && eidx=$tidx
 
-elif [ -z "$patch" ]; then
-	# we are supposed to push only the next patch onto the stack
-
-	eidx=`wc -l < "$applied"`
-	eidx=`expr $eidx + 1`
 else
 	# we're supposed to push only up to a patch, make sure the patch is
 	# in the series
@@ -109,7 +110,11 @@ if [ "$sidx" -gt "$eidx" ]; then
 	else
 		disp "File series fully applied, ends at patch `get_series | tail -n 1`"
 	fi
-	exit 0
+	if [ -n "$all" ]; then
+		exit 0
+	else
+		exit 1
+	fi
 fi
 
 get_series | sed -n -e "${sidx},${eidx}p" | while read p
diff --git a/regression/t-020.out b/regression/t-020.out
index 42433dc..bcb8797 100644
--- a/regression/t-020.out
+++ b/regression/t-020.out
@@ -270,6 +270,95 @@ index 0000000..8baef1b
 +++ b/def
 @@ -0,0 +1 @@
 +abc
+% guilt push
+File series fully applied, ends at patch mode
+% guilt push -a
+File series fully applied, ends at patch mode
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
+% git log -p
+commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    patch mode
+
+diff --git a/def b/def
+old mode 100644
+new mode 100755
+
+commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    patch remove
+
+diff --git a/abd b/abd
+deleted file mode 100644
+index fd3896d..0000000
+--- a/abd
++++ /dev/null
+@@ -1 +0,0 @@
+-‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
+\ No newline at end of file
+
+commit 37d588cc39848368810e88332bd03b083f2ce3ac
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    patch add
+
+diff --git a/abd b/abd
+new file mode 100644
+index 0000000..fd3896d
+--- /dev/null
++++ b/abd
+@@ -0,0 +1 @@
++‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
+\ No newline at end of file
+
+commit 33633e7a1aa31972f125878baf7807be57b1672d
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    patch modify
+
+diff --git a/def b/def
+index 8baef1b..7d69c2f 100644
+--- a/def
++++ b/def
+@@ -1 +1,2 @@
+ abc
++asjhfksad
+
+commit d4850419ccc1146c7169f500725ce504b9774ed0
+Author: Author Name <author@email>
+Date:   Mon Jan 1 00:00:00 2007 +0000
+
+    initial
+    
+    Signed-off-by: Commiter Name <commiter@email>
+
+diff --git a/def b/def
+new file mode 100644
+index 0000000..8baef1b
+--- /dev/null
++++ b/def
+@@ -0,0 +1 @@
++abc
 % guilt pop --all
 All patches popped.
 % guilt push
diff --git a/regression/t-020.sh b/regression/t-020.sh
index c165884..3f70c26 100755
--- a/regression/t-020.sh
+++ b/regression/t-020.sh
@@ -26,6 +26,17 @@ guilt series | while read n ; do
 done
 
 #
+# pushing when there is nothing to push
+#
+
+shouldfail guilt push
+cmd guilt push -a
+
+cmd list_files
+
+cmd git log -p
+
+#
 # pop all
 #
 cmd guilt pop --all
@@ -61,7 +72,7 @@ cmd guilt pop --all
 
 npatches=`guilt series | wc -l`
 for n in `_seq -2 $npatches`; do
-	if [ $n -ge 0 ]; then
+	if [ $n -gt 0 ]; then
 		cmd guilt push -n $n
 	else
 		shouldfail guilt push -n $n
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 26/33] "guilt pop" now fails when there are no more patches to pop.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (24 preceding siblings ...)
  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 ` Per Cederqvist
  2014-05-18 22:00 ` [GUILT v4 27/33] Minor testsuite fix Per Cederqvist
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

This is analogous to how "guilt push" now fails when there are no more
patches to push.  Like push, the "--all" argument still succeeds even
if there was no need to pop anything.

Updated the test suite.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt-pop            | 17 +++++++++++------
 regression/t-021.out |  2 ++
 regression/t-021.sh  |  6 ++++++
 regression/t-061.sh  |  6 +++++-
 4 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/guilt-pop b/guilt-pop
index f0e647f..191313e 100755
--- a/guilt-pop
+++ b/guilt-pop
@@ -49,9 +49,19 @@ fi
 patch="$1"
 [ ! -z "$all" ] && patch="-a"
 
+# Treat "guilt pop" as "guilt pop -n 1".
+if [ -z "$patch" ]; then
+	patch=1
+	num=t
+fi
+
 if [ ! -s "$applied" ]; then
 	disp "No patches applied."
-	exit 0
+	if [ "$patch" = "-a" ]; then
+		exit 0
+	else
+		exit 1
+	fi
 elif [ "$patch" = "-a" ]; then
 	# we are supposed to pop all patches
 
@@ -68,11 +78,6 @@ elif [ ! -z "$num" ]; then
 	# catch underflow
 	[ $eidx -lt 0 ] && eidx=0
 	[ $eidx -eq $sidx ] && die "No patches requested to be removed."
-elif [ -z "$patch" ]; then
-	# we are supposed to pop only the current patch on the stack
-
-	sidx=`wc -l < "$applied"`
-	eidx=`expr $sidx - 1`
 else
 	# we're supposed to pop only up to a patch, make sure the patch is
 	# in the series
diff --git a/regression/t-021.out b/regression/t-021.out
index 9b42d9c..58be12f 100644
--- a/regression/t-021.out
+++ b/regression/t-021.out
@@ -287,6 +287,8 @@ index 0000000..8baef1b
 +++ b/def
 @@ -0,0 +1 @@
 +abc
+% guilt pop
+No patches applied.
 % guilt push --all
 Applying patch..modify
 Patch applied.
diff --git a/regression/t-021.sh b/regression/t-021.sh
index 614e870..e0d2dc1 100755
--- a/regression/t-021.sh
+++ b/regression/t-021.sh
@@ -23,6 +23,12 @@ guilt series | _tac | while read n ; do
 done
 
 #
+# pop when there is nothing to pop
+#
+
+shouldfail guilt pop
+
+#
 # push all
 #
 cmd guilt push --all
diff --git a/regression/t-061.sh b/regression/t-061.sh
index 1411baa..6192f1b 100755
--- a/regression/t-061.sh
+++ b/regression/t-061.sh
@@ -48,7 +48,11 @@ cmd list_files
 
 for i in `seq 5`
 do
-	cmd guilt pop
+	if [ $i -ge 5 ]; then
+		shouldfail guilt pop
+	else
+		cmd guilt pop
+	fi
 	cmd git for-each-ref
 	cmd guilt push
 	cmd git for-each-ref
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 27/33] Minor testsuite fix.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (25 preceding siblings ...)
  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 ` Per Cederqvist
  2014-05-18 22:00 ` [GUILT v4 28/33] Fix coding style errors in t-061.sh Per Cederqvist
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Fix remove_topic() in t-061.sh so that it doesn't print a git hash.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-061.out | 1 -
 regression/t-061.sh  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/regression/t-061.out b/regression/t-061.out
index ef0f335..60ad56d 100644
--- a/regression/t-061.out
+++ b/regression/t-061.out
@@ -381,7 +381,6 @@ ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/master/mode
 ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
 % guilt pop -a
 No patches applied.
-ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
 % git checkout guilt/master
 Switched to branch "guilt/master"
 % guilt pop -a
diff --git a/regression/t-061.sh b/regression/t-061.sh
index 6192f1b..db26e12 100755
--- a/regression/t-061.sh
+++ b/regression/t-061.sh
@@ -15,7 +15,7 @@ old_style_branch() {
 
 remove_topic() {
 	cmd guilt pop -a
-	if git rev-parse --verify --quiet guilt/master
+	if git rev-parse --verify --quiet guilt/master >/dev/null
 	then
 		cmd git checkout guilt/master
 	else
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 28/33] Fix coding style errors in t-061.sh.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (26 preceding siblings ...)
  2014-05-18 22:00 ` [GUILT v4 27/33] Minor testsuite fix Per Cederqvist
@ 2014-05-18 22:00 ` Per Cederqvist
  2014-05-18 22:00 ` [GUILT v4 29/33] Added guilt.reusebranch configuration option Per Cederqvist
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-061.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/regression/t-061.sh b/regression/t-061.sh
index db26e12..bda50c7 100755
--- a/regression/t-061.sh
+++ b/regression/t-061.sh
@@ -15,8 +15,7 @@ old_style_branch() {
 
 remove_topic() {
 	cmd guilt pop -a
-	if git rev-parse --verify --quiet guilt/master >/dev/null
-	then
+	if git rev-parse --verify --quiet guilt/master >/dev/null; then
 		cmd git checkout guilt/master
 	else
 		cmd git checkout master
@@ -46,8 +45,7 @@ cmd git for-each-ref
 
 cmd list_files
 
-for i in `seq 5`
-do
+for i in `seq 5`; do
 	if [ $i -ge 5 ]; then
 		shouldfail guilt pop
 	else
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 29/33] Added guilt.reusebranch configuration option.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (27 preceding siblings ...)
  2014-05-18 22:00 ` [GUILT v4 28/33] Fix coding style errors in t-061.sh Per Cederqvist
@ 2014-05-18 22:00 ` Per Cederqvist
  2014-05-18 22:00 ` [GUILT v4 30/33] Added a short style guide, and Emacs settings Per Cederqvist
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

When the option is true, Guilt does not create a new Git branch when
patches are applied.  This way, you can switch between Guilt 0.35 and
the current version of Guilt with no issues.

By default, the option is false, so that all users will immediately
get the added protection against pushing a branch upstream with a
patch applied.  While this might break guilt if a user is running both
version 0.35 and the current version against the same local
repository, it will not lead to data loss, and that situation is
probably rare.

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 guilt                |  24 ++-
 regression/scaffold  |   1 +
 regression/t-062.out | 420 +++++++++++++++++++++++++++++++++++++++++++++++++++
 regression/t-062.sh  | 130 ++++++++++++++++
 4 files changed, 569 insertions(+), 6 deletions(-)
 create mode 100644 regression/t-062.out
 create mode 100755 regression/t-062.sh

diff --git a/guilt b/guilt
index 0500500..ea9d131 100755
--- a/guilt
+++ b/guilt
@@ -884,6 +884,9 @@ guilt_push_diff_context=1
 # default diffstat value: true or false
 DIFFSTAT_DEFAULT="false"
 
+# default guilt.reusebranch value: true or false
+REUSE_BRANCH_DEFAULT="false"
+
 # Prefix for guilt branches.
 GUILT_PREFIX=guilt/
 
@@ -895,6 +898,10 @@ GUILT_PREFIX=guilt/
 diffstat=`git config --bool guilt.diffstat`
 [ -z "$diffstat" ] && diffstat=$DIFFSTAT_DEFAULT
 
+# reuse Git branch?
+reuse_branch=`git config --bool guilt.reusebranch`
+[ -z "$reuse_branch" ] && reuse_branch=$REUSE_BRANCH_DEFAULT
+
 #
 # The following gets run every time this file is source'd
 #
@@ -959,13 +966,18 @@ else
 	die "Unsupported operating system: $UNAME_S"
 fi
 
-if [ "$branch" = "$raw_git_branch" ] && [ -n "`get_top 2>/dev/null`" ]
-then
-    # This is for compat with old repositories that still have a
-    # pushed patch without the new-style branch prefix.
-    old_style_prefix=true
+if [ -n "`get_top 2>/dev/null`" ]; then
+	# If there is at least one pushed patch, we set
+	# old_style_prefix according to how it was pushed.  It is only
+	# possible to change the prefix style while no patches are
+	# applied.
+	if [ "$branch" = "$raw_git_branch" ]; then
+		old_style_prefix=true
+	else
+		old_style_prefix=false
+	fi
 else
-    old_style_prefix=false
+	old_style_prefix="$reuse_branch"
 fi
 
 _main "$@"
diff --git a/regression/scaffold b/regression/scaffold
index 2e04c83..b3135be 100644
--- a/regression/scaffold
+++ b/regression/scaffold
@@ -97,6 +97,7 @@ function setup_git_repo
 	git config log.date default
 	git config log.decorate no
 	git config guilt.diffstat false
+	git config guilt.reusebranch false
 }
 
 function setup_guilt_repo
diff --git a/regression/t-062.out b/regression/t-062.out
new file mode 100644
index 0000000..ad5c081
--- /dev/null
+++ b/regression/t-062.out
@@ -0,0 +1,420 @@
+% setup_repo
+% git config guilt.reusebranch true
+% guilt push -a
+Applying patch..modify
+Patch applied.
+Applying patch..add
+Patch applied.
+Applying patch..remove
+Patch applied.
+Applying patch..mode
+Patch applied.
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
+% git for-each-ref
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/master/mode
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+% guilt pop
+Now at remove.
+% git for-each-ref
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+% guilt push
+Applying patch..mode
+Patch applied.
+% git for-each-ref
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/master/mode
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+% guilt pop
+Now at remove.
+% git for-each-ref
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+% guilt pop
+Now at add.
+% git for-each-ref
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+% guilt push
+Applying patch..remove
+Patch applied.
+% git for-each-ref
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+% guilt pop
+Now at add.
+% git for-each-ref
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+% guilt pop
+Now at modify.
+% git for-each-ref
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/heads/master
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+% guilt push
+Applying patch..add
+Patch applied.
+% git for-each-ref
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+% guilt pop
+Now at modify.
+% git for-each-ref
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/heads/master
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+% guilt pop
+All patches popped.
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% guilt push
+Applying patch..modify
+Patch applied.
+% git for-each-ref
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/heads/master
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+% guilt pop
+All patches popped.
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% guilt pop
+No patches applied.
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% guilt push
+Applying patch..modify
+Patch applied.
+% git for-each-ref
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/heads/master
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+% guilt pop
+All patches popped.
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% guilt push -a
+Applying patch..modify
+Patch applied.
+Applying patch..add
+Patch applied.
+Applying patch..remove
+Patch applied.
+Applying patch..mode
+Patch applied.
+% git for-each-ref
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/master/mode
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+% guilt pop -a
+All patches popped.
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% guilt push add
+Applying patch..modify
+Patch applied.
+Applying patch..add
+Patch applied.
+% git for-each-ref
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+% guilt branch topic
+Switched to branch "topic"
+% git for-each-ref
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/heads/master
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/heads/topic
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/topic/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/topic/modify
+% guilt pop -a
+All patches popped.
+% guilt push
+Applying patch..modify
+Patch applied.
+% git for-each-ref
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/heads/master
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/heads/topic
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/topic/modify
+% guilt pop -a
+All patches popped.
+% git checkout master
+Switched to branch "master"
+% guilt pop -a
+All patches popped.
+% git branch -d topic
+Deleted branch topic (was d485041).
+% rm -r .git/patches/topic
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/topic
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+% guilt push -a
+Applying patch..modify
+Patch applied.
+Applying patch..add
+Patch applied.
+Applying patch..remove
+Patch applied.
+Applying patch..mode
+Patch applied.
+% guilt branch topic
+Switched to branch "topic"
+% git for-each-ref
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/heads/master
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/heads/topic
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/master/mode
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/topic/add
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/topic/mode
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/topic/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/topic/remove
+% guilt pop -a
+All patches popped.
+% git checkout master
+Switched to branch "master"
+% guilt pop -a
+All patches popped.
+% git branch -d topic
+Deleted branch topic (was d485041).
+% rm -r .git/patches/topic
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/topic
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+% guilt branch topic
+Switched to branch "topic"
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/topic
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/topic
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/topic
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/topic/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/topic/remove
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/topic/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/topic/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/topic/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/topic/status
+% guilt pop -a
+No patches applied.
+% git checkout master
+Switched to branch "master"
+% guilt pop -a
+No patches applied.
+% git branch -d topic
+Deleted branch topic (was d485041).
+% rm -r .git/patches/topic
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/topic
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+% guilt push -a
+Applying patch..modify
+Patch applied.
+Applying patch..add
+Patch applied.
+Applying patch..remove
+Patch applied.
+Applying patch..mode
+Patch applied.
+% guilt branch topic
+Switched to branch "topic"
+% git for-each-ref
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/heads/master
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/heads/topic
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/master/mode
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/topic/add
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/topic/mode
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/topic/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/topic/remove
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/topic
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/topic
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/topic/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/topic/remove
+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/master/status
+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/topic/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/topic/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/topic/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/topic/modify
+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/topic/modify
+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/topic/add
+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/topic/mode
+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/topic/remove
+% guilt pop -a
+All patches popped.
+% git for-each-ref
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/heads/master
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/topic
+37d588cc39848368810e88332bd03b083f2ce3ac commit	refs/patches/master/add
+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit	refs/patches/master/mode
+33633e7a1aa31972f125878baf7807be57b1672d commit	refs/patches/master/modify
+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit	refs/patches/master/remove
+% guilt pop -a
+No patches applied.
+% git checkout master
+Switched to branch "master"
+% guilt pop -a
+All patches popped.
+% git branch -d topic
+Deleted branch topic (was d485041).
+% rm -r .git/patches/topic
+% git for-each-ref
+d4850419ccc1146c7169f500725ce504b9774ed0 commit	refs/heads/master
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/topic
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
+% guilt new newpatch
+% git for-each-ref --format=%(refname)
+refs/heads/master
+refs/patches/master/newpatch
+% guilt pop
+All patches popped.
+% guilt push
+Applying patch..newpatch
+Patch applied.
+% git for-each-ref
+25465dc1687f3833ecbd4e8bca437e522d7026db commit	refs/heads/master
+25465dc1687f3833ecbd4e8bca437e522d7026db commit	refs/patches/master/newpatch
+% git branch
+* master
+% guilt applied
+newpatch
+% guilt commit -a
+% git for-each-ref
+25465dc1687f3833ecbd4e8bca437e522d7026db commit	refs/heads/master
+% git branch
+* master
+% guilt push -a
+Applying patch..modify
+Patch applied.
+Applying patch..add
+Patch applied.
+Applying patch..remove
+Patch applied.
+Applying patch..mode
+Patch applied.
+% guilt applied
+modify
+add
+remove
+mode
+% git branch
+* master
+% git for-each-ref
+fefbdcef61022d473838926619f31e030dd04fdc commit	refs/heads/master
+5effcbeb303e8433935151d8c69f3bf63db1e8ef commit	refs/patches/master/add
+fefbdcef61022d473838926619f31e030dd04fdc commit	refs/patches/master/mode
+9509f22e2e627756d87b42432931c45955b74234 commit	refs/patches/master/modify
+9cbe2fc643b1a9e2179a8738f80424a1c2aa202d commit	refs/patches/master/remove
+% guilt commit -n 2
+% git for-each-ref
+fefbdcef61022d473838926619f31e030dd04fdc commit	refs/heads/master
+fefbdcef61022d473838926619f31e030dd04fdc commit	refs/patches/master/mode
+9cbe2fc643b1a9e2179a8738f80424a1c2aa202d commit	refs/patches/master/remove
+% git branch
+* master
+% guilt commit -n 2
+% git for-each-ref
+fefbdcef61022d473838926619f31e030dd04fdc commit	refs/heads/master
+% git branch
+* master
+% guilt series
diff --git a/regression/t-062.sh b/regression/t-062.sh
new file mode 100755
index 0000000..7656766
--- /dev/null
+++ b/regression/t-062.sh
@@ -0,0 +1,130 @@
+#!/bin/bash
+#
+# Test that the guilt.reusebranch=true setting works.
+#
+
+source $REG_DIR/scaffold
+
+remove_topic() {
+	cmd guilt pop -a
+	if git rev-parse --verify --quiet guilt/master >/dev/null; then
+		cmd git checkout guilt/master
+	else
+		cmd git checkout master
+	fi
+	cmd guilt pop -a
+	cmd git branch -d $1
+	cmd rm -r .git/patches/$1
+	cmd git for-each-ref
+	cmd list_files
+}
+
+function fixup_time_info
+{
+	touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
+}
+
+cmd setup_repo
+
+cmd git config guilt.reusebranch true
+
+cmd guilt push -a
+cmd list_files
+cmd git for-each-ref
+
+for i in `seq 5`; do
+	if [ $i -ge 5 ]; then
+		shouldfail guilt pop
+	else
+		cmd guilt pop
+	fi
+	cmd git for-each-ref
+	cmd guilt push
+	cmd git for-each-ref
+	cmd guilt pop
+	cmd git for-each-ref
+done
+
+# Check that "pop -a" properly pops all patches.
+cmd guilt push -a
+cmd git for-each-ref
+cmd guilt pop -a
+cmd git for-each-ref
+
+# Check that pushing two patches converts the repo to now-style (since
+# it currently has no patches applied).
+cmd guilt push add
+cmd git for-each-ref
+
+# Check guilt branch with a few patches applied.
+cmd guilt branch topic
+cmd git for-each-ref
+
+# Check that the topic branch is converted to new-style.
+cmd guilt pop -a
+cmd guilt push
+cmd git for-each-ref
+
+remove_topic topic
+
+# Check guilt branch with the full patch series applied.
+cmd guilt push -a
+cmd guilt branch topic
+cmd git for-each-ref
+
+remove_topic topic
+
+# Check guilt branch with no patches applied.
+# This gives us a new-style checkout.
+cmd guilt branch topic
+cmd git for-each-ref
+cmd list_files
+
+remove_topic topic
+
+# Check guilt branch in a new-style directory with all patches
+# applied.  (Strictly speaking, this test should probably move to a
+# file devoted to testing "guilt branch".)
+cmd guilt push -a
+cmd guilt branch topic
+cmd git for-each-ref
+cmd list_files
+cmd guilt pop -a
+cmd git for-each-ref
+
+remove_topic topic
+
+# Check that "guilt new" does the right thing when no patches are
+# applied.  (Strictly speaking, this test should maybe move to
+# t-025.sh).
+
+cmd guilt new newpatch
+cmd git for-each-ref '--format=%(refname)'
+cmd guilt pop
+fixup_time_info newpatch
+cmd guilt push
+cmd git for-each-ref
+
+# Check that "guilt commit" does the right thing when committing all
+# applied patches.  (Strictly speaking, this test should maybe move to
+# t-030.sh).
+cmd git branch
+cmd guilt applied
+cmd guilt commit -a
+cmd git for-each-ref
+cmd git branch
+
+# Check that "guilt commit" does the right thing when committing only
+# a few of the applied patches.  (Strictly speaking, this test should
+# maybe move to t-030.sh).
+cmd guilt push -a
+cmd guilt applied
+cmd git branch
+cmd git for-each-ref
+cmd guilt commit -n 2
+cmd git for-each-ref
+cmd git branch
+cmd guilt commit -n 2
+cmd git for-each-ref
+cmd git branch
+cmd guilt series
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 30/33] Added a short style guide, and Emacs settings.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (28 preceding siblings ...)
  2014-05-18 22:00 ` [GUILT v4 29/33] Added guilt.reusebranch configuration option Per Cederqvist
@ 2014-05-18 22:00 ` Per Cederqvist
  2014-05-18 22:00 ` [GUILT v4 31/33] Don't use "git log -p" in the test suite Per Cederqvist
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 .dir-locals.el             |  3 +++
 Documentation/Contributing | 15 +++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 .dir-locals.el

diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 0000000..50ef2b7
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,3 @@
+((nil . ((indent-tabs-mode . t)
+	 (tab-width . 8)))
+ (sh-mode . ((sh-basic-offset . 8))))
diff --git a/Documentation/Contributing b/Documentation/Contributing
index abf3480..0da49d6 100644
--- a/Documentation/Contributing
+++ b/Documentation/Contributing
@@ -4,6 +4,21 @@ Documentation/SubmittingPatches file. :)
 
 1) Hack on the code a bit
 
+Please follow this style guide:
+
+ - Use tabs for indentation.
+
+ - Put "then" on the same line as "if".
+
+ - Follow the style of the existing code, except if it breaks the
+   above guidlines.
+
+ - If you change the code to conform to the style guide, please do so
+   in a separate commit that does not change anything else.
+
+Please check that you change does not break "make test".  Please add
+new testcases for any new functionality, and if you fix a bug.
+
 2) Make a patch:
 
 Use "diff -up" or "diff -uprN" to create patches. Or simply use git to
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 31/33] Don't use "git log -p" in the test suite.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (29 preceding siblings ...)
  2014-05-18 22:00 ` [GUILT v4 30/33] Added a short style guide, and Emacs settings Per Cederqvist
@ 2014-05-18 22:00 ` Per Cederqvist
  2014-05-18 22:00 ` [GUILT v4 32/33] Improved doc and tests for guilt header Per Cederqvist
  2014-05-18 22:00 ` [GUILT v4 33/33] Document the exit status of guilt push and guilt pop Per Cederqvist
  32 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

The exact format of "git log -p" may change due to user configuration,
and even if the test suite can try to set all configuration that
influences the format explicitly it is hard to guard against future
changes in git.  Since we already run "cmd list_files" immediately
before all instances of running "git log -p", we are still assured
that the history contains what we expect.

There was one instance in t-021.sh where "cmd git log -p" were not
preceded by "cmd list_files".

Signed-off-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
---
 regression/t-020.out | 1000 --------------------------------------------------
 regression/t-020.sh  |   16 -
 regression/t-021.out |  899 +--------------------------------------------
 regression/t-021.sh  |   10 +-
 4 files changed, 16 insertions(+), 1909 deletions(-)

diff --git a/regression/t-020.out b/regression/t-020.out
index bcb8797..5d7c918 100644
--- a/regression/t-020.out
+++ b/regression/t-020.out
@@ -14,36 +14,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push
 Applying patch..add
 Patch applied.
@@ -60,51 +30,6 @@ f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
-% git log -p
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push
 Applying patch..remove
 Patch applied.
@@ -122,66 +47,6 @@ f f322f08d907e3737a4321b0ec90bc545f71af7cf  .git/patches/master/status
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push
 Applying patch..mode
 Patch applied.
@@ -200,76 +65,6 @@ r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch mode
-
-diff --git a/def b/def
-old mode 100644
-new mode 100755
-
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push
 File series fully applied, ends at patch mode
 % guilt push -a
@@ -289,76 +84,6 @@ r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch mode
-
-diff --git a/def b/def
-old mode 100644
-new mode 100755
-
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push
@@ -376,36 +101,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push
@@ -423,36 +118,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push
@@ -470,36 +135,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push
@@ -517,36 +152,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push
@@ -564,36 +169,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push
 Applying patch..add
 Patch applied.
@@ -610,51 +185,6 @@ f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
-% git log -p
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push
 Applying patch..remove
 Patch applied.
@@ -672,66 +202,6 @@ f f322f08d907e3737a4321b0ec90bc545f71af7cf  .git/patches/master/status
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push
 Applying patch..mode
 Patch applied.
@@ -750,76 +220,6 @@ r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch mode
-
-diff --git a/def b/def
-old mode 100644
-new mode 100755
-
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push -n -2
@@ -835,22 +235,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
-% git log -p
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 No patches applied.
 % guilt push -n -1
@@ -866,22 +250,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
-% git log -p
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 No patches applied.
 % guilt push -n 0
@@ -897,22 +265,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
-% git log -p
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 No patches applied.
 % guilt push -n 1
@@ -930,36 +282,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push -n 2
@@ -980,51 +302,6 @@ f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
-% git log -p
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push -n 3
@@ -1048,66 +325,6 @@ f f322f08d907e3737a4321b0ec90bc545f71af7cf  .git/patches/master/status
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % guilt push -n 4
@@ -1134,76 +351,6 @@ r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch mode
-
-diff --git a/def b/def
-old mode 100644
-new mode 100755
-
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop --all
 All patches popped.
 % list_files
@@ -1236,28 +383,6 @@ f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch
 f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
 r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch
-% git log -p
-commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch empty.patch
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % git config guilt.diffstat true
 % guilt refresh
 Patch empty.patch refreshed
@@ -1280,28 +405,6 @@ f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch~
 f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
 r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch
-% git log -p
-commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch empty.patch
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % git config guilt.diffstat false
 % guilt pop
 All patches popped.
@@ -1322,35 +425,6 @@ f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch~
 f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
 r 8ed27228b117c0c88abf3d586bcc43c68e975cea  .git/refs/patches/master/empty.patch
-% git log -p
-commit 8ed27228b117c0c88abf3d586bcc43c68e975cea
-Author: Per Cederqvist <ceder@lysator.liu.se>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    Fix a bug.
-    
-    This commit fixes a serious bug.
-    
-    FIXME:
-        - add a test case
-        - track down the bug
-        - actually fix it
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % git config guilt.diffstat true
 % guilt refresh
 Patch empty.patch refreshed
@@ -1373,35 +447,6 @@ f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
 f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
 r 8ed27228b117c0c88abf3d586bcc43c68e975cea  .git/refs/patches/master/empty.patch
-% git log -p
-commit 8ed27228b117c0c88abf3d586bcc43c68e975cea
-Author: Per Cederqvist <ceder@lysator.liu.se>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    Fix a bug.
-    
-    This commit fixes a serious bug.
-    
-    FIXME:
-        - add a test case
-        - track down the bug
-        - actually fix it
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % git config guilt.diffstat false
 % guilt refresh
 Patch empty.patch refreshed
@@ -1424,35 +469,6 @@ f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series
 f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status
 r 8ed27228b117c0c88abf3d586bcc43c68e975cea  .git/refs/patches/master/empty.patch
-% git log -p
-commit 8ed27228b117c0c88abf3d586bcc43c68e975cea
-Author: Per Cederqvist <ceder@lysator.liu.se>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    Fix a bug.
-    
-    This commit fixes a serious bug.
-    
-    FIXME:
-        - add a test case
-        - track down the bug
-        - actually fix it
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt delete empty.patch
 Cannot delete an applied patch
 % guilt pop -a
@@ -1470,19 +486,3 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
-% git log -p
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
diff --git a/regression/t-020.sh b/regression/t-020.sh
index 3f70c26..2f2aa10 100755
--- a/regression/t-020.sh
+++ b/regression/t-020.sh
@@ -21,8 +21,6 @@ guilt series | while read n ; do
 	cmd guilt push
 
 	cmd list_files
-
-	cmd git log -p
 done
 
 #
@@ -34,8 +32,6 @@ cmd guilt push -a
 
 cmd list_files
 
-cmd git log -p
-
 #
 # pop all
 #
@@ -49,8 +45,6 @@ guilt series | while read n ; do
 
 	cmd list_files
 
-	cmd git log -p
-
 	cmd guilt pop --all
 done
 
@@ -61,8 +55,6 @@ guilt series | while read n ; do
 	cmd guilt push $t
 
 	cmd list_files
-
-	cmd git log -p
 done
 
 #
@@ -80,8 +72,6 @@ for n in `_seq -2 $npatches`; do
 
 	cmd list_files
 
-	cmd git log -p
-
 	cmd guilt pop --all
 done
 
@@ -91,14 +81,12 @@ cmd list_files
 cmd guilt new empty.patch
 fixup_time_info empty.patch
 cmd list_files
-cmd git log -p
 
 # Ensure we can push the empty patch even when guilt.diffstat is true.
 cmd git config guilt.diffstat true
 cmd guilt refresh
 fixup_time_info empty.patch
 cmd list_files
-cmd git log -p
 cmd git config guilt.diffstat false
 
 # Let the patch have a commit message, but no data.
@@ -117,7 +105,6 @@ EOF
 
 fixup_time_info empty.patch
 cmd list_files
-cmd git log -p
 
 # And once more, with an empty diffstat.
 
@@ -125,20 +112,17 @@ cmd git config guilt.diffstat true
 cmd guilt refresh
 fixup_time_info empty.patch
 cmd list_files
-cmd git log -p
 
 # Restore the diffstat setting and remove the empty patch.
 cmd git config guilt.diffstat false
 cmd guilt refresh
 fixup_time_info empty.patch
 cmd list_files
-cmd git log -p
 # (Cannot delete an applied patch)
 shouldfail guilt delete empty.patch
 cmd guilt pop -a
 cmd guilt delete -f empty.patch
 cmd list_files
-cmd git log -p
 
 # FIXME:
 #   --all
diff --git a/regression/t-021.out b/regression/t-021.out
index 58be12f..32dae17 100644
--- a/regression/t-021.out
+++ b/regression/t-021.out
@@ -8,76 +8,21 @@ Applying patch..remove
 Patch applied.
 Applying patch..mode
 Patch applied.
-% git log -p
-commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch mode
-
-diff --git a/def b/def
-old mode 100644
-new mode 100755
-
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/refs/patches
+d .git/refs/patches/master
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
 % guilt pop
 Now at remove.
 % list_files
@@ -94,66 +39,6 @@ f f322f08d907e3737a4321b0ec90bc545f71af7cf  .git/patches/master/status
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop
 Now at add.
 % list_files
@@ -169,51 +54,6 @@ f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
-% git log -p
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop
 Now at modify.
 % list_files
@@ -228,36 +68,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop
 All patches popped.
 % list_files
@@ -271,22 +81,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
-% git log -p
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop
 No patches applied.
 % guilt push --all
@@ -314,66 +108,6 @@ f f322f08d907e3737a4321b0ec90bc545f71af7cf  .git/patches/master/status
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..mode
 Patch applied.
@@ -392,51 +126,6 @@ f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
-% git log -p
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..remove
 Patch applied.
@@ -456,36 +145,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..add
 Patch applied.
@@ -506,22 +165,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
-% git log -p
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..modify
 Patch applied.
@@ -547,66 +190,6 @@ f f322f08d907e3737a4321b0ec90bc545f71af7cf  .git/patches/master/status
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop
 Now at add.
 % list_files
@@ -622,51 +205,6 @@ f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
-% git log -p
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop
 Now at modify.
 % list_files
@@ -681,36 +219,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt pop
 All patches popped.
 % list_files
@@ -724,22 +232,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
-% git log -p
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..modify
 Patch applied.
@@ -766,76 +258,6 @@ r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch mode
-
-diff --git a/def b/def
-old mode 100644
-new mode 100755
-
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 File series fully applied, ends at patch mode
 % guilt pop -n -1
@@ -855,76 +277,6 @@ r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch mode
-
-diff --git a/def b/def
-old mode 100644
-new mode 100755
-
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 File series fully applied, ends at patch mode
 % guilt pop -n 0
@@ -944,76 +296,6 @@ r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch mode
-
-diff --git a/def b/def
-old mode 100644
-new mode 100755
-
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 File series fully applied, ends at patch mode
 % guilt pop -n 1
@@ -1032,66 +314,6 @@ f f322f08d907e3737a4321b0ec90bc545f71af7cf  .git/patches/master/status
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
 r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove
-% git log -p
-commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch remove
-
-diff --git a/abd b/abd
-deleted file mode 100644
-index fd3896d..0000000
---- a/abd
-+++ /dev/null
-@@ -1 +0,0 @@
--‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..mode
 Patch applied.
@@ -1110,51 +332,6 @@ f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
 r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add
-% git log -p
-commit 37d588cc39848368810e88332bd03b083f2ce3ac
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch add
-
-diff --git a/abd b/abd
-new file mode 100644
-index 0000000..fd3896d
---- /dev/null
-+++ b/abd
-@@ -0,0 +1 @@
-+‰öu^[Ø\x14½\x04á\x1a\x7fZâñeÏÈE„£\x06\x1fWÀV¼/›\x03U?Ú<|\x13\x12¢@6¤8'H¸1G_˜Í§*·\x12ðRÒ™¤
\x7fªÂ~·
-\ No newline at end of file
-
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..remove
 Patch applied.
@@ -1174,36 +351,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify
-% git log -p
-commit 33633e7a1aa31972f125878baf7807be57b1672d
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    patch modify
-
-diff --git a/def b/def
-index 8baef1b..7d69c2f 100644
---- a/def
-+++ b/def
-@@ -1 +1,2 @@
- abc
-+asjhfksad
-
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..add
 Patch applied.
@@ -1224,22 +371,6 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
 f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series
 f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
 f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status
-% git log -p
-commit d4850419ccc1146c7169f500725ce504b9774ed0
-Author: Author Name <author@email>
-Date:   Mon Jan 1 00:00:00 2007 +0000
-
-    initial
-    
-    Signed-off-by: Commiter Name <commiter@email>
-
-diff --git a/def b/def
-new file mode 100644
-index 0000000..8baef1b
---- /dev/null
-+++ b/def
-@@ -0,0 +1 @@
-+abc
 % guilt push --all
 Applying patch..modify
 Patch applied.
diff --git a/regression/t-021.sh b/regression/t-021.sh
index e0d2dc1..2873234 100755
--- a/regression/t-021.sh
+++ b/regression/t-021.sh
@@ -9,7 +9,7 @@ cmd setup_repo
 
 cmd guilt push --all
 
-cmd git log -p
+cmd list_files
 
 #
 # incremental pop by 1
@@ -18,8 +18,6 @@ guilt series | _tac | while read n ; do
 	cmd guilt pop
 
 	cmd list_files
-
-	cmd git log -p
 done
 
 #
@@ -41,8 +39,6 @@ guilt series | _tac | while read n ; do
 
 	cmd list_files
 
-	cmd git log -p
-
 	cmd guilt push --all
 done
 
@@ -53,8 +49,6 @@ guilt series | _tac | while read n ; do
 	cmd guilt pop $t
 
 	cmd list_files
-
-	cmd git log -p
 done
 
 #
@@ -72,8 +66,6 @@ for n in `_seq -2 $npatches`; do
 
 	cmd list_files
 
-	cmd git log -p
-
 	cmd guilt push --all
 done
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 32/33] Improved doc and tests for guilt header.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (30 preceding siblings ...)
  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 ` 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
  32 siblings, 1 reply; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

---
 Documentation/guilt-header.txt | 5 ++++-
 regression/t-028.out           | 9 +++++++++
 regression/t-028.sh            | 3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/Documentation/guilt-header.txt b/Documentation/guilt-header.txt
index 870bfaf..71b2e66 100644
--- a/Documentation/guilt-header.txt
+++ b/Documentation/guilt-header.txt
@@ -18,7 +18,10 @@ Prints either the topmost patch's header or the header of a specified patch.
 -E::
 	Open the raw patch in an editor, instead of printing it.
 <patchname>::
-	Name of the patch.
+	Name of the patch. If a patch with exactly this name exists,
+	use it. Otherwise, treat the name as a regexp; if the regexp
+	matches a single patch, use it. Otherwise, list all matching
+	patch names to stderr and fail.
 
 Author
 ------
diff --git a/regression/t-028.out b/regression/t-028.out
index ea72a3a..39ac900 100644
--- a/regression/t-028.out
+++ b/regression/t-028.out
@@ -56,3 +56,12 @@ Patch non-existant is not in the series
   remove
   mode
   patch-with-some-desc
+% guilt header de
+de does not uniquely identify a patch. Did you mean any of these?
+  mode
+  patch-with-some-desc
+% guilt header des
+blah blah blah
+
+Signed-off-by: Commiter Name <commiter@email>
+
diff --git a/regression/t-028.sh b/regression/t-028.sh
index 2ce0378..cd3088c 100755
--- a/regression/t-028.sh
+++ b/regression/t-028.sh
@@ -35,4 +35,7 @@ shouldfail guilt header non-existant
 # patch name is a regexp that just happens to match an existing patch.
 shouldfail guilt header '.*'
 
+shouldfail guilt header de
+cmd guilt header des
+
 # FIXME: how do we check that -e works?
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [GUILT v4 33/33] Document the exit status of guilt push and guilt pop.
  2014-05-18 21:59 [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
                   ` (31 preceding siblings ...)
  2014-05-18 22:00 ` [GUILT v4 32/33] Improved doc and tests for guilt header Per Cederqvist
@ 2014-05-18 22:00 ` Per Cederqvist
  2015-01-22 14:31   ` Jeff Sipek
  32 siblings, 1 reply; 40+ messages in thread
From: Per Cederqvist @ 2014-05-18 22:00 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

---
 Documentation/guilt-pop.txt  | 3 +++
 Documentation/guilt-push.txt | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/Documentation/guilt-pop.txt b/Documentation/guilt-pop.txt
index 36fea9e..b0b89cc 100644
--- a/Documentation/guilt-pop.txt
+++ b/Documentation/guilt-pop.txt
@@ -26,6 +26,9 @@ OPTIONS
 
 If no patchname is given, pop the top-most patch.
 
+Exit with a non-zero exit status if requested to pop more patches
+than there are on the stack.
+
 Author
 ------
 Written by Josef "Jeff" Sipek <jeffpc@josefsipek.net>
diff --git a/Documentation/guilt-push.txt b/Documentation/guilt-push.txt
index 6ee86b9..6439f21 100644
--- a/Documentation/guilt-push.txt
+++ b/Documentation/guilt-push.txt
@@ -26,6 +26,9 @@ OPTIONS
 
 If no patchname is given, push the next patch in the series onto the tree.
 
+Exit with a non-zero exit status if requested to push more patches
+than there are in the series.
+
 Author
 ------
 Written by Josef "Jeff" Sipek <jeffpc@josefsipek.net>
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [GUILT v4 32/33] Improved doc and tests for guilt header.
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Jeff Sipek @ 2015-01-22 13:56 UTC (permalink / raw)
  To: Per Cederqvist; +Cc: git

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>


On Mon, May 19, 2014 at 12:00:08AM +0200, Per Cederqvist wrote:
> ---
>  Documentation/guilt-header.txt | 5 ++++-
>  regression/t-028.out           | 9 +++++++++
>  regression/t-028.sh            | 3 +++
>  3 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/guilt-header.txt b/Documentation/guilt-header.txt
> index 870bfaf..71b2e66 100644
> --- a/Documentation/guilt-header.txt
> +++ b/Documentation/guilt-header.txt
> @@ -18,7 +18,10 @@ Prints either the topmost patch's header or the header of a specified patch.
>  -E::
>  	Open the raw patch in an editor, instead of printing it.
>  <patchname>::
> -	Name of the patch.
> +	Name of the patch. If a patch with exactly this name exists,
> +	use it. Otherwise, treat the name as a regexp; if the regexp
> +	matches a single patch, use it. Otherwise, list all matching
> +	patch names to stderr and fail.
>  
>  Author
>  ------
> diff --git a/regression/t-028.out b/regression/t-028.out
> index ea72a3a..39ac900 100644
> --- a/regression/t-028.out
> +++ b/regression/t-028.out
> @@ -56,3 +56,12 @@ Patch non-existant is not in the series
>    remove
>    mode
>    patch-with-some-desc
> +% guilt header de
> +de does not uniquely identify a patch. Did you mean any of these?
> +  mode
> +  patch-with-some-desc
> +% guilt header des
> +blah blah blah
> +
> +Signed-off-by: Commiter Name <commiter@email>
> +
> diff --git a/regression/t-028.sh b/regression/t-028.sh
> index 2ce0378..cd3088c 100755
> --- a/regression/t-028.sh
> +++ b/regression/t-028.sh
> @@ -35,4 +35,7 @@ shouldfail guilt header non-existant
>  # patch name is a regexp that just happens to match an existing patch.
>  shouldfail guilt header '.*'
>  
> +shouldfail guilt header de
> +cmd guilt header des
> +
>  # FIXME: how do we check that -e works?
> -- 
> 1.8.3.1
> 

-- 
You measure democracy by the freedom it gives its dissidents, not the
freedom it gives its assimilated conformists.
		- Abbie Hoffman

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GUILT v4 15/33] Produce legal patch names in guilt-import-commit.
  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
  0 siblings, 1 reply; 40+ messages in thread
From: Jeff Sipek @ 2015-01-22 14:15 UTC (permalink / raw)
  To: Per Cederqvist; +Cc: git

I just tried to run the regression suite on my OpenIndiana laptop and I got
this failure.

034: --- t-034.out	2015-01-22 14:02:23.634515474 +0000
+++ /tmp/guilt.log.14878	2015-01-22 14:03:54.258790788 +0000
@@ -83,7 +83,7 @@
 [master aedb74f] @
  Author: Author Name <author@email>
  1 file changed, 1 insertion(+)
-% create_commit a Backslash\is\forbidden.
+% create_commit a Backslash\is
                               orbidden.
 [master 0a46f8f] Backslash\is\forbidden.
  Author: Author Name <author@email>
  1 file changed, 1 insertion(+)
Test failed!

Test:		034
Log file:	/tmp/guilt.log.14878
Repo dir:	"/tmp/guilt reg.12106"

make[1]: *** [all] Error 1


It's obviously the "cmd" command printing that's busted.  The following change
makes the test suite pass.  Does it work for you?  (If so, I'll commit it after
pulling your whole series.)

Thanks,

Jeff.


diff --git a/regression/scaffold b/regression/scaffold
index 97cff4e..593e9da 100644
--- a/regression/scaffold
+++ b/regression/scaffold
@@ -50,7 +50,7 @@ function filter_dd
 # usage: cmd <cmd>..
 function cmd
 {
-	echo "% $@"
+	printf "%% %s\n" "$*"
 	if ! (
 		exec 3>&1
 		rv=`(("$@" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1`

On Sun, May 18, 2014 at 11:59:51PM +0200, Per Cederqvist wrote:
> Try harder to create patch names that adhere to the rules in
> git-check-ref-format(1) when deriving a patch name from the commit
> message.  Verify that the derived name using "git check-ref-format",
> and as a final fallback simply use the patch name "x" (to ensure that
> the code is future-proof in case new rules are added in the future).
> 
> Always append a ".patch" suffix to the patch name.
> 
> Added test cases.
> 
> Signed-off-by: Per Cederqvist <cederp@opera.com>
> Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
> ---
>  guilt-import-commit  |  20 +-
>  regression/t-034.out | 567 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  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 f14647c..6260c56 100755
> --- a/guilt-import-commit
> +++ b/guilt-import-commit
> @@ -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-`
>  
> +	# 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" \
>  			-e "s/['\\[{}]//g" -e 's/]//g' -e 's/\*/-/g' \
> -			-e 's/\?/-/g' | tr A-Z a-z`
> +			-e 's/\?/-/g' -e 's/\.\.\.*/./g' -e 's/^\.//' \
> +			-e 's/\.patch$//' -e 's/\.$//' | tr A-Z a-z`
> +
> +	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 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.)
> +		fname=x
> +	fi
>  
>  	disp "Converting `echo $rev | cut -c 1-8` as $fname"
>  
>  	mangle_prefix=1
>  	fname_base=$fname
> -	while [ -f "$GUILT_DIR/$branch/$fname" ]; do
> +	while [ -f "$GUILT_DIR/$branch/$fname.patch" ]; do
>  		fname="$fname_base-$mangle_prefix"
>  	        mangle_prefix=`expr $mangle_prefix + 1`
>  		disp "Patch under that name exists...trying '$fname'"
>  	done
> +	fname="$fname".patch
>  
>  	(
>  		do_make_header $rev
> diff --git a/regression/t-034.out b/regression/t-034.out
> new file mode 100644
> index 0000000..7bc9459
> --- /dev/null
> +++ b/regression/t-034.out
> @@ -0,0 +1,567 @@
> +% setup_git_repo
> +% git tag base
> +% create_commit a The sequence /. is forbidden.
> +[master eebb76e] The sequence /. is forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> + create mode 100644 a
> +% create_commit a The sequence .lock/ is forbidden.
> +[master 45e81b5] The sequence .lock/ is forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a A/component/may/not/end/in/foo.lock
> +[master bbf3f59] A/component/may/not/end/in/foo.lock
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Two consecutive dots (..) is forbidden.
> +[master 1535e67] Two consecutive dots (..) is forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Check/multiple/../dots/...../foo..patch
> +[master 48eb60c] Check/multiple/../dots/...../foo..patch
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Space is forbidden.
> +[master 10dea83] Space is forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Tilde~is~forbidden.
> +[master 70a83b7] Tilde~is~forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Caret^is^forbidden.
> +[master ee6ef2c] Caret^is^forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Colon:is:forbidden.
> +[master c077fe2] Colon:is:forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Del\x7fis\x7fforbidden.
> +[master 589ee30] Del\x7fis\x7fforbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% git branch some-branch
> +% git tag some-tag
> +% create_commit a Ctrl\x01is\x02forbidden.
> +[master e63cdde] Ctrl\x01is\x02forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a CR
> is
> also
> forbidden.
> +[master 21ad093] CR
> is
> also
> forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Question-mark?is?forbidden.
> +[master be2fa9b] Question-mark?is?forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Asterisk*is*forbidden.
> +[master af7b50f] Asterisk*is*forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Open[bracket[is[forbidden.
> +[master 689f618] Open[bracket[is[forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Multiple/slashes//are//forbidden.
> +[master 6e7d52a] Multiple/slashes//are//forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Cannot/end/in/slash/
> +[master 95bb6cd] Cannot/end/in/slash/
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Cannot end in ..
> +[master 106e8e5] Cannot end in ..
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Cannot@{have@{the@{sequence@{at-brace.
> +[master 30187ed] Cannot@{have@{the@{sequence@{at-brace.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a @
> +[master aedb74f] @
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Backslash\is\forbidden.
> +[master 0a46f8f] Backslash\is\forbidden.
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% create_commit a Can/have/embedded/single/slashes
> +[master 2a8b188] Can/have/embedded/single/slashes
> + Author: Author Name <author@email>
> + 1 file changed, 1 insertion(+)
> +% git log
> +commit 2a8b1889aa5066193bac978e6bf5073ffcfa6541
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Can/have/embedded/single/slashes
> +
> +commit 0a46f8fa7c8c5a6f1039f842fe5cbd21d3a2a2a6
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Backslash\is\forbidden.
> +
> +commit aedb74fd8388282fd7af50cb191a7f62bfc45eb5
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    @
> +
> +commit 30187ed0f47d12df9cedcbb846647d0d52130c12
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Cannot@{have@{the@{sequence@{at-brace.
> +
> +commit 106e8e5a8cceec7297af97376ca5f93506643d0b
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Cannot end in ..
> +
> +commit 95bb6cd7edf7b1e634a1e7d02c8faa99e39cbbf2
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Cannot/end/in/slash/
> +
> +commit 6e7d52a7dacc684225c11b4edd2bac25fb52bd9b
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Multiple/slashes//are//forbidden.
> +
> +commit 689f618085195775d204898254154b8bb50897a5
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Open[bracket[is[forbidden.
> +
> +commit af7b50f93854bc5f46de5a389c1f3dea081eae2f
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Asterisk*is*forbidden.
> +
> +commit be2fa9b5c5788dc05c4036f1b8197a1d33169610
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Question-mark?is?forbidden.
> +
> +commit 21ad093a0c1b4a96285180a3d7b99a4045ef9202
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    CR
> is
> also
> forbidden.
> +
> +commit e63cdde7a1c90b66d7d411683528200f3f067d5f
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Ctrl\x01is\x02forbidden.
> +
> +commit 589ee305a82aacf155529e75cbc84e661c37c83d
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Del\x7fis\x7fforbidden.
> +
> +commit c077fe203fd18036fb00b56eec1763673d1769c6
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Colon:is:forbidden.
> +
> +commit ee6ef2cc9dd5525409300377b013c0d9734bd931
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Caret^is^forbidden.
> +
> +commit 70a83b705a2602a9493aba7f8f22e7abd13adc63
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Tilde~is~forbidden.
> +
> +commit 10dea8380135f4d10cd10324e13da659261ceda3
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Space is forbidden.
> +
> +commit 48eb60cddaefdaac5f78655f9028a9da741a18d1
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Check/multiple/../dots/...../foo..patch
> +
> +commit 1535e67718949abf72f843685a1672ebfe4bd21f
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Two consecutive dots (..) is forbidden.
> +
> +commit bbf3f5926e11d97b08cdb6e833c9deb603453d1b
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    A/component/may/not/end/in/foo.lock
> +
> +commit 45e81b5163ec3ed656b058ac3fd95b8986824e0f
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    The sequence .lock/ is forbidden.
> +
> +commit eebb76e96913d2dc78aef5f233fadc74af770b3b
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    The sequence /. is forbidden.
> +
> +commit d4850419ccc1146c7169f500725ce504b9774ed0
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    initial
> +    
> +    Signed-off-by: Commiter Name <commiter@email>
> +% guilt init
> +% guilt import-commit base..HEAD
> +About to begin conversion...
> +Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541
> +Converting 2a8b1889 as can-have-embedded-single-slashes
> +Converting 0a46f8fa as backslash-isorbidden
> +Converting aedb74fd as x
> +Converting 30187ed0 as cannot@have@the@sequence@at-brace
> +Converting 106e8e5a as cannot_end_in_
> +Converting 95bb6cd7 as cannot-end-in-slash-
> +Converting 6e7d52a7 as multiple-slashes--are--forbidden
> +Converting 689f6180 as openbracketisforbidden
> +Converting af7b50f9 as asterisk-is-forbidden
> +Converting be2fa9b5 as question-mark-is-forbidden
> +Converting 21ad093a as crisalsoforbidden
> +Converting e63cdde7 as ctrlisforbidden
> +Converting 589ee305 as delisforbidden
> +Converting c077fe20 as colon_is_forbidden
> +Converting ee6ef2cc as caretisforbidden
> +Converting 70a83b70 as tildeisforbidden
> +Converting 10dea838 as space_is_forbidden
> +Converting 48eb60cd as check-multiple-.-dots-.-foo
> +Converting 1535e677 as two_consecutive_dots_(.)_is_forbidden
> +Converting bbf3f592 as a-component-may-not-end-in-foolock
> +Converting 45e81b51 as the_sequence_.lock-_is_forbidden
> +Converting eebb76e9 as the_sequence_-._is_forbidden
> +Done.
> +Current head: d4850419ccc1146c7169f500725ce504b9774ed0
> +% guilt push -a
> +Applying patch..the_sequence_-._is_forbidden.patch
> +Patch applied.
> +Applying patch..the_sequence_.lock-_is_forbidden.patch
> +Patch applied.
> +Applying patch..a-component-may-not-end-in-foolock.patch
> +Patch applied.
> +Applying patch..two_consecutive_dots_(.)_is_forbidden.patch
> +Patch applied.
> +Applying patch..check-multiple-.-dots-.-foo.patch
> +Patch applied.
> +Applying patch..space_is_forbidden.patch
> +Patch applied.
> +Applying patch..tildeisforbidden.patch
> +Patch applied.
> +Applying patch..caretisforbidden.patch
> +Patch applied.
> +Applying patch..colon_is_forbidden.patch
> +Patch applied.
> +Applying patch..delisforbidden.patch
> +Patch applied.
> +Applying patch..ctrlisforbidden.patch
> +Patch applied.
> +Applying patch..crisalsoforbidden.patch
> +Patch applied.
> +Applying patch..question-mark-is-forbidden.patch
> +Patch applied.
> +Applying patch..asterisk-is-forbidden.patch
> +Patch applied.
> +Applying patch..openbracketisforbidden.patch
> +Patch applied.
> +Applying patch..multiple-slashes--are--forbidden.patch
> +Patch applied.
> +Applying patch..cannot-end-in-slash-.patch
> +Patch applied.
> +Applying patch..cannot_end_in_.patch
> +Patch applied.
> +Applying patch..cannot@have@the@sequence@at-brace.patch
> +Patch applied.
> +Applying patch..x.patch
> +Patch applied.
> +Applying patch..backslash-isorbidden.patch
> +Patch applied.
> +Applying patch..can-have-embedded-single-slashes.patch
> +Patch applied.
> +% git log --decorate
> +commit 434e07cacdd8e7eb4723e67cb2d100b3a4121a3a (HEAD, refs/patches/master/can-have-embedded-single-slashes.patch, guilt/master)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Can/have/embedded/single/slashes
> +
> +commit 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 (refs/patches/master/backslash-isorbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Backslash\is\forbidden.
> +
> +commit ea46f435d4d8f3c5349dce1aabc1a39fbf7ef803 (refs/patches/master/x.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    @
> +
> +commit a275ed5d7f10ea88c986852ee95a7d5a61663b5f (refs/patches/master/cannot@have@the@sequence@at-brace.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Cannot@{have@{the@{sequence@{at-brace.
> +
> +commit f091fee39457e64ebd35410c1cf95e6613816a54 (refs/patches/master/cannot_end_in_.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Cannot end in ..
> +
> +commit 025672497aff5c910c8ff86aaedc662f14c2f4ad (refs/patches/master/cannot-end-in-slash-.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Cannot/end/in/slash/
> +
> +commit f13e243c7c56f39422567a431bccceec8b789596 (refs/patches/master/multiple-slashes--are--forbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Multiple/slashes//are//forbidden.
> +
> +commit edef5e925083d445f71c170d3293fac9619bc7a2 (refs/patches/master/openbracketisforbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Open[bracket[is[forbidden.
> +
> +commit 1626a11d979a1e9e775c766484172212277153df (refs/patches/master/asterisk-is-forbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Asterisk*is*forbidden.
> +
> +commit 74df14ab3a0ec9a0382998fbf167ebb1b0a36c6a (refs/patches/master/question-mark-is-forbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Question-mark?is?forbidden.
> +
> +commit ec46429125abdb0c5ac2b46cc399bdcd7cfc73fd (refs/patches/master/crisalsoforbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    CR
> is
> also
> forbidden.
> +
> +commit 01524f9921af2a041cc88c068f76baa39e436cb2 (refs/patches/master/ctrlisforbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Ctrl\x01is\x02forbidden.
> +
> +commit 9fc9677b61880f9159838e89f714893e0a2fcafb (refs/patches/master/delisforbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Del\x7fis\x7fforbidden.
> +
> +commit 10433fd7206b7f79aabb4da514710d93c8deed4a (refs/patches/master/colon_is_forbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Colon:is:forbidden.
> +
> +commit fb1edb753c97ec865ceea316420b1df586caaa2b (refs/patches/master/caretisforbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Caret^is^forbidden.
> +
> +commit 3a0d5ccef0359004fcaa9cee98fbd6a2c4432e74 (refs/patches/master/tildeisforbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Tilde~is~forbidden.
> +
> +commit ea22c3b49c448dba8d7eaa6b805f9f1bc83fbedc (refs/patches/master/space_is_forbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Space is forbidden.
> +
> +commit db6ea8252440b04811344336f510a5469b2ddab0 (refs/patches/master/check-multiple-.-dots-.-foo.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Check/multiple/../dots/...../foo..patch
> +
> +commit fe07105cd62660f4440ad24b9fc7dfdd9e71d764 (refs/patches/master/two_consecutive_dots_(.)_is_forbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Two consecutive dots (..) is forbidden.
> +
> +commit 96a3e92c4df85f52362ce4f6d31983c462db9ae9 (refs/patches/master/a-component-may-not-end-in-foolock.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    A/component/may/not/end/in/foo.lock
> +
> +commit ee4f0f96dfc9c94f5410c1e6414f9004325a37fc (refs/patches/master/the_sequence_.lock-_is_forbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    The sequence .lock/ is forbidden.
> +
> +commit fdcb23c3072209bea3d9e0a2594132b936c5347e (refs/patches/master/the_sequence_-._is_forbidden.patch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    The sequence /. is forbidden.
> +
> +commit d4850419ccc1146c7169f500725ce504b9774ed0 (tag: base, master)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    initial
> +    
> +    Signed-off-by: Commiter Name <commiter@email>
> +% git log --decorate some-branch
> +commit 589ee305a82aacf155529e75cbc84e661c37c83d (tag: some-tag, some-branch)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Del\x7fis\x7fforbidden.
> +
> +commit c077fe203fd18036fb00b56eec1763673d1769c6
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Colon:is:forbidden.
> +
> +commit ee6ef2cc9dd5525409300377b013c0d9734bd931
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Caret^is^forbidden.
> +
> +commit 70a83b705a2602a9493aba7f8f22e7abd13adc63
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Tilde~is~forbidden.
> +
> +commit 10dea8380135f4d10cd10324e13da659261ceda3
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Space is forbidden.
> +
> +commit 48eb60cddaefdaac5f78655f9028a9da741a18d1
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Check/multiple/../dots/...../foo..patch
> +
> +commit 1535e67718949abf72f843685a1672ebfe4bd21f
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    Two consecutive dots (..) is forbidden.
> +
> +commit bbf3f5926e11d97b08cdb6e833c9deb603453d1b
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    A/component/may/not/end/in/foo.lock
> +
> +commit 45e81b5163ec3ed656b058ac3fd95b8986824e0f
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    The sequence .lock/ is forbidden.
> +
> +commit eebb76e96913d2dc78aef5f233fadc74af770b3b
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    The sequence /. is forbidden.
> +
> +commit d4850419ccc1146c7169f500725ce504b9774ed0 (tag: base, master)
> +Author: Author Name <author@email>
> +Date:   Mon Jan 1 00:00:00 2007 +0000
> +
> +    initial
> +    
> +    Signed-off-by: Commiter Name <commiter@email>
> +% list_files
> +d .git/patches
> +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
> +f 2cd7c9ad392e071be03c051c6793e9b1e31d33c4  .git/patches/master/can-have-embedded-single-slashes.patch
> +f 3136e448a4c820f6d2642f9d894c4087d3d109ab  .git/patches/master/cannot_end_in_.patch
> +f 34e07c584032df137f19bdb66d93f316f00a5ac8  .git/patches/master/tildeisforbidden.patch
> +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 7b103c3c7ae298cd2334f6f49da48bae1424f77b  .git/patches/master/crisalsoforbidden.patch
> +f 9b810b8c63779c51d2e7f61ab59cd49835041563  .git/patches/master/x.patch
> +f a22958d9ae9976fd7b2b5a9d0bcd44bf7ad9b08a  .git/patches/master/caretisforbidden.patch
> +f ab325bf5a432937fc6f231d3e8a773a62d53952b  .git/patches/master/multiple-slashes--are--forbidden.patch
> +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 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
> +f edfaa5e06bd662ae1f6a642834324fd9b849bbd9  .git/patches/master/a-component-may-not-end-in-foolock.patch
> +r 01524f9921af2a041cc88c068f76baa39e436cb2  .git/refs/patches/master/ctrlisforbidden.patch
> +r 025672497aff5c910c8ff86aaedc662f14c2f4ad  .git/refs/patches/master/cannot-end-in-slash-.patch
> +r 10433fd7206b7f79aabb4da514710d93c8deed4a  .git/refs/patches/master/colon_is_forbidden.patch
> +r 1626a11d979a1e9e775c766484172212277153df  .git/refs/patches/master/asterisk-is-forbidden.patch
> +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 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
> +r db6ea8252440b04811344336f510a5469b2ddab0  .git/refs/patches/master/check-multiple-.-dots-.-foo.patch
> +r ea22c3b49c448dba8d7eaa6b805f9f1bc83fbedc  .git/refs/patches/master/space_is_forbidden.patch
> +r ea46f435d4d8f3c5349dce1aabc1a39fbf7ef803  .git/refs/patches/master/x.patch
> +r ec46429125abdb0c5ac2b46cc399bdcd7cfc73fd  .git/refs/patches/master/crisalsoforbidden.patch
> +r edef5e925083d445f71c170d3293fac9619bc7a2  .git/refs/patches/master/openbracketisforbidden.patch
> +r ee4f0f96dfc9c94f5410c1e6414f9004325a37fc  .git/refs/patches/master/the_sequence_.lock-_is_forbidden.patch
> +r f091fee39457e64ebd35410c1cf95e6613816a54  .git/refs/patches/master/cannot_end_in_.patch
> +r f13e243c7c56f39422567a431bccceec8b789596  .git/refs/patches/master/multiple-slashes--are--forbidden.patch
> +r fb1edb753c97ec865ceea316420b1df586caaa2b  .git/refs/patches/master/caretisforbidden.patch
> +r fdcb23c3072209bea3d9e0a2594132b936c5347e  .git/refs/patches/master/the_sequence_-._is_forbidden.patch
> +r fe07105cd62660f4440ad24b9fc7dfdd9e71d764  .git/refs/patches/master/two_consecutive_dots_(.)_is_forbidden.patch
> +% guilt pop -a
> +All patches popped.
> diff --git a/regression/t-034.sh b/regression/t-034.sh
> new file mode 100755
> index 0000000..f41f958
> --- /dev/null
> +++ b/regression/t-034.sh
> @@ -0,0 +1,71 @@
> +#!/bin/bash
> +#
> +# Test import-commit
> +#
> +
> +function create_commit
> +{
> +	echo $1 >> $1 &&
> +		git add $1 &&
> +		git commit -m"$2"
> +}
> +
> +source "$REG_DIR/scaffold"
> +
> +b()
> +{
> +	printf "%b" "$1"
> +}
> +
> +cmd setup_git_repo
> +
> +cmd git tag base
> +
> +# Create a series of commits whose first line of the commit message
> +# each violates one of the rules in get-check-ref-format(1).
> +
> +cmd create_commit a "The sequence /. is forbidden."
> +cmd create_commit a "The sequence .lock/ is forbidden."
> +cmd create_commit a "A/component/may/not/end/in/foo.lock"
> +cmd create_commit a "Two consecutive dots (..) is forbidden."
> +cmd create_commit a "Check/multiple/../dots/...../foo..patch"
> +cmd create_commit a "Space is forbidden."
> +cmd create_commit a "Tilde~is~forbidden."
> +cmd create_commit a "Caret^is^forbidden."
> +cmd create_commit a "Colon:is:forbidden."
> +cmd create_commit a `b 'Del\177is\177forbidden.'`
> +# Create a branch and a tag from the current commit, to ensure that
> +# doing so does not affect how the commit is imported.
> +cmd git branch some-branch
> +cmd git tag some-tag
> +cmd create_commit a `b 'Ctrl\001is\002forbidden.'`
> +cmd create_commit a `b 'CR\ris\ralso\rforbidden.'`
> +cmd create_commit a "Question-mark?is?forbidden."
> +cmd create_commit a "Asterisk*is*forbidden."
> +cmd create_commit a "Open[bracket[is[forbidden."
> +cmd create_commit a "Multiple/slashes//are//forbidden."
> +cmd create_commit a "Cannot/end/in/slash/"
> +cmd create_commit a "Cannot end in .."
> +cmd create_commit a "Cannot@{have@{the@{sequence@{at-brace."
> +cmd create_commit a "@"
> +cmd create_commit a "Backslash\\is\\forbidden."
> +
> +# Slash is sometimes allowed; this is not problematic.
> +cmd create_commit a "Can/have/embedded/single/slashes"
> +
> +cmd git log
> +
> +# Import all the commits to guilt.
> +cmd guilt init
> +cmd guilt import-commit base..HEAD
> +
> +for patch in .git/patches/master/*.patch; do
> +	touch -a -m -t "$TOUCH_DATE" "$patch"
> +done
> +
> +# If push and pop works, the names we created are good.
> +cmd guilt push -a
> +cmd git log --decorate
> +cmd git log --decorate some-branch
> +cmd list_files
> +cmd guilt pop -a
> -- 
> 1.8.3.1
> 

-- 
C is quirky, flawed, and an enormous success.
		- Dennis M. Ritchie.

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [GUILT v4 14/33] Use "git check-ref-format" to validate patch names.
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Jeff Sipek @ 2015-01-22 14:18 UTC (permalink / raw)
  To: Per Cederqvist; +Cc: git

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

On Sun, May 18, 2014 at 11:59:50PM +0200, Per Cederqvist wrote:
> The valid_patchname now lets "git check-ref-format" do its job instead
> of trying (and failing) to implement the same rules.  See
> git-check-ref-format(1) for a list of the rules.  Re-implement rules
> added to "git check-ref-format" after Git 1.5.0, so that guilt rejects
> the same names no matter what version of Git we are using (but
> versions prior to 1.5.0 are not supported).
> 
> Refer to the git-check-ref-format(1) man page in the error messages
> produced when valid_patchname indicates that the name is bad.
> 
> Added testcases that breaks most of the rules in that man-page.
> 
> Signed-off-by: Per Cederqvist <cederp@opera.com>
> ---
>  guilt                |  46 +++++-
>  guilt-fork           |   2 +-
>  guilt-import         |   2 +-
>  guilt-new            |   2 +-
>  regression/t-025.out | 426 +++++++++++++++++++++++++++++++++++++++++++++++++--
>  regression/t-025.sh  |  12 +-
>  regression/t-032.out |   4 +-
>  7 files changed, 474 insertions(+), 20 deletions(-)
> 
> diff --git a/guilt b/guilt
> index 3fc524e..9567a78 100755
> --- a/guilt
> +++ b/guilt
> @@ -132,14 +132,50 @@ fi
>  # usage: valid_patchname <patchname>
>  valid_patchname()
>  {
> +	# Once we only support Git 1.7.8 and newer, the command below
> +	# could be replaced with:
> +	#
> +	#     git check-ref-format --allow-onelevel "$1"
> +	#
> +	# Instead, we arbitrarily prepend one level.  The result
> +	# should be the same, and this is portable to all existing
> +	# versions of Git.
> +	git check-ref-format a/"$1"
> +	if [ $? -ne 0 ]; then
> +		return 1
> +	fi
> +
> +	# We want to reject all names that Git 2.0.0 rejects.  In case
> +	# we are running an older version, we explicitly check some
> +	# cases that were added to Git after version 1.5.0.  This code
> +	# aims to support Git version 1.5.0 and newer.
> +
> +	# Git 1.7.6.4 and newer rejects the DEL character.
> +	if [ `echo "$1"|tr -d '\177'` != "$1" ]; then
> +		return 1
> +	fi
> +
> +	# Git 1.7.8 and newer rejects refs that start or end with
> +	# slash or contain multiple adjacent slashes.
>  	case "$1" in
> -		/*|./*|../*|*/./*|*/../*|*/.|*/..|*/|*\ *|*\	*)
> +		/*|*/|*//*)
>  			return 1;;
> -		*:*)
> -			return 1;;
> -		*)
> -			return 0;;
>  	esac
> +
> +	# Git 1.7.8 and newer rejects refname components that end in
> +	# .lock.
> +	case "$1" in
> +		*.lock/*|*.lock)
> +			return 1;;
> +	esac
> +
> +	# Git 1.8.5 and newer rejects refnames that are made up of the
> +	# single character "@".
> +	if [ "$1" = "@" ]; then
> +		return 1
> +	fi
> +
> +	return 0
>  }
>  
>  get_branch()
> diff --git a/guilt-fork b/guilt-fork
> index a85d391..6447e55 100755
> --- a/guilt-fork
> +++ b/guilt-fork
> @@ -37,7 +37,7 @@ else
>  fi
>  
>  if ! valid_patchname "$newpatch"; then
> -	die "The specified patch name contains invalid characters (:)."
> +	die "The specified patch name is invalid according to git-check-ref-format(1)."
>  fi
>  
>  if [ -e "$GUILT_DIR/$branch/$newpatch" ]; then
> diff --git a/guilt-import b/guilt-import
> index 3e9b3bb..928e325 100755
> --- a/guilt-import
> +++ b/guilt-import
> @@ -40,7 +40,7 @@ if [ -e "$GUILT_DIR/$branch/$newname" ]; then
>  fi
>  
>  if ! valid_patchname "$newname"; then
> -	die "The specified patch name contains invalid characters (:)."
> +	die "The specified patch name is invalid according to git-check-ref-format(1)."
>  fi
>  
>  # create any directories as needed
> diff --git a/guilt-new b/guilt-new
> index 9528438..9f7fa44 100755
> --- a/guilt-new
> +++ b/guilt-new
> @@ -64,7 +64,7 @@ fi
>  
>  if ! valid_patchname "$patch"; then
>  	disp "Patchname is invalid." >&2
> -	die "it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace"
> +	die "It must follow the rules in git-check-ref-format(1)."
>  fi
>  
>  # create any directories as needed
> diff --git a/regression/t-025.out b/regression/t-025.out
> index 7811ab1..01bc406 100644
> --- a/regression/t-025.out
> +++ b/regression/t-025.out
> @@ -141,7 +141,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new white space
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -211,7 +211,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new /abc
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -235,7 +235,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new ./blah
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -259,7 +259,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new ../blah
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -283,7 +283,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/./blah
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -307,7 +307,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/../blah
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -331,7 +331,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/.
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -355,7 +355,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/..
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -379,7 +379,415 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new abc.lock
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new a/b.lock/c
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new cr
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new ctrl-a\x01
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new formfeed\f
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new del\x7f
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new tilde~
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new caret^
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new colon:
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new questionmark?
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new asterisk*
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new open[bracket
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new consecutive//slashes
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new trailing-dot.
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new bad@{seq
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new @
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new backslash\
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> diff --git a/regression/t-025.sh b/regression/t-025.sh
> index 985fed4..8c439fc 100755
> --- a/regression/t-025.sh
> +++ b/regression/t-025.sh
> @@ -43,7 +43,17 @@ shouldfail guilt new "white space"
>  
>  cmd list_files
>  
> -for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do
> +b()
> +{
> +    printf "%b" "$1"
> +}
> +
> +for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. \
> +	abc/.. abc/ abc.lock a/b.lock/c `b 'cr\r'` `b 'ctrl-a\001'` \
> +	`b 'formfeed\f'` `b 'del\177'` "tilde~" "caret^" "colon:" \
> +	"questionmark?" "asterisk*" "open[bracket" "consecutive//slashes" \
> +	"trailing-dot." "bad@{seq" "@" "backslash\\"
> +do
>  	shouldfail guilt new "$pname"
>  
>  	cmd list_files
> diff --git a/regression/t-032.out b/regression/t-032.out
> index 53f0370..4e65db0 100644
> --- a/regression/t-032.out
> +++ b/regression/t-032.out
> @@ -1,7 +1,7 @@
>  % setup_repo
>  % touch foo foo:baz
>  % guilt import -P foo:bar foo
> -The specified patch name contains invalid characters (:).
> +The specified patch name is invalid according to git-check-ref-format(1).
>  % guilt import -P foo:bar foo2
>  Specified file does not exist.
>  % guilt import -P foo foo2
> @@ -15,4 +15,4 @@ Already tracking a patch under that name.
>  Already tracking a patch under that name.
>  % guilt import -P foo,bar foo
>  % guilt import foo:baz
> -The specified patch name contains invalid characters (:).
> +The specified patch name is invalid according to git-check-ref-format(1).
> -- 
> 1.8.3.1
> 

-- 
What is the difference between Mechanical Engineers and Civil Engineers?
Mechanical Engineers build weapons, Civil Engineers build targets.

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GUILT v4 09/33] Test suite: properly check the exit status of commands.
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Jeff Sipek @ 2015-01-22 14:27 UTC (permalink / raw)
  To: Per Cederqvist; +Cc: git

On Sun, May 18, 2014 at 11:59:45PM +0200, Per Cederqvist wrote:
> The "cmd" and "shouldfail" functions checked the exit status of the
> replace_path function instead of the actual command that was running.
> (The $? construct checks the exit status of the last command in a
> pipeline, not the first command.)
> 
> Print an explicit error message if a command that should fail actually
> succeeds.

This is a god idea.

The patch still looks good.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>


> Updated t-032.sh, which used "shouldfail" instead of "cmd" in one
> place.  (The comment in the script makes it clear that the command is
> expected to succeed.)
> 
> Signed-off-by: Per Cederqvist <cederp@opera.com>
> ---
>  regression/scaffold | 23 ++++++++++++++++-------
>  regression/t-032.sh |  2 +-
>  2 files changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/regression/scaffold b/regression/scaffold
> index 5c8b73e..2e04c83 100644
> --- a/regression/scaffold
> +++ b/regression/scaffold
> @@ -51,19 +51,28 @@ function filter_dd
>  function cmd
>  {
>  	echo "% $@"
> -	"$@" 2>&1 | replace_path && return 0
> -	return 1
> +	if ! (
> +		exec 3>&1
> +		rv=`(("$@" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1`
> +		exit $rv
> +	) ; then
> +		echo "% FAIL: The above command should succeed but failed."
> +		exit 1
> +	fi
>  }
>  
>  # usage: shouldfail <cmd>..
>  function shouldfail
>  {
>  	echo "% $@"
> -	(
> -		"$@" 2>&1 || return 0
> -		return 1
> -	) | replace_path
> -	return $?
> +	if (
> +		exec 3>&1
> +		rv=`(("$@" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1`
> +		exit $rv
> +	) ; then
> +		echo "% FAIL: The above command should fail but succeeded."
> +		exit 1
> +	fi
>  }
>  
>  # usage: list_files
> diff --git a/regression/t-032.sh b/regression/t-032.sh
> index b1d5f19..bba401e 100755
> --- a/regression/t-032.sh
> +++ b/regression/t-032.sh
> @@ -28,7 +28,7 @@ shouldfail guilt import -P foo3 foo
>  cmd guilt import -P foo2 foo
>  
>  # ok
> -shouldfail guilt import foo
> +cmd guilt import foo
>  
>  # duplicate patch name (implicit)
>  shouldfail guilt import foo
> -- 
> 1.8.3.1
> 

-- 
Intellectuals solve problems; geniuses prevent them
		- Albert Einstein

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GUILT v4 33/33] Document the exit status of guilt push and guilt pop.
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Jeff Sipek @ 2015-01-22 14:31 UTC (permalink / raw)
  To: Per Cederqvist; +Cc: git

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>


Ok, I think this is all of the patches.  I'll wait for you to tell me if the
cmd() echo to printf change breaks anything for you.  If not, I'll pull your
series (via git), tag a 0.36-rc1, and push the whole thing to repo.or.cz. :)

Sorry for making this take so long :(

Jeff.

On Mon, May 19, 2014 at 12:00:09AM +0200, Per Cederqvist wrote:
> ---
>  Documentation/guilt-pop.txt  | 3 +++
>  Documentation/guilt-push.txt | 3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/Documentation/guilt-pop.txt b/Documentation/guilt-pop.txt
> index 36fea9e..b0b89cc 100644
> --- a/Documentation/guilt-pop.txt
> +++ b/Documentation/guilt-pop.txt
> @@ -26,6 +26,9 @@ OPTIONS
>  
>  If no patchname is given, pop the top-most patch.
>  
> +Exit with a non-zero exit status if requested to pop more patches
> +than there are on the stack.
> +
>  Author
>  ------
>  Written by Josef "Jeff" Sipek <jeffpc@josefsipek.net>
> diff --git a/Documentation/guilt-push.txt b/Documentation/guilt-push.txt
> index 6ee86b9..6439f21 100644
> --- a/Documentation/guilt-push.txt
> +++ b/Documentation/guilt-push.txt
> @@ -26,6 +26,9 @@ OPTIONS
>  
>  If no patchname is given, push the next patch in the series onto the tree.
>  
> +Exit with a non-zero exit status if requested to push more patches
> +than there are in the series.
> +
>  Author
>  ------
>  Written by Josef "Jeff" Sipek <jeffpc@josefsipek.net>
> -- 
> 1.8.3.1
> 

-- 
Computer Science is no more about computers than astronomy is about
telescopes.
		- Edsger Dijkstra

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GUILT v4 15/33] Produce legal patch names in guilt-import-commit.
  2015-01-22 14:15   ` Jeff Sipek
@ 2015-01-22 15:50     ` Per Cederqvist
  0 siblings, 0 replies; 40+ messages in thread
From: Per Cederqvist @ 2015-01-22 15:50 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: Git List

Replacing echo with printf as in your patch works fine for me.

I've applied Signed-off-by lines from you for the latest commits,
rebased it on top of your current master commit, and pushed
the series to the oslo-2014-v5 branch of git://repo.or.cz/guilt/ceder.git

    /ceder

On Thu, Jan 22, 2015 at 3:15 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:
> I just tried to run the regression suite on my OpenIndiana laptop and I got
> this failure.
>
> 034: --- t-034.out      2015-01-22 14:02:23.634515474 +0000
> +++ /tmp/guilt.log.14878        2015-01-22 14:03:54.258790788 +0000
> @@ -83,7 +83,7 @@
>  [master aedb74f] @
>   Author: Author Name <author@email>
>   1 file changed, 1 insertion(+)
> -% create_commit a Backslash\is\forbidden.
> +% create_commit a Backslash\is
>                                orbidden.
>  [master 0a46f8f] Backslash\is\forbidden.
>   Author: Author Name <author@email>
>   1 file changed, 1 insertion(+)
> Test failed!
>
> Test:           034
> Log file:       /tmp/guilt.log.14878
> Repo dir:       "/tmp/guilt reg.12106"
>
> make[1]: *** [all] Error 1
>
>
> It's obviously the "cmd" command printing that's busted.  The following change
> makes the test suite pass.  Does it work for you?  (If so, I'll commit it after
> pulling your whole series.)
>
> Thanks,
>
> Jeff.
>
>
> diff --git a/regression/scaffold b/regression/scaffold
> index 97cff4e..593e9da 100644
> --- a/regression/scaffold
> +++ b/regression/scaffold
> @@ -50,7 +50,7 @@ function filter_dd
>  # usage: cmd <cmd>..
>  function cmd
>  {
> -       echo "% $@"
> +       printf "%% %s\n" "$*"
>         if ! (
>                 exec 3>&1
>                 rv=`(("$@" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1`
>
> On Sun, May 18, 2014 at 11:59:51PM +0200, Per Cederqvist wrote:
>> Try harder to create patch names that adhere to the rules in
>> git-check-ref-format(1) when deriving a patch name from the commit
>> message.  Verify that the derived name using "git check-ref-format",
>> and as a final fallback simply use the patch name "x" (to ensure that
>> the code is future-proof in case new rules are added in the future).
>>
>> Always append a ".patch" suffix to the patch name.
>>
>> Added test cases.
>>
>> Signed-off-by: Per Cederqvist <cederp@opera.com>
>> Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
>> ---
>>  guilt-import-commit  |  20 +-
>>  regression/t-034.out | 567 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>  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 f14647c..6260c56 100755
>> --- a/guilt-import-commit
>> +++ b/guilt-import-commit
>> @@ -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-`
>>
>> +     # 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" \
>>                       -e "s/['\\[{}]//g" -e 's/]//g' -e 's/\*/-/g' \
>> -                     -e 's/\?/-/g' | tr A-Z a-z`
>> +                     -e 's/\?/-/g' -e 's/\.\.\.*/./g' -e 's/^\.//' \
>> +                     -e 's/\.patch$//' -e 's/\.$//' | tr A-Z a-z`
>> +
>> +     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 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.)
>> +             fname=x
>> +     fi
>>
>>       disp "Converting `echo $rev | cut -c 1-8` as $fname"
>>
>>       mangle_prefix=1
>>       fname_base=$fname
>> -     while [ -f "$GUILT_DIR/$branch/$fname" ]; do
>> +     while [ -f "$GUILT_DIR/$branch/$fname.patch" ]; do
>>               fname="$fname_base-$mangle_prefix"
>>               mangle_prefix=`expr $mangle_prefix + 1`
>>               disp "Patch under that name exists...trying '$fname'"
>>       done
>> +     fname="$fname".patch
>>
>>       (
>>               do_make_header $rev
>> diff --git a/regression/t-034.out b/regression/t-034.out
>> new file mode 100644
>> index 0000000..7bc9459
>> --- /dev/null
>> +++ b/regression/t-034.out
>> @@ -0,0 +1,567 @@
>> +% setup_git_repo
>> +% git tag base
>> +% create_commit a The sequence /. is forbidden.
>> +[master eebb76e] The sequence /. is forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> + create mode 100644 a
>> +% create_commit a The sequence .lock/ is forbidden.
>> +[master 45e81b5] The sequence .lock/ is forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a A/component/may/not/end/in/foo.lock
>> +[master bbf3f59] A/component/may/not/end/in/foo.lock
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Two consecutive dots (..) is forbidden.
>> +[master 1535e67] Two consecutive dots (..) is forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Check/multiple/../dots/...../foo..patch
>> +[master 48eb60c] Check/multiple/../dots/...../foo..patch
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Space is forbidden.
>> +[master 10dea83] Space is forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Tilde~is~forbidden.
>> +[master 70a83b7] Tilde~is~forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Caret^is^forbidden.
>> +[master ee6ef2c] Caret^is^forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Colon:is:forbidden.
>> +[master c077fe2] Colon:is:forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Del is forbidden.
>> +[master 589ee30] Del is forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% git branch some-branch
>> +% git tag some-tag
>> +% create_commit a Ctrl is forbidden.
>> +[master e63cdde] Ctrl is forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a CR
>> is
>> also
>> forbidden.
>> +[master 21ad093] CR
>> is
>> also
>> forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Question-mark?is?forbidden.
>> +[master be2fa9b] Question-mark?is?forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Asterisk*is*forbidden.
>> +[master af7b50f] Asterisk*is*forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Open[bracket[is[forbidden.
>> +[master 689f618] Open[bracket[is[forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Multiple/slashes//are//forbidden.
>> +[master 6e7d52a] Multiple/slashes//are//forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Cannot/end/in/slash/
>> +[master 95bb6cd] Cannot/end/in/slash/
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Cannot end in ..
>> +[master 106e8e5] Cannot end in ..
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Cannot@{have@{the@{sequence@{at-brace.
>> +[master 30187ed] Cannot@{have@{the@{sequence@{at-brace.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a @
>> +[master aedb74f] @
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Backslash\is\forbidden.
>> +[master 0a46f8f] Backslash\is\forbidden.
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% create_commit a Can/have/embedded/single/slashes
>> +[master 2a8b188] Can/have/embedded/single/slashes
>> + Author: Author Name <author@email>
>> + 1 file changed, 1 insertion(+)
>> +% git log
>> +commit 2a8b1889aa5066193bac978e6bf5073ffcfa6541
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Can/have/embedded/single/slashes
>> +
>> +commit 0a46f8fa7c8c5a6f1039f842fe5cbd21d3a2a2a6
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Backslash\is\forbidden.
>> +
>> +commit aedb74fd8388282fd7af50cb191a7f62bfc45eb5
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    @
>> +
>> +commit 30187ed0f47d12df9cedcbb846647d0d52130c12
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Cannot@{have@{the@{sequence@{at-brace.
>> +
>> +commit 106e8e5a8cceec7297af97376ca5f93506643d0b
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Cannot end in ..
>> +
>> +commit 95bb6cd7edf7b1e634a1e7d02c8faa99e39cbbf2
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Cannot/end/in/slash/
>> +
>> +commit 6e7d52a7dacc684225c11b4edd2bac25fb52bd9b
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Multiple/slashes//are//forbidden.
>> +
>> +commit 689f618085195775d204898254154b8bb50897a5
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Open[bracket[is[forbidden.
>> +
>> +commit af7b50f93854bc5f46de5a389c1f3dea081eae2f
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Asterisk*is*forbidden.
>> +
>> +commit be2fa9b5c5788dc05c4036f1b8197a1d33169610
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Question-mark?is?forbidden.
>> +
>> +commit 21ad093a0c1b4a96285180a3d7b99a4045ef9202
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    CR
>> is
>> also
>> forbidden.
>> +
>> +commit e63cdde7a1c90b66d7d411683528200f3f067d5f
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Ctrl is forbidden.
>> +
>> +commit 589ee305a82aacf155529e75cbc84e661c37c83d
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Del is forbidden.
>> +
>> +commit c077fe203fd18036fb00b56eec1763673d1769c6
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Colon:is:forbidden.
>> +
>> +commit ee6ef2cc9dd5525409300377b013c0d9734bd931
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Caret^is^forbidden.
>> +
>> +commit 70a83b705a2602a9493aba7f8f22e7abd13adc63
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Tilde~is~forbidden.
>> +
>> +commit 10dea8380135f4d10cd10324e13da659261ceda3
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Space is forbidden.
>> +
>> +commit 48eb60cddaefdaac5f78655f9028a9da741a18d1
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Check/multiple/../dots/...../foo..patch
>> +
>> +commit 1535e67718949abf72f843685a1672ebfe4bd21f
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Two consecutive dots (..) is forbidden.
>> +
>> +commit bbf3f5926e11d97b08cdb6e833c9deb603453d1b
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    A/component/may/not/end/in/foo.lock
>> +
>> +commit 45e81b5163ec3ed656b058ac3fd95b8986824e0f
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    The sequence .lock/ is forbidden.
>> +
>> +commit eebb76e96913d2dc78aef5f233fadc74af770b3b
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    The sequence /. is forbidden.
>> +
>> +commit d4850419ccc1146c7169f500725ce504b9774ed0
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    initial
>> +
>> +    Signed-off-by: Commiter Name <commiter@email>
>> +% guilt init
>> +% guilt import-commit base..HEAD
>> +About to begin conversion...
>> +Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541
>> +Converting 2a8b1889 as can-have-embedded-single-slashes
>> +Converting 0a46f8fa as backslash-isorbidden
>> +Converting aedb74fd as x
>> +Converting 30187ed0 as cannot@have@the@sequence@at-brace
>> +Converting 106e8e5a as cannot_end_in_
>> +Converting 95bb6cd7 as cannot-end-in-slash-
>> +Converting 6e7d52a7 as multiple-slashes--are--forbidden
>> +Converting 689f6180 as openbracketisforbidden
>> +Converting af7b50f9 as asterisk-is-forbidden
>> +Converting be2fa9b5 as question-mark-is-forbidden
>> +Converting 21ad093a as crisalsoforbidden
>> +Converting e63cdde7 as ctrlisforbidden
>> +Converting 589ee305 as delisforbidden
>> +Converting c077fe20 as colon_is_forbidden
>> +Converting ee6ef2cc as caretisforbidden
>> +Converting 70a83b70 as tildeisforbidden
>> +Converting 10dea838 as space_is_forbidden
>> +Converting 48eb60cd as check-multiple-.-dots-.-foo
>> +Converting 1535e677 as two_consecutive_dots_(.)_is_forbidden
>> +Converting bbf3f592 as a-component-may-not-end-in-foolock
>> +Converting 45e81b51 as the_sequence_.lock-_is_forbidden
>> +Converting eebb76e9 as the_sequence_-._is_forbidden
>> +Done.
>> +Current head: d4850419ccc1146c7169f500725ce504b9774ed0
>> +% guilt push -a
>> +Applying patch..the_sequence_-._is_forbidden.patch
>> +Patch applied.
>> +Applying patch..the_sequence_.lock-_is_forbidden.patch
>> +Patch applied.
>> +Applying patch..a-component-may-not-end-in-foolock.patch
>> +Patch applied.
>> +Applying patch..two_consecutive_dots_(.)_is_forbidden.patch
>> +Patch applied.
>> +Applying patch..check-multiple-.-dots-.-foo.patch
>> +Patch applied.
>> +Applying patch..space_is_forbidden.patch
>> +Patch applied.
>> +Applying patch..tildeisforbidden.patch
>> +Patch applied.
>> +Applying patch..caretisforbidden.patch
>> +Patch applied.
>> +Applying patch..colon_is_forbidden.patch
>> +Patch applied.
>> +Applying patch..delisforbidden.patch
>> +Patch applied.
>> +Applying patch..ctrlisforbidden.patch
>> +Patch applied.
>> +Applying patch..crisalsoforbidden.patch
>> +Patch applied.
>> +Applying patch..question-mark-is-forbidden.patch
>> +Patch applied.
>> +Applying patch..asterisk-is-forbidden.patch
>> +Patch applied.
>> +Applying patch..openbracketisforbidden.patch
>> +Patch applied.
>> +Applying patch..multiple-slashes--are--forbidden.patch
>> +Patch applied.
>> +Applying patch..cannot-end-in-slash-.patch
>> +Patch applied.
>> +Applying patch..cannot_end_in_.patch
>> +Patch applied.
>> +Applying patch..cannot@have@the@sequence@at-brace.patch
>> +Patch applied.
>> +Applying patch..x.patch
>> +Patch applied.
>> +Applying patch..backslash-isorbidden.patch
>> +Patch applied.
>> +Applying patch..can-have-embedded-single-slashes.patch
>> +Patch applied.
>> +% git log --decorate
>> +commit 434e07cacdd8e7eb4723e67cb2d100b3a4121a3a (HEAD, refs/patches/master/can-have-embedded-single-slashes.patch, guilt/master)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Can/have/embedded/single/slashes
>> +
>> +commit 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 (refs/patches/master/backslash-isorbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Backslash\is\forbidden.
>> +
>> +commit ea46f435d4d8f3c5349dce1aabc1a39fbf7ef803 (refs/patches/master/x.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    @
>> +
>> +commit a275ed5d7f10ea88c986852ee95a7d5a61663b5f (refs/patches/master/cannot@have@the@sequence@at-brace.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Cannot@{have@{the@{sequence@{at-brace.
>> +
>> +commit f091fee39457e64ebd35410c1cf95e6613816a54 (refs/patches/master/cannot_end_in_.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Cannot end in ..
>> +
>> +commit 025672497aff5c910c8ff86aaedc662f14c2f4ad (refs/patches/master/cannot-end-in-slash-.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Cannot/end/in/slash/
>> +
>> +commit f13e243c7c56f39422567a431bccceec8b789596 (refs/patches/master/multiple-slashes--are--forbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Multiple/slashes//are//forbidden.
>> +
>> +commit edef5e925083d445f71c170d3293fac9619bc7a2 (refs/patches/master/openbracketisforbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Open[bracket[is[forbidden.
>> +
>> +commit 1626a11d979a1e9e775c766484172212277153df (refs/patches/master/asterisk-is-forbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Asterisk*is*forbidden.
>> +
>> +commit 74df14ab3a0ec9a0382998fbf167ebb1b0a36c6a (refs/patches/master/question-mark-is-forbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Question-mark?is?forbidden.
>> +
>> +commit ec46429125abdb0c5ac2b46cc399bdcd7cfc73fd (refs/patches/master/crisalsoforbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    CR
>> is
>> also
>> forbidden.
>> +
>> +commit 01524f9921af2a041cc88c068f76baa39e436cb2 (refs/patches/master/ctrlisforbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Ctrl is forbidden.
>> +
>> +commit 9fc9677b61880f9159838e89f714893e0a2fcafb (refs/patches/master/delisforbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Del is forbidden.
>> +
>> +commit 10433fd7206b7f79aabb4da514710d93c8deed4a (refs/patches/master/colon_is_forbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Colon:is:forbidden.
>> +
>> +commit fb1edb753c97ec865ceea316420b1df586caaa2b (refs/patches/master/caretisforbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Caret^is^forbidden.
>> +
>> +commit 3a0d5ccef0359004fcaa9cee98fbd6a2c4432e74 (refs/patches/master/tildeisforbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Tilde~is~forbidden.
>> +
>> +commit ea22c3b49c448dba8d7eaa6b805f9f1bc83fbedc (refs/patches/master/space_is_forbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Space is forbidden.
>> +
>> +commit db6ea8252440b04811344336f510a5469b2ddab0 (refs/patches/master/check-multiple-.-dots-.-foo.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Check/multiple/../dots/...../foo..patch
>> +
>> +commit fe07105cd62660f4440ad24b9fc7dfdd9e71d764 (refs/patches/master/two_consecutive_dots_(.)_is_forbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Two consecutive dots (..) is forbidden.
>> +
>> +commit 96a3e92c4df85f52362ce4f6d31983c462db9ae9 (refs/patches/master/a-component-may-not-end-in-foolock.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    A/component/may/not/end/in/foo.lock
>> +
>> +commit ee4f0f96dfc9c94f5410c1e6414f9004325a37fc (refs/patches/master/the_sequence_.lock-_is_forbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    The sequence .lock/ is forbidden.
>> +
>> +commit fdcb23c3072209bea3d9e0a2594132b936c5347e (refs/patches/master/the_sequence_-._is_forbidden.patch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    The sequence /. is forbidden.
>> +
>> +commit d4850419ccc1146c7169f500725ce504b9774ed0 (tag: base, master)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    initial
>> +
>> +    Signed-off-by: Commiter Name <commiter@email>
>> +% git log --decorate some-branch
>> +commit 589ee305a82aacf155529e75cbc84e661c37c83d (tag: some-tag, some-branch)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Del is forbidden.
>> +
>> +commit c077fe203fd18036fb00b56eec1763673d1769c6
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Colon:is:forbidden.
>> +
>> +commit ee6ef2cc9dd5525409300377b013c0d9734bd931
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Caret^is^forbidden.
>> +
>> +commit 70a83b705a2602a9493aba7f8f22e7abd13adc63
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Tilde~is~forbidden.
>> +
>> +commit 10dea8380135f4d10cd10324e13da659261ceda3
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Space is forbidden.
>> +
>> +commit 48eb60cddaefdaac5f78655f9028a9da741a18d1
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Check/multiple/../dots/...../foo..patch
>> +
>> +commit 1535e67718949abf72f843685a1672ebfe4bd21f
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    Two consecutive dots (..) is forbidden.
>> +
>> +commit bbf3f5926e11d97b08cdb6e833c9deb603453d1b
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    A/component/may/not/end/in/foo.lock
>> +
>> +commit 45e81b5163ec3ed656b058ac3fd95b8986824e0f
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    The sequence .lock/ is forbidden.
>> +
>> +commit eebb76e96913d2dc78aef5f233fadc74af770b3b
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    The sequence /. is forbidden.
>> +
>> +commit d4850419ccc1146c7169f500725ce504b9774ed0 (tag: base, master)
>> +Author: Author Name <author@email>
>> +Date:   Mon Jan 1 00:00:00 2007 +0000
>> +
>> +    initial
>> +
>> +    Signed-off-by: Commiter Name <commiter@email>
>> +% list_files
>> +d .git/patches
>> +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
>> +f 2cd7c9ad392e071be03c051c6793e9b1e31d33c4  .git/patches/master/can-have-embedded-single-slashes.patch
>> +f 3136e448a4c820f6d2642f9d894c4087d3d109ab  .git/patches/master/cannot_end_in_.patch
>> +f 34e07c584032df137f19bdb66d93f316f00a5ac8  .git/patches/master/tildeisforbidden.patch
>> +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 7b103c3c7ae298cd2334f6f49da48bae1424f77b  .git/patches/master/crisalsoforbidden.patch
>> +f 9b810b8c63779c51d2e7f61ab59cd49835041563  .git/patches/master/x.patch
>> +f a22958d9ae9976fd7b2b5a9d0bcd44bf7ad9b08a  .git/patches/master/caretisforbidden.patch
>> +f ab325bf5a432937fc6f231d3e8a773a62d53952b  .git/patches/master/multiple-slashes--are--forbidden.patch
>> +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 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
>> +f edfaa5e06bd662ae1f6a642834324fd9b849bbd9  .git/patches/master/a-component-may-not-end-in-foolock.patch
>> +r 01524f9921af2a041cc88c068f76baa39e436cb2  .git/refs/patches/master/ctrlisforbidden.patch
>> +r 025672497aff5c910c8ff86aaedc662f14c2f4ad  .git/refs/patches/master/cannot-end-in-slash-.patch
>> +r 10433fd7206b7f79aabb4da514710d93c8deed4a  .git/refs/patches/master/colon_is_forbidden.patch
>> +r 1626a11d979a1e9e775c766484172212277153df  .git/refs/patches/master/asterisk-is-forbidden.patch
>> +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 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
>> +r db6ea8252440b04811344336f510a5469b2ddab0  .git/refs/patches/master/check-multiple-.-dots-.-foo.patch
>> +r ea22c3b49c448dba8d7eaa6b805f9f1bc83fbedc  .git/refs/patches/master/space_is_forbidden.patch
>> +r ea46f435d4d8f3c5349dce1aabc1a39fbf7ef803  .git/refs/patches/master/x.patch
>> +r ec46429125abdb0c5ac2b46cc399bdcd7cfc73fd  .git/refs/patches/master/crisalsoforbidden.patch
>> +r edef5e925083d445f71c170d3293fac9619bc7a2  .git/refs/patches/master/openbracketisforbidden.patch
>> +r ee4f0f96dfc9c94f5410c1e6414f9004325a37fc  .git/refs/patches/master/the_sequence_.lock-_is_forbidden.patch
>> +r f091fee39457e64ebd35410c1cf95e6613816a54  .git/refs/patches/master/cannot_end_in_.patch
>> +r f13e243c7c56f39422567a431bccceec8b789596  .git/refs/patches/master/multiple-slashes--are--forbidden.patch
>> +r fb1edb753c97ec865ceea316420b1df586caaa2b  .git/refs/patches/master/caretisforbidden.patch
>> +r fdcb23c3072209bea3d9e0a2594132b936c5347e  .git/refs/patches/master/the_sequence_-._is_forbidden.patch
>> +r fe07105cd62660f4440ad24b9fc7dfdd9e71d764  .git/refs/patches/master/two_consecutive_dots_(.)_is_forbidden.patch
>> +% guilt pop -a
>> +All patches popped.
>> diff --git a/regression/t-034.sh b/regression/t-034.sh
>> new file mode 100755
>> index 0000000..f41f958
>> --- /dev/null
>> +++ b/regression/t-034.sh
>> @@ -0,0 +1,71 @@
>> +#!/bin/bash
>> +#
>> +# Test import-commit
>> +#
>> +
>> +function create_commit
>> +{
>> +     echo $1 >> $1 &&
>> +             git add $1 &&
>> +             git commit -m"$2"
>> +}
>> +
>> +source "$REG_DIR/scaffold"
>> +
>> +b()
>> +{
>> +     printf "%b" "$1"
>> +}
>> +
>> +cmd setup_git_repo
>> +
>> +cmd git tag base
>> +
>> +# Create a series of commits whose first line of the commit message
>> +# each violates one of the rules in get-check-ref-format(1).
>> +
>> +cmd create_commit a "The sequence /. is forbidden."
>> +cmd create_commit a "The sequence .lock/ is forbidden."
>> +cmd create_commit a "A/component/may/not/end/in/foo.lock"
>> +cmd create_commit a "Two consecutive dots (..) is forbidden."
>> +cmd create_commit a "Check/multiple/../dots/...../foo..patch"
>> +cmd create_commit a "Space is forbidden."
>> +cmd create_commit a "Tilde~is~forbidden."
>> +cmd create_commit a "Caret^is^forbidden."
>> +cmd create_commit a "Colon:is:forbidden."
>> +cmd create_commit a `b 'Del\177is\177forbidden.'`
>> +# Create a branch and a tag from the current commit, to ensure that
>> +# doing so does not affect how the commit is imported.
>> +cmd git branch some-branch
>> +cmd git tag some-tag
>> +cmd create_commit a `b 'Ctrl\001is\002forbidden.'`
>> +cmd create_commit a `b 'CR\ris\ralso\rforbidden.'`
>> +cmd create_commit a "Question-mark?is?forbidden."
>> +cmd create_commit a "Asterisk*is*forbidden."
>> +cmd create_commit a "Open[bracket[is[forbidden."
>> +cmd create_commit a "Multiple/slashes//are//forbidden."
>> +cmd create_commit a "Cannot/end/in/slash/"
>> +cmd create_commit a "Cannot end in .."
>> +cmd create_commit a "Cannot@{have@{the@{sequence@{at-brace."
>> +cmd create_commit a "@"
>> +cmd create_commit a "Backslash\\is\\forbidden."
>> +
>> +# Slash is sometimes allowed; this is not problematic.
>> +cmd create_commit a "Can/have/embedded/single/slashes"
>> +
>> +cmd git log
>> +
>> +# Import all the commits to guilt.
>> +cmd guilt init
>> +cmd guilt import-commit base..HEAD
>> +
>> +for patch in .git/patches/master/*.patch; do
>> +     touch -a -m -t "$TOUCH_DATE" "$patch"
>> +done
>> +
>> +# If push and pop works, the names we created are good.
>> +cmd guilt push -a
>> +cmd git log --decorate
>> +cmd git log --decorate some-branch
>> +cmd list_files
>> +cmd guilt pop -a
>> --
>> 1.8.3.1
>>
>
> --
> C is quirky, flawed, and an enormous success.
>                 - Dennis M. Ritchie.

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2015-01-22 15:50 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [GUILT v4 16/33] Fix backslash handling when creating names of imported patches Per Cederqvist
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

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.