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

[PATCH 1/5] cogito: remove use of xargs -r, a non-portable GNU extension

From
Bryan Larsen <bryanlarsen@yahoo.com>
Date
Jul 16, 2005, 23:23 UTC
Message-ID
<20050716232319.7317.23031.sendpatchset@bryan-larsens-ibook-g4.local>
In-Reply-To
<20050716232308.7317.56890.sendpatchset@bryan-larsens-ibook-g4.local>
Remove usage of xargs -r, a non-portable gnu extension.  
Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---
 cg-add  |    6 +++---
 cg-init |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cg-add b/cg-add
--- a/cg-add
+++ b/cg-add
@@ -25,8 +25,6 @@ USAGE="cg-add [-N] FILE..."
 
 . ${COGITO_LIB}cg-Xlib
 
-[ "$1" ] || usage
-
 infoonly=
 while optparse; do
 	if optparse -N; then
@@ -36,6 +34,8 @@ while optparse; do
 	fi
 done
 
+[ "$ARGS" ] || usage
+
 TMPFILE=$(mktemp -t gitadd.XXXXXX) || exit 1
 find "${ARGS[@]}" -type f -print0 > $TMPFILE || {
 	die "not all files exist, nothing added"
@@ -43,6 +43,6 @@ find "${ARGS[@]}" -type f -print0 > $TMP
 }
 
 cat $TMPFILE | tr '\0' '\n' | sed 's/^/Adding file /'
-cat $TMPFILE | xargs -0r git-update-cache --add ${infoonly} --
+cat $TMPFILE | xargs -0 git-update-cache --add ${infoonly} --
 
 rm $TMPFILE
diff --git a/cg-init b/cg-init
--- a/cg-init
+++ b/cg-init
@@ -55,7 +55,7 @@ if [ "$uri" ]; then
 	echo "Cloned (origin $uri available as branch \"origin\")"
 else
 	git-read-tree # Seed the dircache
-	find * \( -type f -o -type l \) -print0 | xargs -0r cg-add ${infoonly}
+	[ `ls` ] && find * \( -type f -o -type l \) -print0 | xargs -0 cg-add ${infoonly}
 	cg-commit -C -m"Initial commit" -E ${infoonly}
 fi
 
Previous: Bryan LarsenNext: Bryan Larsen
Message 2 of 6 in “cogito: compatibility with OS X”
  1. 0/5 cogito: compatibility with OS XBryan Larsen, Jul 16, 2005
  2. 1/5 cogito: remove use of xargs -r, a non-portable GNU extensionBryan Larsen, Jul 16, 2005
  3. 2/5 cogito: remove use of cp -a, a non-portable GNU extensionBryan Larsen, Jul 16, 2005
  4. 3/5 cogito: try harder to find gnu statBryan Larsen, Jul 16, 2005
  5. 4/5 cogito: try harder to find gnu dateBryan Larsen, Jul 16, 2005
  6. 5/5 cogito: remove findutils dependency from PortfileBryan Larsen, Jul 16, 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.