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

[PATCH next] t7407: use 'cut' utility rather than bash's substring expansion notation

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Aug 20, 2009, 01:24 UTC
Message-ID
<QHfHFS_5JGiL-O8GMDfdfscFUdxV1xVObzr6e5LPleagDRd7bCg8I9YUwL9xkbgM64vyf_EVLLg@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>

The substring expansion notation is a bashism that we have not so far adopted. There is precedence for using the 'cut' utility for extracting a substring. So do so here.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t7407-submodule-foreach.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index de1730d..44ea8ac 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -207,8 +207,8 @@ cat > expect <<EOF
  $nested2sha1 nested1/nested2 (heads/master)
  $nested3sha1 nested1/nested2/nested3 (heads/master)
  $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
- $sub1sha1 sub1 (${sub1sha1:0:7})
- $sub2sha1 sub2 (${sub1sha1:0:7})
+ $sub1sha1 sub1 ($(echo $sub1sha1 | cut -c 1-7))
+ $sub2sha1 sub2 ($(echo $sub1sha1 | cut -c 1-7))
  $sub3sha1 sub3 (heads/master)
 EOF
 
-- 
1.6.4
Next: Johan Herland
Message 1 of 5 in “t7407: use 'cut' utility rather than bash's substring expansion notation”
  1. t7407: use 'cut' utility rather than bash's substring expansion notationBrandon Casey, Aug 20, 2009
  2. Johan HerlandAug 20, 2009
  3. Junio C HamanoAug 20, 2009
  4. Johan HerlandAug 20, 2009
  5. Brandon CaseyAug 20, 2009

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.