git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [COGITO PATCH] Fix cg-log and cg-status for non-GNU sed/sort
@ 2005-05-29 23:00 Mark Allen
  2005-05-29 23:16 ` Petr Baudis
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Allen @ 2005-05-29 23:00 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 583 bytes --]

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

[-- Attachment #2: 14121161-cogito-non-gnu.patch --]
[-- Type: application/octet-stream, Size: 1880 bytes --]


---
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#* };

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-05-31  1:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-29 23:00 [COGITO PATCH] Fix cg-log and cg-status for non-GNU sed/sort Mark Allen
2005-05-29 23:16 ` Petr Baudis
2005-05-29 23:43   ` Mark Allen
2005-05-29 23:49     ` Petr Baudis
2005-05-30 17:00       ` Alecs King
2005-05-31  1:19       ` Mark Allen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).