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

Re: [GUILT PATCH 1/4] get_series: Remove comments from end of series lines

From
JSJosef Sipek <jsipek@fsl.cs.sunysb.edu>
Date
Jul 30, 2007, 05:26 UTC
Message-ID
<20070730052633.GI22017@filer.fsl.cs.sunysb.edu>
In-Reply-To
<87r6mqcvzp.fsf@hubert.paunchy.net>
On Sun, Jul 29, 2007 at 10:15:54PM -0700, Eric Lesh wrote:
> 
> [ Do you mind if these messages go to both your email addresses, or
> should I remove one or the other? ]
 
I really don't care if I get duplicates. It'll happen anyway when the git
mailing list is cc'd. As for which address I prefer, it really doesn't
matter to me which one stays in Cc. I'm slowly trying to move everything
over to @cs.
Show 35 quoted lines
> Josef Sipek <jsipek@fsl.cs.sunysb.edu> writes:
> 
> > On Sun, Jul 29, 2007 at 12:50:15AM -0700, Eric Lesh wrote:
> > ... 
> >> diff --git a/guilt b/guilt
> >> index f67bfb5..774909e 100755
> >> --- a/guilt
> >> +++ b/guilt
> >> @@ -178,7 +178,8 @@ get_series()
> >>  	#	- whitespace only
> >>  	#	- optional whitespace followed by '#' followed by more
> >>  	#	  optional whitespace
> >> -	grep -ve '^[[:space:]]*\(#.*\)*$' "$series"
> >> +	# also remove comments from end of lines
> >> +	grep -ve '^[[:space:]]*\(#.*\)*$' < "$series" | sed -e 's/[[:space:]]*#.*$//'
> >
> > I'd be tempted to replace the whole thing with one sed script...something
> > like (not tested):
> >
> > "
> > /^[[:space:]]*#/ ! {
> > 	s/[[:space:]]*#.*$//
> >
> > 	p
> > }
> > "
> >
> 
> sed -e "/^[[:space:]]*\(#.*\)*$/d
> 	/^[[:space:]]*\(#.*\)*$/!{
> 	s/[[:space:]]*#.*$//
> 	}
> 	" $series
> 
> is the best I can do.
I think the script I wrote is a bit cleaner as it more easily translates to:
if (!ignore_line) {
	strip comment
	print
}

to make it work, you'd need to run sed with -n to not implicitly print the line.

Jeff.
-- 
I'm somewhere between geek and normal.
		- Linus Torvalds
Previous: Eric LeshNext: Eric Lesh
Message 5 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.