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

[PATCH] Fix problematic ']'

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Jul 23, 2007, 20:36 UTC
Message-ID
<200707232236.21389.johannes.sixt@telecom.at>

Not all shells grok a closing ']' of the shell '[' command without surrounding space.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
I didn't go the long way to change all `[ ... ]` into `test ...`
 git-rebase--interactive.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 579a45e..e0d1326 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -385,7 +385,7 @@ do
 
 		require_clean_work_tree
 
-		if [ ! -z "$2"]
+		if [ ! -z "$2" ]
 		then
 			git show-ref --verify --quiet "refs/heads/$2" ||
 				die "Invalid branchname: $2"
-- 
1.5.3.rc0
Next: Johannes Schindelin
Message 1 of 5 in “Fix problematic ']'”
  1. Fix problematic ']'Johannes Sixt, Jul 23, 2007
  2. Johannes SchindelinJul 23, 2007
  3. Timo HirvonenJul 23, 2007
  4. Junio C HamanoJul 24, 2007
  5. rebase -i: exchange all "if [ .. ]" by "if test .."Johannes Schindelin, Jul 24, 2007

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.