From 95db8f54bb89657ce7bcd7007b066b95b9e485b8 Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Sun, 20 Jan 2008 16:50:48 -0500 Subject: [PATCH] regression: test 021: test pop code Signed-off-by: Josef 'Jeff' Sipek --- regression/t-021.out | 1161 ++++++++++++++++++++++++++++++++++++++++++++++++++ regression/t-021.sh | 99 +++++ 2 files changed, 1260 insertions(+) create mode 100644 regression/t-021.out create mode 100755 regression/t-021.sh 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 -- 2.11.4.GIT