From: Eric Lesh <eclesh@ucla.edu>
To: jsipek@cs.sunysb.edu
Cc: git@vger.kernel.org, Eric Lesh <eclesh@ucla.edu>
Subject: [GUILT PATCH 4/4] Use guards information and functions
Date: Sun, 29 Jul 2007 00:50:18 -0700 [thread overview]
Message-ID: <1185695418227-git-send-email-eclesh@ucla.edu> (raw)
In-Reply-To: <118569541814-git-send-email-eclesh@ucla.edu>
Make guilt-push respect guards. Also teach guilt-header, guilt-next,
and guilt-unapplied to grok patches that are skipped because of
guards.
Signed-off-by: Eric Lesh <eclesh@ucla.edu>
---
| 7 ++++---
guilt-next | 2 +-
guilt-push | 8 ++++----
guilt-unapplied | 2 +-
4 files changed, 10 insertions(+), 9 deletions(-)
--git a/guilt-header b/guilt-header
index d07e2be..ef7f55e 100755
--- a/guilt-header
+++ b/guilt-header
@@ -15,15 +15,16 @@ patch="$1"
if [ -z "$patch" ]; then
# use the patch that's on the top of the stack
- eidx=`wc -l < $applied`
- if [ $eidx -eq 0 ]; then
+ patch=`get_top`
+ if [ -z "$patch" ]; then
die "Status file is empty"
fi
+ eidx=`get_series | grep -ne "^$patch\$" | cut -d: -f1`
else
# use the specified patch
eidx=`get_series | grep -ne "^$patch\$" | cut -d: -f1`
- if [ $eidx -eq 0 ]; then
+ if [ -z "$eidx" ]; then
die "Patch $patch is not in the series"
fi
fi
diff --git a/guilt-next b/guilt-next
index f38f1cc..38f57fa 100755
--- a/guilt-next
+++ b/guilt-next
@@ -13,5 +13,5 @@ fi
n=`wc -l < $applied`
n=$(($n + 1))
-get_series | awk "{ if (NR == $n) print \$0}"
+get_guarded_series | awk "{ if (NR == $n) print \$0}"
diff --git a/guilt-push b/guilt-push
index ad3616b..ce928e3 100755
--- a/guilt-push
+++ b/guilt-push
@@ -24,7 +24,7 @@ if [ "$patch" = "--all" ] || [ "$patch" = "-a" ]; then
# we are supposed to push all patches, get the last one out of
# series
- eidx=`get_series | wc -l`
+ eidx=`get_guarded_series | wc -l`
if [ $eidx -eq 0 ]; then
die "There are no patches to push"
fi
@@ -37,9 +37,9 @@ else
# we're supposed to push only up to a patch, make sure the patch is
# in the series
- eidx=`get_series | grep -ne "^$patch\$" | cut -d: -f1`
+ eidx=`get_guarded_series | grep -ne "^$patch\$" | cut -d: -f1`
if [ -z "$eidx" ]; then
- die "Patch $patch is not in the series"
+ die "Patch $patch is not in the series or is guarded"
fi
fi
@@ -52,7 +52,7 @@ fi
sidx=`wc -l < $applied`
sidx=`expr $sidx + 1`
-get_series | sed -n -e "${sidx},${eidx}p" | while read p
+get_guarded_series | sed -n -e "${sidx},${eidx}p" | while read p
do
echo "Applying patch..$p"
if [ ! -f "$GUILT_DIR/$branch/$p" ]; then
diff --git a/guilt-unapplied b/guilt-unapplied
index 192a7e5..6904360 100755
--- a/guilt-unapplied
+++ b/guilt-unapplied
@@ -13,4 +13,4 @@ fi
n=`wc -l < $applied`
n=`expr $n + 1`
-get_series | sed -n -e "$n,\$p"
+get_guarded_series | sed -n -e "$n,\$p"
--
1.5.2
next prev parent reply other threads:[~2007-07-29 7:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-29 7:50 [GUILT PATCH 0/4] Add guards to guilt Eric Lesh
2007-07-29 7:50 ` [GUILT PATCH 1/4] get_series: Remove comments from end of series lines Eric Lesh
2007-07-30 3:54 ` Josef Sipek
2007-07-30 5:15 ` Eric Lesh
2007-07-30 5:26 ` Josef Sipek
2007-07-30 7:07 ` Eric Lesh
2007-07-29 7:50 ` [GUILT PATCH 2/4] guilt-guard: Assign guards to patches in series Eric Lesh
2007-07-30 4:06 ` Josef Sipek
2007-07-30 6:41 ` Eric Lesh
2007-07-30 19:28 ` Josef Sipek
2007-07-29 7:50 ` [GUILT PATCH 3/4] guilt-select: Select guards to apply when pushing patches Eric Lesh
2007-07-30 4:12 ` Josef Sipek
2007-07-30 7:02 ` Eric Lesh
2007-07-30 19:34 ` Josef Sipek
2007-07-29 7:50 ` Eric Lesh [this message]
2007-07-30 4:15 ` [GUILT PATCH 4/4] Use guards information and functions Josef Sipek
2007-07-30 7:06 ` Eric Lesh
2007-07-30 3:54 ` [GUILT PATCH 0/4] Add guards to guilt Josef Sipek
2007-07-30 8:32 ` Eric Lesh
2007-07-30 19:20 ` Josef Sipek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1185695418227-git-send-email-eclesh@ucla.edu \
--to=eclesh@ucla.edu \
--cc=git@vger.kernel.org \
--cc=jsipek@cs.sunysb.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).