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

[PATCH v2 1/3] git am: Set cmdline globally

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 2, 2010, 08:33 UTC
Message-ID
<1275467617-23065-2-git-send-email-artagnon@gmail.com>
In-Reply-To
<1275467617-23065-1-git-send-email-artagnon@gmail.com>

Set the $cmdline variable globally, and not in stop_here_user_resolve so it can be used in other code fragments as well.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 git-am.sh |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 87ffae2..b75358b 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -52,6 +52,16 @@ else
 	HAS_HEAD=
 fi
 
+cmdline="git am"
+if test '' != "$interactive"
+then
+	cmdline="$cmdline -i"
+fi
+if test '' != "$threeway"
+then
+	cmdline="$cmdline -3"
+fi
+
 sq () {
 	git rev-parse --sq-quote "$@"
 }
@@ -66,15 +76,6 @@ stop_here_user_resolve () {
 	    printf '%s\n' "$resolvemsg"
 	    stop_here $1
     fi
-    cmdline="git am"
-    if test '' != "$interactive"
-    then
-        cmdline="$cmdline -i"
-    fi
-    if test '' != "$threeway"
-    then
-        cmdline="$cmdline -3"
-    fi
     echo "When you have resolved this problem run \"$cmdline --resolved\"."
     echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"."
     echo "To restore the original branch and stop patching run \"$cmdline --abort\"."
-- 
1.7.1
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 2 of 4 in “git am: Improve error messages”
  1. 0/3 git am: Improve error messagesRamkumar Ramachandra, Jun 2, 2010
  2. 1/3 git am: Set cmdline globallyRamkumar Ramachandra, Jun 2, 2010
  3. 2/3 git am: Display some help text when patch is emptyRamkumar Ramachandra, Jun 2, 2010
  4. 3/3 git am: Remove stray error message from sedRamkumar Ramachandra, Jun 2, 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.