git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GUILT PATCH 4/4] Use guards information and functions

From
JSJosef Sipek <jsipek@fsl.cs.sunysb.edu>
Date
Jul 30, 2007, 04:15 UTC
Message-ID
<20070730041549.GF22017@filer.fsl.cs.sunysb.edu>
In-Reply-To
<1185695418227-git-send-email-eclesh@ucla.edu>
On Sun, Jul 29, 2007 at 12:50:18AM -0700, Eric Lesh wrote:
Show 46 quoted lines
> 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>
> ---
>  guilt-header    |    7 ++++---
>  guilt-next      |    2 +-
>  guilt-push      |    8 ++++----
>  guilt-unapplied |    2 +-
>  4 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --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}"

Seeing this almost makes me thing that get_series should give you the guarded series unless you poke it the right way...something like:

get_series --full
or
get_full_series
The guarded series is what most commands care about, right?
Show 46 quoted lines
> 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
-- 
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
		- Brian W. Kernighan 
Previous: Eric LeshNext: Eric Lesh
Message 16 of 20 in “Add guards to guilt”
  1. 0/4 Add guards to guiltEric Lesh, Jul 29, 2007
  2. 1/4 get_series: Remove comments from end of series linesEric Lesh, Jul 29, 2007
  3. Josef SipekJul 30, 2007
  4. Eric LeshJul 30, 2007
  5. Josef SipekJul 30, 2007
  6. Eric LeshJul 30, 2007
  7. 2/4 guilt-guard: Assign guards to patches in seriesEric Lesh, Jul 29, 2007
  8. Josef SipekJul 30, 2007
  9. Eric LeshJul 30, 2007
  10. Josef SipekJul 30, 2007
  11. 3/4 guilt-select: Select guards to apply when pushing patchesEric Lesh, Jul 29, 2007
  12. Josef SipekJul 30, 2007
  13. Eric LeshJul 30, 2007
  14. Josef SipekJul 30, 2007
  15. 4/4 Use guards information and functionsEric Lesh, Jul 29, 2007
  16. Josef SipekJul 30, 2007
  17. Eric LeshJul 30, 2007
  18. Josef SipekJul 30, 2007
  19. Eric LeshJul 30, 2007
  20. Josef SipekJul 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.