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

Re: [PATCH Cogito] Make use of external editor work like CVS

From
MHMarcel Holtmann <marcel@holtmann.org>
Date
May 8, 2005, 21:43 UTC
Message-ID
<1115588600.8949.77.camel@pegasus>
In-Reply-To
<20050508200334.GG9495@pasky.ji.cz>
Hi Petr,
Show 19 quoted lines
> #/bin/sh
> 
> leading=1
> emptylines=0
> while read line; do
>         if ! [ "$line" ]; then
> 		[ "$leading" ] && continue
> 		emptylines=$(($emptylines + 1))
>         else
> 		leading=0
>                 while [ $emptylines -gt 0 ]; do
>                         echo ""
>                         emptylines=$(($emptylines - 1))
>                 done
>                 echo $line
>         fi
> done
> 
> or something? (Based on someone else's script since I was too lazy. ;-)
@@ -134,7 +134,7 @@
 else
        cat >>$LOGMSG2
 fi
-grep -v ^CG: $LOGMSG2 >$LOGMSG
+grep -v ^CG: $LOGMSG2 | sed '/./,${/./b;:a;$d;N;/\n$/ba;b;};d' >$LOGMSG
 rm $LOGMSG2
 
 
If you don't wanna squeeze then you can do it with a one-line in sed.

Regards

Marcel
Previous: Sean
Message 20 of 20 in “Make use of external editor work like CVS”
  1. Make use of external editor work like CVSMarcel Holtmann, May 8, 2005
  2. SeanMay 8, 2005
  3. Petr BaudisMay 8, 2005
  4. Marcel HoltmannMay 8, 2005
  5. Petr BaudisMay 8, 2005
  6. Marcel HoltmannMay 8, 2005
  7. Petr BaudisMay 8, 2005
  8. Marcel HoltmannMay 8, 2005
  9. Petr BaudisMay 8, 2005
  10. Marcel HoltmannMay 8, 2005
  11. Petr BaudisMay 8, 2005
  12. Marcel HoltmannMay 8, 2005
  13. Petr BaudisMay 8, 2005
  14. Marcel HoltmannMay 8, 2005
  15. Petr BaudisMay 8, 2005
  16. Marcel HoltmannMay 8, 2005
  17. Edgar ToernigMay 9, 2005
  18. Petr BaudisMay 9, 2005
  19. SeanMay 8, 2005
  20. Marcel HoltmannMay 8, 2005

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.