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

[COGITO PATCH] Fix cg-log and cg-status for non-GNU sed/sort

From
MAMark Allen <mrallen1@yahoo.com>
Date
May 29, 2005, 23:00 UTC
Message-ID
<20050529230011.30885.qmail@web41201.mail.yahoo.com>

Here're a couple of pretty simple patches against cg-log and cg-status (two cogito commands I use a lot) for the non-GNU (or at least older, forked GNU) tools on Darwin.

There's also a non-GNU sed problem in cg-commit, but I haven't quite figured a good way to tackle this issue yet. (The problem is in the regex stripping leading and trailing newlines from $LOGMSG at line 170. Darwin's sed does not like the embedded curly braces, but there's not a good simple way to rewrite this and retain the meaning of the "sedlet" that tracks whether its seen any text yet.)

Cheers,
--Mark

--- commit e43fc64b1f779b1ecf1bcc36e4f89a9f43ab2fb6 tree 95770616edbd49c71dff9ca6e51e7abf449d35e7 parent d36ed1fd011d349ea2adc00456750b5b3da3a9cd author Mark Allen <mrallen1@yahoo.com> 1117406652 -0500 committer Mark Allen <mallen@aeris.local> 1117406652 -0500

 cg-log    |   13 +++++--------
 cg-status |    2 +-
 2 files changed, 6 insertions(+), 9 deletions(-)
Index: cg-log
===================================================================
--- 3a65f5fb53367c75f4f76aebed27a83d8679f068/cg-log  (mode:100755)
+++ 95770616edbd49c71dff9ca6e51e7abf449d35e7/cg-log  (mode:100755)
@@ -148,10 +148,10 @@
 				fi
 
 				date=(${rest#*> })
-				pdate="$(showdate $date)"
+				pdate="$(date -u -r $date)"
 				if [ "$pdate" ]; then
-					echo -n $color$key $rest | sed "s/>.*/> $pdate/"
-					echo $coldefault
+					echo -n $color$key $rest | sed "s/>.*/> $pdate/" 
+					echo -n $coldefault
 				else
 					echo $color$key $rest $coldefault
 				fi
@@ -168,11 +168,8 @@
 				if [ -n "$list_files" ]; then
 					list_commit_files "$tree1" "$tree2"
 				fi
-				echo; sed -re '
-					/ *Signed-off-by:.*/Is//'$colsignoff'&'$coldefault'/
-					/ *Acked-by:.*/Is//'$colsignoff'&'$coldefault'/
-					s/./    &/
-				'
+				echo; sed -e "/ *Signed-off-by:.*/s/ *Signed-off-by:.*/$colsignoff&$coldefault/" -e"/ *Acked-by:.*/s/ *Acked-by:.*/$colsignoff&$coldefault/" -e "s/./    &/"
+				
 				;;
 			*)
 				echo $colheader$key $rest $coldefault
Index: cg-status
===================================================================
--- 3a65f5fb53367c75f4f76aebed27a83d8679f068/cg-status  (mode:100755)
+++ 95770616edbd49c71dff9ca6e51e7abf449d35e7/cg-status  (mode:100755)
@@ -15,7 +15,7 @@
 
 {
 	git-ls-files -z -t --others --deleted --unmerged $EXCLUDE
-} | sort -z -k 2 | xargs -0 sh -c '
+} | sort -t '\0' -k 2 | xargs -0 sh -c '
 while [ "$1" ]; do
 	tag=${1% *};
 	filename=${1#* };
Next: Petr Baudis
Message 1 of 6 in “Fix cg-log and cg-status for non-GNU sed/sort”
  1. Fix cg-log and cg-status for non-GNU sed/sortMark Allen, May 29, 2005
  2. Petr BaudisMay 29, 2005
  3. Mark AllenMay 29, 2005
  4. Petr BaudisMay 29, 2005
  5. Alecs KingMay 30, 2005
  6. Mark AllenMay 31, 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.