Skip to contentSkip to conversation

add series editor support.

PATCH In review Dmitry Monakhov 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add series editor support.

Usually we have to edit series file directly (via editor). I think it is not bad idea to let guilt export this service. IMHO "guilt-series -e" it the best way to do it.

---
 guilt-series |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
guilt-series +7 -2
index 62c3bb1..7594b2e 100755
@@ -3,7 +3,7 @@
 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
 #
 
-USAGE="[-v | -g]"
+USAGE="[-v | -g | -e]"
 . `dirname $0`/guilt
 
 while case "$#" in 0) break ;; esac
@@ -13,13 +13,18 @@ do
 		verbose=t ;;
 	-g)
 		gui=t ;;
+	-e)
+		edit=t ;;
 	*)
 		usage ;;
 	esac
 	shift
 done
 
-if [ ! -z "$gui" ]; then
+# edit -e ?
+if [ "$edit" = "t" ]; then 
+	$editor "$GUILT_DIR/$branch/series"
+elif [ ! -z "$gui" ]; then
 	[ -z "`get_top`" ] && die "No patches applied."
 	bottom=`head -1 $applied | cut -d: -f1`
 	top=`tail -1 $applied | cut -d: -f1`
Signature · 1 line
1.5.2.2
#1 lore raw
Quoted 5 lines · Dmitry Monakhov

Usually we have to edit series file directly (via editor). I think it is not bad idea to let guilt export this service. IMHO "guilt-series -e" it the best way to do it.

Applied with a small cleanup to make things a little bit more consistent (
[ ! -z "$edit" ] vs. [ "$edit" = "t" ] ).

Thanks,

Josef 'Jeff' Sipek.

Signature · 2 lines
Failure is not an option,
It comes bundled with your Microsoft product.
#2 lore raw
In reply to Dmitry Monakhov
Quoted 32 lines · Dmitry Monakhov

Usually we have to edit series file directly (via editor). I think it is not bad idea to let guilt export this service. IMHO "guilt-series -e" it the best way to do it.

---
 guilt-series |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
guilt-series +3 -1
index 62c3bb1..7594b2e 100755
@@ -3,7 +3,7 @@
 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
 #
 
-USAGE="[-v | -g]"
+USAGE="[-v | -g | -e]"
 . `dirname $0`/guilt
 
 while case "$#" in 0) break ;; esac
@@ -13,13 +13,18 @@ do
 		verbose=t ;;
 	-g)
 		gui=t ;;
+	-e)
+		edit=t ;;
 	*)
 		usage ;;
 	esac
 	shift

guilt-series do · line 30

Quoted 10 lines
guilt-series +4 -1
 done
 
-if [ ! -z "$gui" ]; then
+# edit -e ?
+if [ "$edit" = "t" ]; then
+	$editor "$GUILT_DIR/$branch/series"
+elif [ ! -z "$gui" ]; then
 	[ -z "`get_top`" ] && die "No patches applied."
 	bottom=`head -1 $applied | cut -d: -f1`
 	top=`tail -1 $applied | cut -d: -f1`

Hi,
Why do you use string comparisons instead of initializing all the variables to false and setting them to :' or true' so that you can then write if $edit; then ... ? It's suboptimal.

Cheers,

Signature · 2 lines
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory