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

[PATCH 1/3] rebase -i: Avoid non-portable "test X -a Y"

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Jan 22, 2010, 09:22 UTC
Message-ID
<0c2c17066d3bc369e4fb8f96839f63b50606fd5f.1264151435.git.mhagger@alum.mit.edu>
In-Reply-To
<cover.1264151435.git.mhagger@alum.mit.edu>
Reported by: Eric Blake <ebb9@byu.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 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 e551906..c2f6089 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -235,7 +235,7 @@ pick_one () {
 	parent_sha1=$(git rev-parse --verify $sha1^) ||
 		die "Could not get the parent of $sha1"
 	current_sha1=$(git rev-parse --verify HEAD)
-	if test -z "$no_ff" -a "$current_sha1" = "$parent_sha1"
+	if test -z "$no_ff" && test "$current_sha1" = "$parent_sha1"
 	then
 		output git reset --hard $sha1
 		output warn Fast-forward to $(git rev-parse --short $sha1)
-- 
1.6.6
Previous: Michael HaggertyNext: Michael Haggerty
Message 2 of 7 in “Fixes to mh/rebase-fixup”
  1. 0/3 Fixes to mh/rebase-fixupMichael Haggerty, Jan 22, 2010
  2. 1/3 rebase -i: Avoid non-portable "test X -a Y"Michael Haggerty, Jan 22, 2010
  3. 2/3 rebase -i: Enclose sed command substitution in quotesMichael Haggerty, Jan 22, 2010
  4. 3/3 rebase -i: Export GIT_AUTHOR_* variables explicitlyMichael Haggerty, Jan 22, 2010
  5. Johannes SchindelinJan 22, 2010
  6. Junio C HamanoJan 22, 2010
  7. Michael HaggertyJan 24, 2010

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.