diff --git a/guilt-push b/guilt-push index 4516b00..3509e4b 100755 --- a/guilt-push +++ b/guilt-push @@ -104,7 +104,7 @@ do die "Patch $p does not exist. Aborting." fi - push_patch $p $abort_flag + push_patch "$p" $abort_flag # bail if necessary if [ $? -eq 0 ]; then diff --git a/regression/010-init.sh b/regression/010-init.sh deleted file mode 100755 index 1553d0c..0000000 --- a/regression/010-init.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# Test the init code -# - -source scaffold - -function expected_files_master -{ - cat << DONE -d .git/patches -d .git/patches/master -f .git/patches/master/series -f .git/patches/master/status -DONE -} - -function expected_files_other -{ - expected_files_master - cat << DONE -d .git/patches/other -f .git/patches/other/series -f .git/patches/other/status -DONE -} - -# the test itself -empty_repo -cd $REPODIR - -# make sure we have an index to work with -echo "abc" > def -git-add def 2> /dev/null > /dev/null -git-commit -m "foo" 2> /dev/null > /dev/null - -branches="master other" - -for b in $branches -do - if [ "$b" != "master" ]; then - git-branch $b - git-checkout $b 2> /dev/null - fi - - guilt-init - expected_files_$b | verify_repo .git/patches - echo -n "[$b:create] " - - shouldfail guilt-init - echo -n "[$b:exists] " -done - -complete_test - diff --git a/regression/011-no-repo.sh b/regression/011-no-repo.sh deleted file mode 100755 index fd4f6a5..0000000 --- a/regression/011-no-repo.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# Test that all commands that should fail do indeed fail if the branch was -# not guilt-init'ed -# - -source scaffold - -# the test itself -empty_repo -cd $REPODIR - -tests="guilt-applied guilt-delete guilt-header guilt-new guilt-next guilt-pop guilt-prev guilt-push guilt-refresh guilt-series guilt-top guilt-unapplied" -for t in $tests; do - shouldfail $t - - echo -n "[$t] " -done - -complete_test - diff --git a/regression/020-push.sh b/regression/020-push.sh deleted file mode 100755 index fdabd75..0000000 --- a/regression/020-push.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# Test the push code -# - -source scaffold -source generic_test_data - -function expected_files -{ - cat << DONE -d .git/patches -d .git/patches/master -f .git/patches/master/series -f .git/patches/master/status -f .git/patches/master/modify -f .git/patches/master/add -f .git/patches/master/remove -f .git/patches/master/mode -DONE -} - -patches=4 - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -# NOTE: this has to be in the same order as the series file -tests="modify add remove mode" - -for t in $tests -do - guilt-push > /dev/null - - expected_files | verify_repo .git/patches - - echo -n "[unnamed-$t] " -done - -guilt-pop --all > /dev/null - -for t in $tests -do - guilt-push $t > /dev/null - - expected_files | verify_repo .git/patches - - echo -n "[$t] " - - guilt-pop --all > /dev/null -done - -guilt-pop --all > /dev/null - -for n in `seq -1 $patches` -do - if [ $n -ge 0 ]; then - guilt-push -n $n > /dev/null - else - shouldfail guilt-push -n $n > /dev/null - fi - - expected_files | verify_repo .git/patches - - echo -n "[-n:$n] " - - guilt-pop --all > /dev/null -done - -# FIXME: make sure --all and multiple patch push works - -complete_test - diff --git a/regression/021-pop.sh b/regression/021-pop.sh deleted file mode 100755 index a503aef..0000000 --- a/regression/021-pop.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# Test the pop code -# - -source scaffold -source generic_test_data - -function expected_files -{ - cat << DONE -d .git/patches -d .git/patches/master -f .git/patches/master/series -f .git/patches/master/status -f .git/patches/master/modify -f .git/patches/master/add -f .git/patches/master/remove -f .git/patches/master/mode -DONE -} - -patches=4 - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -guilt-push --all > /dev/null - -# NOTE: this has to be in the reverse order as the series file -tests="mode remove add modify" - -for t in $tests -do - guilt-pop > /dev/null - - expected_files | verify_repo .git/patches - - echo -n "[unnamed-$t] " -done - -guilt-push --all > /dev/null - -for t in $tests -do - guilt-pop $t > /dev/null - - expected_files | verify_repo .git/patches - - echo -n "[$t] " - - guilt-push --all > /dev/null -done - -guilt-pop --all > /dev/null - -for n in `seq -1 $patches` -do - if [ $n -ge 0 ]; then - guilt-push -n $n > /dev/null - else - shouldfail guilt-push -n $n > /dev/null - fi - - expected_files | verify_repo .git/patches - - echo -n "[-n:$n] " - - guilt-pop --all > /dev/null -done - -# FIXME: make sure --all and multiple patch pop works - -complete_test - diff --git a/regression/022-applied.sh b/regression/022-applied.sh deleted file mode 100755 index f259bf4..0000000 --- a/regression/022-applied.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -# -# Test the applied code -# - -source scaffold -source generic_test_data - -function expected_status_modify -{ - [ ! -z "$1" ] && echo -n "33633e7a1aa31972f125878baf7807be57b1672d:" - echo "modify" -} - -function expected_status_add -{ - [ ! -z "$1" ] && echo -n "33633e7a1aa31972f125878baf7807be57b1672d:" - echo "modify" - - [ ! -z "$1" ] && echo -n "68f33a015dcfd09c3896f15d152378b54eaa4eb6:" - echo "add" -} - -function expected_status_remove -{ - [ ! -z "$1" ] && echo -n "33633e7a1aa31972f125878baf7807be57b1672d:" - echo "modify" - - [ ! -z "$1" ] && echo -n "68f33a015dcfd09c3896f15d152378b54eaa4eb6:" - echo "add" - - [ ! -z "$1" ] && echo -n "e67345cf1e7e9594c73efad7381a994f1fe63b14:" - echo "remove" -} - -function expected_status_mode -{ - [ ! -z "$1" ] && echo -n "33633e7a1aa31972f125878baf7807be57b1672d:" - echo "modify" - - [ ! -z "$1" ] && echo -n "68f33a015dcfd09c3896f15d152378b54eaa4eb6:" - echo "add" - - [ ! -z "$1" ] && echo -n "e67345cf1e7e9594c73efad7381a994f1fe63b14:" - echo "remove" - - [ ! -z "$1" ] && echo -n "632ca0f5ec27a961990b45673dfc751f1da830f3:" - echo "mode" -} - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -# NOTE: this has to be in the same order as the series file -tests="modify add remove mode" - -for t in $tests -do - guilt-push > /dev/null - - guilt-applied > /tmp/reg.$$ - - expected_status_$t | diff -u - /tmp/reg.$$ - expected_status_$t "file" | diff -u - $REPODIR/.git/patches/master/status - - echo -n "[$t] " -done - -rm -f /tmp/reg.$$ - -complete_test - diff --git a/regression/023-top.sh b/regression/023-top.sh deleted file mode 100755 index c486448..0000000 --- a/regression/023-top.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Test the top code -# - -source scaffold -source generic_test_data - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -# NOTE: this has to be in the same order as the series file -tests="modify add remove mode" - -for t in $tests -do - guilt-push > /dev/null - - [ "`guilt-top`" = "$t" ] - - echo -n "[$t] " -done - -complete_test - diff --git a/regression/024-unapplied.sh b/regression/024-unapplied.sh deleted file mode 100755 index ecb0298..0000000 --- a/regression/024-unapplied.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# -# Test the unapplied code -# - -source scaffold -source generic_test_data - -function expected_status_modify -{ - echo "add" - echo "remove" - echo "mode" -} - -function expected_status_add -{ - echo "remove" - echo "mode" -} - -function expected_status_remove -{ - echo "mode" -} - -function expected_status_mode -{ - return 0 -} - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -# NOTE: this has to be in the same order as the series file -tests="modify add remove mode" - -for t in $tests -do - guilt-push > /dev/null - - guilt-unapplied > /tmp/reg.$$ - - expected_status_$t | diff -u - /tmp/reg.$$ - - echo -n "[$t] " -done - -rm -f /tmp/reg.$$ - -complete_test - diff --git a/regression/025-new.sh b/regression/025-new.sh deleted file mode 100755 index 680f6da..0000000 --- a/regression/025-new.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash -# -# Test the new code -# - -source scaffold -source generic_test_data - -function expected_files -{ - cat << DONE -d .git/patches -d .git/patches/master -f .git/patches/master/series -f .git/patches/master/status -f .git/patches/master/modify -f .git/patches/master/add -f .git/patches/master/remove -f .git/patches/master/mode -DONE -} - -function patch_name_dir -{ - echo "aaa" -} -function expected_files_dir -{ - expected_files - cat << DONE -f .git/patches/master/aaa -DONE -} - -function patch_name_subdir -{ - echo "abc/def" -} -function expected_files_subdir -{ - expected_files_dir - cat << DONE -d .git/patches/master/abc -f .git/patches/master/abc/def -DONE -} - -function patch_name_subsubdir -{ - echo "foo/bar/patch" -} -function expected_files_subsubdir -{ - expected_files_subdir - cat << DONE -d .git/patches/master/foo -d .git/patches/master/foo/bar -f .git/patches/master/foo/bar/patch -DONE -} - -function expected_files_append -{ - expected_files_subsubdir - echo "f .git/patches/master/append" -} - -function expected_files_prepend -{ - expected_files_append - echo "f .git/patches/master/prepend" -} - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -tests="dir subdir subsubdir" - -for t in $tests; do - guilt-new `patch_name_$t` - - expected_files_$t | verify_repo .git/patches - - echo -n "[$t] " -done - -guilt-push --all > /dev/null - -guilt-new append -expected_files_append | verify_repo .git/patches -echo -n "[append] " - -guilt-pop -a > /dev/null - -guilt-new prepend -expected_files_prepend | verify_repo .git/patches -echo -n "[prepend] " - -guilt-pop -a > /dev/null - -guilt-new "white space" -echo -n "[whitespace] " - -shouldfail guilt-new prepend -echo -n "[dup] " - -shouldfail guilt-new /abc -echo -n "[abs] " - -shouldfail guilt-new ./blah -echo -n "[prefix-dot] " - -shouldfail guilt-new ../blah -echo -n "[prefix-dotdot] " - -shouldfail guilt-new abc/./blah -echo -n "[infix-dot] " - -shouldfail guilt-new abc/../blah -echo -n "[infix-dotdot] " - -shouldfail guilt-new abc/. -echo -n "[postfix-dot] " - -shouldfail guilt-new abc/.. -echo -n "[postfix-dotdot] " - -shouldfail guilt-new abc/ -echo -n "[postfix-slash] " - -complete_test - diff --git a/regression/026-delete.sh b/regression/026-delete.sh deleted file mode 100755 index 07c969a..0000000 --- a/regression/026-delete.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# Test the delete code -# - -source scaffold -source generic_test_data - -function expected_files_after_force -{ - cat << DONE -d .git/patches -d .git/patches/master -f .git/patches/master/series -f .git/patches/master/status -f .git/patches/master/modify -f .git/patches/master/add -f .git/patches/master/remove -DONE -} - -function expected_files_after -{ - expected_files_after_force - echo "f .git/patches/master/mode" -} - -function expected_series -{ - cat << DONE -modify -add -remove -DONE -} - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -guilt-delete mode -expected_files_after | verify_repo .git/patches -echo -n "[delete] " - -expected_series | diff -u - .git/patches/master/series -echo -n "[delete-series] " - -# cleanup -cd ../ -rm -rf $REPODIR - -# set up again -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -guilt-delete -f mode -expected_files_after_force | verify_repo .git/patches -echo -n "[force] " - -expected_series | diff -u - .git/patches/master/series -echo -n "[delete-series] " - -complete_test - diff --git a/regression/027-refresh.sh b/regression/027-refresh.sh deleted file mode 100755 index 704d0b5..0000000 --- a/regression/027-refresh.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# Test the refresh code -# - -source scaffold -source generic_test_data - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -# test refresh when no patches are applied -echo abcdef >> def -shouldfail guilt-refresh 2> /dev/null -echo -n "[none] " - -# clean things up a little -git-reset --hard HEAD > /dev/null - -guilt-push > /dev/null - -# test when there is a patch applied -echo abcdef >> def -guilt-refresh -echo -n "[applied] " - -# FIXME: we should check that the patch actually contains what it should - -complete_test - diff --git a/regression/050-series.sh b/regression/050-series.sh deleted file mode 100755 index eb23540..0000000 --- a/regression/050-series.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# -# Test the series parsing code -# - -source scaffold -source generic_test_data - -function prepare_for_tests -{ - generic_prepare_for_tests - - # change the series file - cat << DONE > .git/patches/master/series -# - -# -# foo -# - - # - # - # some text - # some text -modify -add - -remove -mode -#sure -DONE -} - -function expected_series -{ - echo "modify" - echo "add" - echo "remove" - echo "mode" -} - -function expected_series_with_v -{ - echo "+ modify" - echo "+ add" - echo "= remove" - echo " mode" -} - -function expected_series_with_v_all_unapplied -{ - echo " modify" - echo " add" - echo " remove" - echo " mode" -} - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -prepare_for_tests - -# NOTE: this has to be in the same order as the series file -tests="empty modify add remove mode" - -for t in $tests -do - [ "$t" != "empty" ] && guilt-push > /dev/null - - guilt-series > /tmp/reg.$$ - - expected_series | diff -u - /tmp/reg.$$ - - echo -n "[$t] " -done - -# test for -v -# pop the last patch for test -guilt-pop > /dev/null -guilt-series -v > /tmp/reg.$$ -expected_series_with_v | diff -u - /tmp/reg.$$ -echo -n "[verbose] " - -guilt-pop -a > /dev/null -guilt-series -v > /tmp/reg.$$ -expected_series_with_v_all_unapplied | diff -u - /tmp/reg.$$ -echo -n "[verbose none] " - -rm -f /tmp/reg.$$ - -complete_test - diff --git a/regression/060-files.sh b/regression/060-files.sh deleted file mode 100755 index 915c73a..0000000 --- a/regression/060-files.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# Test the series parsing code -# - -source scaffold -source generic_test_data - -# the test itself -empty_repo -cd $REPODIR -guilt-init - -generic_prepare_for_tests - -# create a patch that contains a file in a subdirectory -guilt-new subdir -mkdir blah -touch blah/sub -guilt-add blah/sub -guilt-refresh - -function expected_files -{ - echo "def" -} - -function expected_files_label -{ - echo "mode def" -} - -function expected_files_verbose_label -{ - echo "[mode] def" -} - -function expected_files_all -{ - echo "blah/sub" - echo "def" - echo "abd" - echo "abd" - echo "def" -} - -function expected_files_label_all -{ - echo "subdir blah/sub" - echo "modify def" - echo "add abd" - echo "remove abd" - echo "mode def" -} - -function expected_files_verbose_all -{ - echo "subdir" - echo "+ blah/sub" - echo "modify" - echo " def" - echo "add" - echo "+ abd" - echo "remove" - echo "- abd" - echo "mode" - echo " def" -} - -function expected_files_verbose_label_all -{ - echo "[subdir] blah/sub" - echo "[modify] def" - echo "[add] abd" - echo "[remove] abd" - echo "[mode] def" - -} - -# push em all for tesing -guilt-push -a > /dev/null - -guilt-files > /tmp/reg.$$ -expected_files | diff -u - /tmp/reg.$$ -echo -n "[files] " - -guilt-files -l > /tmp/reg.$$ -expected_files_label | diff -u - /tmp/reg.$$ -echo -n "[label] " - -guilt-files -v -l > /tmp/reg.$$ -expected_files_verbose_label | diff -u - /tmp/reg.$$ -echo -n "[verbose label] " - -guilt-files -a > /tmp/reg.$$ -expected_files_all | diff -u - /tmp/reg.$$ -echo -n "[all] " - -guilt-files -l -a > /tmp/reg.$$ -expected_files_label_all | diff -u - /tmp/reg.$$ -echo -n "[label all] " - -guilt-files -v -a > /tmp/reg.$$ -expected_files_verbose_all | diff -u - /tmp/reg.$$ -echo -n "[verbose all] " - -guilt-files -v -l -a > /tmp/reg.$$ -expected_files_verbose_label_all | diff -u - /tmp/reg.$$ -echo -n "[verbose label all] " - -rm -f /tmp/reg.$$ - -complete_test - diff --git a/regression/Makefile b/regression/Makefile deleted file mode 100644 index 3dd9d0e..0000000 --- a/regression/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -.PHONY: all -all: - set -e; $(foreach x,$(wildcard *.sh),./$x;) diff --git a/regression/data/add.patch b/regression/data/add.patch new file mode 100644 index 0000000..f9f3429 --- /dev/null +++ b/regression/data/add.patch @@ -0,0 +1,7 @@ +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert diff --git a/regression/data/mode.patch b/regression/data/mode.patch new file mode 100644 index 0000000..c447f49 --- /dev/null +++ b/regression/data/mode.patch @@ -0,0 +1,3 @@ +diff --git a/def b/def +old mode 100644 +new mode 100755 diff --git a/regression/data/modify.patch b/regression/data/modify.patch new file mode 100644 index 0000000..3762169 --- /dev/null +++ b/regression/data/modify.patch @@ -0,0 +1,7 @@ +diff --git a/def b/def +index 8baef1b..7d69c2f 100644 +--- a/def ++++ b/def +@@ -1 +1,2 @@ + abc ++asjhfksad diff --git a/regression/data/remove.patch b/regression/data/remove.patch new file mode 100644 index 0000000..bb78b06 --- /dev/null +++ b/regression/data/remove.patch @@ -0,0 +1,7 @@ +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert diff --git a/regression/data/series b/regression/data/series new file mode 100644 index 0000000..f69b29d --- /dev/null +++ b/regression/data/series @@ -0,0 +1,16 @@ +# + +# +# foo +# + + # + # + # some text + # some text +modify +add + +remove +mode +#sure diff --git a/regression/generic_test_data b/regression/generic_test_data deleted file mode 100644 index cb5938b..0000000 --- a/regression/generic_test_data +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -function generic_prepare_for_tests -{ - # set up the repo so we have something interesting to run guilt on - echo "abc" > def - git-add def - git-commit -s -m "initial" 2> /dev/null > /dev/null - - # patch to modify a file - cat << DONE > .git/patches/master/modify -diff --git a/def b/def -index 8baef1b..7d69c2f 100644 ---- a/def -+++ b/def -@@ -1 +1,2 @@ - abc -+asjhfksad -DONE - - # patch to add a new file - cat << DONE > .git/patches/master/add -diff --git a/abd b/abd -new file mode 100644 -index 0000000..489450e ---- /dev/null -+++ b/abd -@@ -0,0 +1 @@ -+qweert -DONE - - # patch to remove an existing file - cat << DONE > .git/patches/master/remove -diff --git a/abd b/abd -deleted file mode 100644 -index 489450e..0000000 ---- a/abd -+++ /dev/null -@@ -1 +0,0 @@ --qweert -DONE - - # patch to change a mode - cat << DONE > .git/patches/master/mode -diff --git a/def b/def -old mode 100644 -new mode 100755 -DONE - - # the series file of all the things - cat << DONE > .git/patches/master/series -modify -add -remove -mode -DONE - - touch -d "$GIT_COMMITTER_DATE" .git/patches/master/modify - touch -d "$GIT_COMMITTER_DATE" .git/patches/master/add - touch -d "$GIT_COMMITTER_DATE" .git/patches/master/remove - touch -d "$GIT_COMMITTER_DATE" .git/patches/master/mode -} - diff --git a/regression/run-tests b/regression/run-tests new file mode 100755 index 0000000..c445f2f --- /dev/null +++ b/regression/run-tests @@ -0,0 +1,71 @@ +#!/bin/bash + +export REG_DIR="$PWD" + +source scaffold + +# usage: empty_repo +function empty_repo +{ + rm -rf $REPODIR + mkdir $REPODIR + cd $REPODIR > /dev/null + git-init-db 2> /dev/null > /dev/null + cd - > /dev/null +} + +function test_failed +{ + cat >&2 < +function run_test +{ + export REPODIR="/tmp/guilt.reg.$RANDOM" + export LOGFILE="/tmp/guilt.log.$RANDOM" + export TESTNAME="$1" + + echo -n "$1: " + + empty_repo + + # run the test + cd $REPODIR > /dev/null + "$REG_DIR/$1" 2>&1 > "$LOGFILE" + ERR=$? + cd - > /dev/null + + [ $? -ne 0 ] && test_failed + diff -u "`basename $1 .sh`.out" "$LOGFILE" || test_failed + + echo "done." + + rm -rf $REPODIR $LOGFILE +} + +case "$1" in + -h|--help) + echo "Usage: $0 [ [&2 + exit 2 +fi set -e -export REPODIR=/tmp/$RANDOM export PATH=$PWD/..:$PATH -function empty_repo +export TZ="UTC" +export GIT_AUTHOR_DATE="2007-01-01 00:00:00 UTC" +export GIT_COMMITTER_DATE="2007-01-01 00:00:00 UTC" +export GIT_AUTHOR_NAME="Author Name" +export GIT_AUTHOR_EMAIL="author@email" +export GIT_COMMITTER_NAME="Commiter Name" +export GIT_COMMITTER_EMAIL="commiter@email" + +# usage: die +function die { - rm -rf $REPODIR || exit 1 - mkdir $REPODIR || exit 1 - cd $REPODIR - git-init-db 2> /dev/null > /dev/null + echo "Error: $@" >&2 + exit 1 } -function verify_repo +# usage: begin +function begin { - ( find $1 -type d -printf 'd %p\n' ; find $1 -type f -printf 'f %p\n' ; find $1 -type b -printf 'b %p\n' ; find $1 -type c -printf %'c %p\n' ; find $1 -type l -printf 'l %p\n') | sort > /tmp/check-$$ - grep -v '^$' | sort | diff -u - /tmp/check-$$ - ERR=$? - rm -f /tmp/check-$$ - return $ERR + echo "% $1" } +# usage: shouldfail .. function shouldfail { - if $* 2>/tmp/saveout-$$ ; then - echo "UNWANTED SUCCESS: " $* - cat /tmp/saveout-$$ - return 1 - fi - rm -f /tmp/saveout-$$ - return 0 + "$@" || return 0 + return 1 } -function complete_test +# usage: list_files +function list_files { - echo "OK" - rm -rf $REPODIR + ( + find .git/patches -type f -printf "f " -exec sha1sum {} \; + find .git/patches -type d -printf "d %p\n" + ) | sort } -export TZ="UTC" -export GIT_AUTHOR_DATE="2007-01-01 00:00:00 UTC" -export GIT_COMMITTER_DATE="2007-01-01 00:00:00 UTC" -export GIT_AUTHOR_NAME="Author Name" -export GIT_AUTHOR_EMAIL="author@email" -export GIT_COMMITTER_NAME="Commiter Name" -export GIT_COMMITTER_EMAIL="commiter@email" +function setup_git_repo +{ + # set up the repo so we have something interesting to run guilt on + echo "abc" > def + git-add def + git-commit -s -m "initial" 2> /dev/null > /dev/null +} + +function setup_repo +{ + setup_git_repo + + mkdir -p .git/patches/master + + # patch to modify a file + cp "$REG_DIR/data/modify.patch" .git/patches/master/modify -echo -n "`basename $0`: " + # patch to add a new file + cp "$REG_DIR/data/add.patch" .git/patches/master/add + + # patch to remove an existing file + cp "$REG_DIR/data/remove.patch" .git/patches/master/remove + + # patch to change a mode + cp "$REG_DIR/data/mode.patch" .git/patches/master/mode + + # the series file of all the things + cp "$REG_DIR/data/series" .git/patches/master/series + + # the status file + touch .git/patches/master/status + + # the status file + touch .git/patches/master/status + + touch -d "$GIT_COMMITTER_DATE" .git/patches/master/modify + touch -d "$GIT_COMMITTER_DATE" .git/patches/master/add + touch -d "$GIT_COMMITTER_DATE" .git/patches/master/remove + touch -d "$GIT_COMMITTER_DATE" .git/patches/master/mode +} diff --git a/regression/t-010.out b/regression/t-010.out new file mode 100644 index 0000000..bd8dee4 --- /dev/null +++ b/regression/t-010.out @@ -0,0 +1,35 @@ +% setup_git_repo +% guilt-init +% list_files +d .git/patches +d .git/patches/master +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/series +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% guilt-init (should fail) +Branch master appears to be already initialized (GIT_DIR=.git) +% list_files +d .git/patches +d .git/patches/master +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/series +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% git-branch other +% git-checkout other +% guilt-init (other branch) +% list_files +d .git/patches +d .git/patches/master +d .git/patches/other +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/series +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/other/series +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/other/status +% guilt-init (other branch, should fail) +Branch other appears to be already initialized (GIT_DIR=.git) +% list_files +d .git/patches +d .git/patches/master +d .git/patches/other +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/series +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/other/series +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/other/status diff --git a/regression/t-010.sh b/regression/t-010.sh new file mode 100755 index 0000000..6b1501a --- /dev/null +++ b/regression/t-010.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Test the init code +# + +source $REG_DIR/scaffold + +function relative_git_dir_path +{ + sed -e "s,GIT_DIR=$PWD/,GIT_DIR=," +} + +begin "setup_git_repo" +setup_git_repo + +begin "guilt-init" +guilt-init 2>&1 + +begin "list_files" +list_files + +begin "guilt-init (should fail)" +shouldfail guilt-init 2>&1 | relative_git_dir_path + +begin "list_files" +list_files + +begin "git-branch other" +git-branch other + +begin "git-checkout other" +git-checkout other 2> /dev/null + +begin "guilt-init (other branch)" +guilt-init 2>&1 + +begin "list_files" +list_files + +begin "guilt-init (other branch, should fail)" +shouldfail guilt-init 2>&1 | relative_git_dir_path + +begin "list_files" +list_files diff --git a/regression/t-011.out b/regression/t-011.out new file mode 100644 index 0000000..532a369 --- /dev/null +++ b/regression/t-011.out @@ -0,0 +1,51 @@ +% setup_git_repo +% guilt-add +Patches directory doesn't exist, try guilt-init +% guilt-applied +Patches directory doesn't exist, try guilt-init +% guilt-branch +Patches directory doesn't exist, try guilt-init +% guilt-delete +Patches directory doesn't exist, try guilt-init +% guilt-diff +Patches directory doesn't exist, try guilt-init +% guilt-export +Patches directory doesn't exist, try guilt-init +% guilt-files +Patches directory doesn't exist, try guilt-init +% guilt-fold +Patches directory doesn't exist, try guilt-init +% guilt-fork +Patches directory doesn't exist, try guilt-init +% guilt-graph +Patches directory doesn't exist, try guilt-init +% guilt-header +Patches directory doesn't exist, try guilt-init +% guilt-import +Patches directory doesn't exist, try guilt-init +% guilt-import-commit +Patches directory doesn't exist, try guilt-init +% guilt-new +Patches directory doesn't exist, try guilt-init +% guilt-next +Patches directory doesn't exist, try guilt-init +% guilt-pop +Patches directory doesn't exist, try guilt-init +% guilt-prev +Patches directory doesn't exist, try guilt-init +% guilt-push +Patches directory doesn't exist, try guilt-init +% guilt-rebase +Patches directory doesn't exist, try guilt-init +% guilt-refresh +Patches directory doesn't exist, try guilt-init +% guilt-rm +Patches directory doesn't exist, try guilt-init +% guilt-series +Patches directory doesn't exist, try guilt-init +% guilt-status +Patches directory doesn't exist, try guilt-init +% guilt-top +Patches directory doesn't exist, try guilt-init +% guilt-unapplied +Patches directory doesn't exist, try guilt-init diff --git a/regression/t-011.sh b/regression/t-011.sh new file mode 100755 index 0000000..0c67374 --- /dev/null +++ b/regression/t-011.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# +# Test that all commands that should fail do indeed fail if the branch was +# not guilt-init'ed +# + +source $REG_DIR/scaffold + +begin "setup_git_repo" +setup_git_repo + +tests="guilt-add guilt-applied guilt-branch guilt-delete guilt-diff guilt-export guilt-files guilt-fold guilt-fork guilt-graph guilt-header guilt-import guilt-import-commit guilt-new guilt-next guilt-pop guilt-prev guilt-push guilt-rebase guilt-refresh guilt-rm guilt-series guilt-status guilt-top guilt-unapplied" +for t in $tests; do + begin "$t" + shouldfail $t 2>&1 +done diff --git a/regression/t-020.out b/regression/t-020.out new file mode 100644 index 0000000..fee8c8b --- /dev/null +++ b/regression/t-020.out @@ -0,0 +1,1056 @@ +% setup_repo +% guilt-push (unnamed, modify) +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push (unnamed, add) +Applying patch..add +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% git-log +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push (unnamed, remove) +Applying patch..remove +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% git-log +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push (unnamed, mode) +Applying patch..mode +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 632ca0f5ec27a961990b45673dfc751f1da830f3 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch mode + +diff --git a/def b/def +old mode 100644 +new mode 100755 + +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 modify (named, modify) +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 add (named, add) +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 remove (named, remove) +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 mode (named, mode) +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 modify (named, incremental, modify) +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push add (named, incremental, add) +Applying patch..add +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% git-log +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push remove (named, incremental, remove) +Applying patch..remove +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% git-log +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push mode (named, incremental, mode) +Applying patch..mode +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 632ca0f5ec27a961990b45673dfc751f1da830f3 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch mode + +diff --git a/def b/def +old mode 100644 +new mode 100755 + +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 +Invalid number of patches to push. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% git-log +commit d4850419ccc1146c7169f500725ce504b9774ed0 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 +Invalid number of patches to push. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% git-log +commit d4850419ccc1146c7169f500725ce504b9774ed0 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 1 +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 +Applying patch..modify +Patch applied. +Applying patch..add +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% git-log +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 +Applying patch..modify +Patch applied. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% git-log +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 +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 +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 632ca0f5ec27a961990b45673dfc751f1da830f3 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch mode + +diff --git a/def b/def +old mode 100644 +new mode 100755 + +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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 +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status diff --git a/regression/t-020.sh b/regression/t-020.sh new file mode 100755 index 0000000..3e1df38 --- /dev/null +++ b/regression/t-020.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# +# Test the push code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +# +# incremental push by 1 +# +guilt-series | while read n ; do + begin "guilt-push (unnamed, $n)" + guilt-push + + begin "list_files" + list_files + + begin "git-log" + git-log -p +done + +# +# pop all +# +begin "guilt-pop --all" +guilt-pop --all + +# +# push by name (initially nothing applied) +# +guilt-series | while read n ; do + begin "guilt-push $n (named, $n)" + guilt-push $t + + begin "list_files" + list_files + + begin "git-log" + git-log -p + + begin "guilt-pop --all" + guilt-pop --all +done + +# +# push by name (incrementally) +# +guilt-series | while read n ; do + begin "guilt-push $n (named, incremental, $n)" + guilt-push $t + + begin "list_files" + list_files + + begin "git-log" + git-log -p +done + +# +# pop all +# +begin "guilt-pop --all" +guilt-pop --all + +npatches=`guilt-series | wc -l` +for n in `seq -2 $npatches`; do + begin "guilt-push -n $n" + if [ $n -ge 0 ]; then + guilt-push -n $n + else + shouldfail guilt-push -n $n 2>&1 + fi + + begin "list_files" + list_files + + begin "git-log" + git-log -p + + begin "guilt-pop --all" + guilt-pop --all +done + +begin "list_files" +list_files + +# FIXME: +# --all +# -a +# -n with some patches already applied diff --git a/regression/t-021.out b/regression/t-021.out new file mode 100644 index 0000000..c55a8ce --- /dev/null +++ b/regression/t-021.out @@ -0,0 +1,1161 @@ +% setup_repo +% guilt-push --all +Applying patch..modify +Patch applied. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% git-log +commit 632ca0f5ec27a961990b45673dfc751f1da830f3 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch mode + +diff --git a/def b/def +old mode 100644 +new mode 100755 + +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-pop (unnamed, mode) +Now at remove. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% git-log +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-pop (unnamed, remove) +Now at add. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% git-log +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-pop (unnamed, add) +Now at modify. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-pop (unnamed, modify) +All patches popped. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% git-log +commit d4850419ccc1146c7169f500725ce504b9774ed0 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% guilt-pop mode (named, mode) +Now at remove. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% git-log +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +% guilt-pop remove (named, remove) +Now at add. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% git-log +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +Applying patch..mode +Patch applied. +% guilt-pop add (named, add) +Now at modify. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% guilt-pop modify (named, modify) +All patches popped. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% git-log +commit d4850419ccc1146c7169f500725ce504b9774ed0 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% guilt-pop mode (name, incremental, mode) +Now at remove. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% git-log +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-pop remove (name, incremental, remove) +Now at add. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% git-log +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-pop add (name, incremental, add) +Now at modify. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-pop modify (name, incremental, modify) +All patches popped. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% git-log +commit d4850419ccc1146c7169f500725ce504b9774ed0 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% guilt-pop -n -2 +Invalid number of patches to pop. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 632ca0f5ec27a961990b45673dfc751f1da830f3 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch mode + +diff --git a/def b/def +old mode 100644 +new mode 100755 + +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push --all +% guilt-pop -n -1 +Invalid number of patches to pop. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 632ca0f5ec27a961990b45673dfc751f1da830f3 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch mode + +diff --git a/def b/def +old mode 100644 +new mode 100755 + +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push --all +% guilt-pop -n 0 +No patches requested to be removed. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 632ca0f5ec27a961990b45673dfc751f1da830f3 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch mode + +diff --git a/def b/def +old mode 100644 +new mode 100755 + +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +diff --git a/def b/def +new file mode 100644 +index 0000000..8baef1b +--- /dev/null ++++ b/def +@@ -0,0 +1 @@ ++abc +% guilt-push --all +% guilt-pop -n 1 +Now at remove. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% git-log +commit e67345cf1e7e9594c73efad7381a994f1fe63b14 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch remove + +diff --git a/abd b/abd +deleted file mode 100644 +index 489450e..0000000 +--- a/abd ++++ /dev/null +@@ -1 +0,0 @@ +-qweert + +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +% guilt-pop -n 2 +Now at add. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% git-log +commit 68f33a015dcfd09c3896f15d152378b54eaa4eb6 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + patch add + +diff --git a/abd b/abd +new file mode 100644 +index 0000000..489450e +--- /dev/null ++++ b/abd +@@ -0,0 +1 @@ ++qweert + +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +Applying patch..mode +Patch applied. +% guilt-pop -n 3 +Now at modify. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% git-log +commit 33633e7a1aa31972f125878baf7807be57b1672d +Author: Author Name +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 +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% guilt-pop -n 4 +All patches popped. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% git-log +commit d4850419ccc1146c7169f500725ce504b9774ed0 +Author: Author Name +Date: Mon Jan 1 00:00:00 2007 +0000 + + initial + + Signed-off-by: Commiter Name + +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. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify diff --git a/regression/t-021.sh b/regression/t-021.sh new file mode 100755 index 0000000..6c5dcfa --- /dev/null +++ b/regression/t-021.sh @@ -0,0 +1,99 @@ +#!/bin/bash +# +# Test the pop code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +begin "guilt-push --all" +guilt-push --all + +begin "git-log" +git-log -p + +# +# incremental pop by 1 +# +guilt-series | tac | while read n ; do + begin "guilt-pop (unnamed, $n)" + guilt-pop + + begin "list_files" + list_files + + begin "git-log" + git-log -p +done + +# +# push all +# +begin "guilt-push --all" +guilt-push --all + +# +# pop by name (initially all applied) +# +guilt-series | tac | while read n ; do + begin "guilt-pop $n (named, $n)" + guilt-pop $n + + begin "list_files" + list_files + + begin "git-log" + git-log -p + + begin "guilt-push --all" + guilt-push --all +done + +# +# pop by name (incrementally) +# +guilt-series | tac | while read n ; do + begin "guilt-pop $n (name, incremental, $n)" + guilt-pop $t + + begin "list_files" + list_files + + begin "git-log" + git-log -p +done + +# +# push all +# +begin "guilt-push --all" +guilt-push --all + +npatches=`guilt-series | wc -l` +for n in `seq -2 $npatches`; do + begin "guilt-pop -n $n" + if [ $n -gt 0 ]; then + guilt-pop -n $n + else + shouldfail guilt-pop -n $n 2>&1 + fi + + begin "list_files" + list_files + + begin "git-log" + git-log -p + + begin "guilt-push --all" + guilt-push --all +done + +begin "list_files" +list_files + +# FIXME: +# --all +# -a +# -n with some patches already applied diff --git a/regression/t-022.out b/regression/t-022.out new file mode 100644 index 0000000..b7ef5e5 --- /dev/null +++ b/regression/t-022.out @@ -0,0 +1,78 @@ +% setup_repo +% applied (empty) +% push (modify) +Applying patch..modify +Patch applied. +% applied (modify) +modify +% applied -c (modify) +33633e7a1aa31972f125878baf7807be57b1672d modify +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% push (add) +Applying patch..add +Patch applied. +% applied (add) +modify +add +% applied -c (add) +33633e7a1aa31972f125878baf7807be57b1672d modify +68f33a015dcfd09c3896f15d152378b54eaa4eb6 add +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% push (remove) +Applying patch..remove +Patch applied. +% applied (remove) +modify +add +remove +% applied -c (remove) +33633e7a1aa31972f125878baf7807be57b1672d modify +68f33a015dcfd09c3896f15d152378b54eaa4eb6 add +e67345cf1e7e9594c73efad7381a994f1fe63b14 remove +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% push (mode) +Applying patch..mode +Patch applied. +% applied (mode) +modify +add +remove +mode +% applied -c (mode) +33633e7a1aa31972f125878baf7807be57b1672d modify +68f33a015dcfd09c3896f15d152378b54eaa4eb6 add +e67345cf1e7e9594c73efad7381a994f1fe63b14 remove +632ca0f5ec27a961990b45673dfc751f1da830f3 mode +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify diff --git a/regression/t-022.sh b/regression/t-022.sh new file mode 100755 index 0000000..8b441a2 --- /dev/null +++ b/regression/t-022.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Test the applied code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +begin "applied (empty)" +guilt-applied + +guilt-series | while read n; do + begin "push ($n)" + guilt-push + + begin "applied ($n)" + guilt-applied + + begin "applied -c ($n)" + guilt-applied -c + + begin "list_files" + list_files +done diff --git a/regression/t-023.out b/regression/t-023.out new file mode 100644 index 0000000..b764837 --- /dev/null +++ b/regression/t-023.out @@ -0,0 +1,103 @@ +% setup_repo +% guilt-top (modify) +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% guilt-push +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% guilt-top (add) +modify +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% guilt-push +Applying patch..add +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% guilt-top (remove) +add +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% guilt-push +Applying patch..remove +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% guilt-top (mode) +remove +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% guilt-push +Applying patch..mode +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% guilt-top () +mode +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify diff --git a/regression/t-023.sh b/regression/t-023.sh new file mode 100755 index 0000000..ffb2f9f --- /dev/null +++ b/regression/t-023.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Test the top code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +guilt-series | while read n ; do + begin "guilt-top ($n)" + guilt-top + + begin "list_files" + list_files + + begin "guilt-push" + guilt-push + + begin "list_files" + list_files +done + +begin "guilt-top ($n)" +guilt-top + +begin "list_files" +list_files diff --git a/regression/t-024.out b/regression/t-024.out new file mode 100644 index 0000000..0561847 --- /dev/null +++ b/regression/t-024.out @@ -0,0 +1,64 @@ +% setup_repo +% unapplied (empty) +modify +add +remove +mode +% push (modify) +Applying patch..modify +Patch applied. +% unapplied (modify) +add +remove +mode +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f a19b18afeac33e6a55ef55b93cf0bca721e5610b .git/patches/master/status +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +% push (add) +Applying patch..add +Patch applied. +% unapplied (add) +remove +mode +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f fc42fbc05afb7265d358add98f500f83bf29aea7 .git/patches/master/status +% push (remove) +Applying patch..remove +Patch applied. +% unapplied (remove) +mode +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f f8012069806c3baed27b8f661c19083211fb7ca9 .git/patches/master/status +% push (mode) +Applying patch..mode +Patch applied. +% unapplied (mode) +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify diff --git a/regression/t-024.sh b/regression/t-024.sh new file mode 100755 index 0000000..02e656e --- /dev/null +++ b/regression/t-024.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Test the unapplied code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +begin "unapplied (empty)" +guilt-unapplied + +guilt-series | while read n; do + begin "push ($n)" + guilt-push + + begin "unapplied ($n)" + guilt-unapplied + + begin "list_files" + list_files +done diff --git a/regression/t-025.out b/regression/t-025.out new file mode 100644 index 0000000..f3a324f --- /dev/null +++ b/regression/t-025.out @@ -0,0 +1,318 @@ +% setup_repo +% guilt-new file +All patches popped. +Applying patch..file +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 6e65775e6ed741dc0219e6008f7e0b06add0b395 .git/patches/master/series +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/file +f dfcdf91459f75509d815705c5769d71fcd5f73b0 .git/patches/master/status +% guilt-new dir/file +Now at file. +Applying patch..dir/file +Patch applied. +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +f 0b488d592b2a401d638ca87dacaf60a061f84c3c .git/patches/master/series +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 6269f564bbe7f83c89fa65efc67b601053db1292 .git/patches/master/status +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/dir/file +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/file +% guilt-new dir/subdir/file +Now at dir/file. +Applying patch..dir/subdir/file +Patch applied. +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 00f4d968227f29edd1d6dc985c1650f21a343486 .git/patches/master/series +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 2db31bd49d73b8d16773a4e6c9c5c7ccfb4a3eda .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/dir/file +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/dir/subdir/file +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/file +% guilt-push --all +Applying patch..modify +Patch applied. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% guilt-new append +Now at mode. +Applying patch..append +Patch applied. +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 578dd8fc3317db2c8fdab355ce5828d00218990d .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b9290e9e8b331a605a494f5a66ef9b64bce69c80 .git/patches/master/status +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 +% guilt-pop --all +All patches popped. +% guilt-new prepend +All patches popped. +Applying patch..prepend +Patch applied. +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67 .git/patches/master/series +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b8771a22a975451e15405965d70c2edda932cdba .git/patches/master/status +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 +% guilt-new "white space" +Now at prepend. +Applying patch..white space +Patch applied. +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new prepend +patch 'prepend' already exist +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new mode +patch 'mode' already exist +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new /abc +Patchname is invalid. +it cannot begin with '/', './' or '../', or contain /./ or /../ +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new ./blah +Patchname is invalid. +it cannot begin with '/', './' or '../', or contain /./ or /../ +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new ../blah +Patchname is invalid. +it cannot begin with '/', './' or '../', or contain /./ or /../ +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new abc/./blah +Patchname is invalid. +it cannot begin with '/', './' or '../', or contain /./ or /../ +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new abc/../blah +Patchname is invalid. +it cannot begin with '/', './' or '../', or contain /./ or /../ +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new abc/. +Patchname is invalid. +it cannot begin with '/', './' or '../', or contain /./ or /../ +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new abc/.. +Patchname is invalid. +it cannot begin with '/', './' or '../', or contain /./ or /../ +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space +% gult-new abc/ +Patchname is invalid. +it cannot begin with '/', './' or '../', or contain /./ or /../ +% list_files +d .git/patches +d .git/patches/master +d .git/patches/master/dir +d .git/patches/master/dir/subdir +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5be407ce965bd8f89a7ba3f9b3bdb4d80cf79f4c .git/patches/master/series +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f b29a8935ca88bce635ce3b6f42ea84eacca8af25 .git/patches/master/status +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 +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/white space diff --git a/regression/t-025.sh b/regression/t-025.sh new file mode 100755 index 0000000..52e4220 --- /dev/null +++ b/regression/t-025.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# Test the new code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +function fixup_time_info +{ + touch -d "$GIT_COMMITTER_DATE" ".git/patches/master/$1" +} + +for pname in file dir/file dir/subdir/file ; do + begin "guilt-new $pname" + guilt-new "$pname" + guilt-pop 2>&1 + fixup_time_info "$pname" + guilt-push 2>&1 + + begin "list_files" + list_files +done + +begin "guilt-push --all" +guilt-push --all 2>&1 + +begin "guilt-new append" +guilt-new append +guilt-pop 2>&1 +fixup_time_info append +guilt-push 2>&1 + +begin "list_files" +list_files + +begin "guilt-pop --all" +guilt-pop --all 2>&1 + +begin "guilt-new prepend" +guilt-new prepend +guilt-pop 2>&1 +fixup_time_info prepend +guilt-push 2>&1 + +begin "list_files" +list_files + +begin "guilt-new \"white space\"" +guilt-new "white space" +guilt-pop 2>&1 +fixup_time_info "white space" +guilt-push 2>&1 + +begin "list_files" +list_files + +for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do + begin "gult-new $pname" + shouldfail guilt-new "$pname" 2>&1 + + begin "list_files" + list_files +done diff --git a/regression/t-026.out b/regression/t-026.out new file mode 100644 index 0000000..b40afcf --- /dev/null +++ b/regression/t-026.out @@ -0,0 +1,31 @@ +% setup_repo +% guilt-delete mode +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +f f819c9abb712af6e42af30044bc5388d454ab0cb .git/patches/master/series +% guilt-delete mode (again) +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +f f819c9abb712af6e42af30044bc5388d454ab0cb .git/patches/master/series +% guilt-delete add +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 7848194fd2e9ee0eb6589482900687d799d60a12 .git/patches/master/series +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status diff --git a/regression/t-026.sh b/regression/t-026.sh new file mode 100755 index 0000000..8a6d9c3 --- /dev/null +++ b/regression/t-026.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# Test the delete code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +begin "guilt-delete mode" +guilt-delete mode + +begin "list_files" +list_files + +begin "guilt-delete mode (again)" +guilt-delete mode 2>&1 +# FIXME: this should return a non-zero status, no? + +begin "list_files" +list_files + +begin "guilt-delete add" +guilt-delete add + +begin "list_files" +list_files + +# FIXME: test delete -f diff --git a/regression/t-027.out b/regression/t-027.out new file mode 100644 index 0000000..e158fe0 --- /dev/null +++ b/regression/t-027.out @@ -0,0 +1,31 @@ +% setup_repo +% guilt-refresh (no applied patches) +No patches applied; try guilt-push first +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f da39a3ee5e6b4b0d3255bfef95601890afd80709 .git/patches/master/status +% git-reset --hard HEAD +HEAD is now at d485041... initial +% guilt-push modify +Applying patch..modify +Patch applied. +% guilt-refresh (applied patch) +All patches popped. +Applying patch..modify +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 42d2613ecee1b642b2b8b7b7a9cef165bf456e48 .git/patches/master/modify +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify~ +f de06c667ff8f99131cb05bf1ce42083449db78df .git/patches/master/status diff --git a/regression/t-027.sh b/regression/t-027.sh new file mode 100755 index 0000000..4bdba51 --- /dev/null +++ b/regression/t-027.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Test the refresh code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +function fixup_time_info +{ + touch -d "$GIT_COMMITTER_DATE" ".git/patches/master/$1" +} + +begin "guilt-refresh (no applied patches)" +echo abcdef >> def +shouldfail guilt-refresh 2>&1 + +begin "list_files" +list_files + +begin "git-reset --hard HEAD" +git-reset --hard HEAD + +begin "guilt-push modify" +guilt-push modify 2>&1 + +begin "guilt-refresh (applied patch)" +echo abcdef >> def +guilt-refresh +guilt-pop +fixup_time_info modify +guilt-push modify + +begin "list_files" +list_files + +# FIXME: we should check that the patch actually contains what it should, +# test arguments work the way they should diff --git a/regression/t-050.out b/regression/t-050.out new file mode 100644 index 0000000..758e450 --- /dev/null +++ b/regression/t-050.out @@ -0,0 +1,52 @@ +% setup_repo +% guilt-series +modify +add +remove +mode +% guilt-series -v + modify + add + remove + mode +% guilt-push (modify) +Applying patch..modify +Patch applied. +% guilt-series -v += modify + add + remove + mode +% guilt-push (add) +Applying patch..add +Patch applied. +% guilt-series -v ++ modify += add + remove + mode +% guilt-push (remove) +Applying patch..remove +Patch applied. +% guilt-series -v ++ modify ++ add += remove + mode +% guilt-push (mode) +Applying patch..mode +Patch applied. +% guilt-series -v ++ modify ++ add ++ remove += mode +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 49571a872d2f2f1a8c56e65352c0f9b8aff53143 .git/patches/master/status +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify diff --git a/regression/t-050.sh b/regression/t-050.sh new file mode 100755 index 0000000..43b5d9b --- /dev/null +++ b/regression/t-050.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Test the series code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +begin "guilt-series" +guilt-series + +begin "guilt-series -v" +guilt-series -v + +guilt-series | while read n ; do + begin "guilt-push ($n)" + guilt-push + + begin "guilt-series -v" + guilt-series -v +done + +begin "list_files" +list_files diff --git a/regression/t-060.out b/regression/t-060.out new file mode 100644 index 0000000..541a27a --- /dev/null +++ b/regression/t-060.out @@ -0,0 +1,50 @@ +% setup_repo +% guilt-new +% mkdir blah +% touch blah/sub +% guilt-add blah/sub +% guilt-refresh +% guilt-push -a +Applying patch..modify +Patch applied. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% guilt-files +def +% guilt-files -l +mode def +% guilt-files -v -l +[mode] def +% guilt-files -a +blah/sub +def +abd +abd +def +% guilt-files -l -a +subdir blah/sub +modify def +add abd +remove abd +mode def +% guilt-files -v -a +subdir ++ blah/sub +modify + def +add ++ abd +remove +- abd +mode + def +% guilt-files -v -l -a +[subdir] blah/sub +[modify] def +[add] abd +[remove] abd +[mode] def diff --git a/regression/t-060.sh b/regression/t-060.sh new file mode 100755 index 0000000..51d82fe --- /dev/null +++ b/regression/t-060.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# Test the guilt-files code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +# create a patch that contains a file in a subdirectory +begin "guilt-new" +guilt-new subdir + +begin "mkdir blah" +mkdir blah + +begin "touch blah/sub" +touch blah/sub + +begin "guilt-add blah/sub" +guilt-add blah/sub + +begin "guilt-refresh" +guilt-refresh + +# push em all for tesing +begin "guilt-push -a" +guilt-push -a + +# +# actual tests +# + +begin "guilt-files" +guilt-files + +begin "guilt-files -l" +guilt-files -l + +begin "guilt-files -v -l" +guilt-files -v -l + +begin "guilt-files -a" +guilt-files -a + +begin "guilt-files -l -a" +guilt-files -l -a + +begin "guilt-files -v -a" +guilt-files -v -a + +begin "guilt-files -v -l -a" +guilt-files -v -l -a