On Tue, May 13, 2014 at 11:30 PM, Jeff Sipek jef...@josefsipek.net wrote:
On Tue, May 13, 2014 at 10:30:43PM +0200, Per Cederqvist wrote:
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 ced...@opera.com
---
regression/t-035.out | 467
+++
regression/t-035.sh | 62 +++
2 files changed, 529 insertions(+)
create mode 100644 regression/t-035.out
create mode 100755 regression/t-035.sh
...
diff --git a/regression/t-035.sh b/regression/t-035.sh
new file mode 100755
index 000..e914b32
--- /dev/null
+++ b/regression/t-035.sh
@@ -0,0 +1,62 @@
+#!/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
I know that this is before patch 29, but ... style? ;)
Otherwise, looks good. I like this way better than the unrolled loop in v1
of this patch.
Signed-off-by: Josef 'Jeff' Sipek jef...@josefsipek.net
It is hard to change a habit. :-)
I'll fix this and add your signed-off-by.
/ceder
+ 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
--
*NOTE: This message is ROT-13 encrypted twice for extra protection*
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html