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

[PATCH 1/3] fixup! git rebase -i: add static check for commands and SHA-1

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Jun 30, 2015, 09:19 UTC
Message-ID
<1435655961-31263-2-git-send-email-Matthieu.Moy@imag.fr>
In-Reply-To
<1435655961-31263-1-git-send-email-Matthieu.Moy@imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 git-rebase--interactive.sh | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index ec4a068..9041d15 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -871,8 +871,7 @@ check_bad_cmd_and_sha () {
 		while read -r line
 		do
 			IFS=' '
-			set x $line
-			shift
+			set -- $line
 			command=$1
 			sha1=$2
 
@@ -881,8 +880,7 @@ check_bad_cmd_and_sha () {
 				# Doesn't expect a SHA-1
 				;;
 			pick|p|drop|d|reword|r|edit|e|squash|s|fixup|f)
-				check_commit_sha $sha1 "$line"
-				if test $? -ne 0
+				if ! check_commit_sha $sha1 "$line"
 				then
 					retval=1
 				fi
@@ -988,8 +986,7 @@ check_todo_list () {
 		;;
 	esac
 
-	check_bad_cmd_and_sha <"$todo"
-	if test $? -ne 0
+	if ! check_bad_cmd_and_sha <"$todo"
 	then
 		raise_error=t
 	fi
-- 
2.5.0.rc0.10.g7792c2a
Previous: Matthieu MoyNext: Matthieu Moy
Message 6 of 14 in “rebase -i: drop, missing commits and static checks”
  1. Galan RémiJun 29, 2015
  2. 1/3 git-rebase -i: add command "drop" to remove a commitGalan Rémi, Jun 29, 2015
  3. 2/3 git rebase -i: warn about removed commitsGalan Rémi, Jun 29, 2015
  4. 3/3 git rebase -i: add static check for commands and SHA-1Galan Rémi, Jun 29, 2015
  5. 0/3 rebase -i: drop, missing commits and static checksMatthieu Moy, Jun 30, 2015
  6. 1/3 fixup! git rebase -i: add static check for commands and SHA-1Matthieu Moy, Jun 30, 2015
  7. 2/3 fixup! git rebase -i: warn about removed commitsMatthieu Moy, Jun 30, 2015
  8. 3/3 fixup! git rebase -i: warn about removed commitsMatthieu Moy, Jun 30, 2015
  9. Remi Galan AlfonsoJun 30, 2015
  10. Matthieu MoyJun 30, 2015
  11. Junio C HamanoJun 30, 2015
  12. Remi Galan AlfonsoJun 30, 2015
  13. Matthieu MoyJun 30, 2015
  14. Junio C HamanoJun 30, 2015

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.