{"thread":{"id":"23977","subject":"[PATCH v2 0/3] git am: Improve error messages","startedAt":"2010-06-02T08:33:34Z","lastAt":"2010-06-02T08:33:37Z","messageCount":4,"participants":["Ramkumar Ramachandra"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"142793","messageId":"1275467617-23065-1-git-send-email-artagnon@gmail.com","threadId":"23977","inReplyTo":null,"subject":"[PATCH v2 0/3] git am: Improve error messages","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2010-06-02T08:33:34Z","receivedAt":"2010-06-02T08:33:34Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"What changed since v1:\n0. Use TAB to indent\n1. Revert to hardcoding \"git am\" instead of \"$0\" (Johannes Sixt)\n2. Use \"test -f\", not \"test -e\" (Junio)\n3. Set $FIRSTLINE to an empty string if the test fails (Junio)\n\nRamkumar Ramachandra (3):\n  git am: Set cmdline globally\n  git am: Display some help text when patch is empty\n  git am: Remove stray error message from sed\n\n git-am.sh |   29 +++++++++++++++++++----------\n 1 files changed, 19 insertions(+), 10 deletions(-)\n"},{"id":"142795","messageId":"1275467617-23065-2-git-send-email-artagnon@gmail.com","threadId":"23977","inReplyTo":"1275467617-23065-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 1/3] git am: Set cmdline globally","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2010-06-02T08:33:35Z","receivedAt":"2010-06-02T08:33:35Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Set the $cmdline variable globally, and not in stop_here_user_resolve\nso it can be used in other code fragments as well.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-am.sh |   19 ++++++++++---------\n 1 files changed, 10 insertions(+), 9 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 87ffae2..b75358b 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -52,6 +52,16 @@ else\n \tHAS_HEAD=\n fi\n \n+cmdline=\"git am\"\n+if test '' != \"$interactive\"\n+then\n+\tcmdline=\"$cmdline -i\"\n+fi\n+if test '' != \"$threeway\"\n+then\n+\tcmdline=\"$cmdline -3\"\n+fi\n+\n sq () {\n \tgit rev-parse --sq-quote \"$@\"\n }\n@@ -66,15 +76,6 @@ stop_here_user_resolve () {\n \t    printf '%s\\n' \"$resolvemsg\"\n \t    stop_here $1\n     fi\n-    cmdline=\"git am\"\n-    if test '' != \"$interactive\"\n-    then\n-        cmdline=\"$cmdline -i\"\n-    fi\n-    if test '' != \"$threeway\"\n-    then\n-        cmdline=\"$cmdline -3\"\n-    fi\n     echo \"When you have resolved this problem run \\\"$cmdline --resolved\\\".\"\n     echo \"If you would prefer to skip this patch, instead run \\\"$cmdline --skip\\\".\"\n     echo \"To restore the original branch and stop patching run \\\"$cmdline --abort\\\".\"\n-- \n1.7.1\n"},{"id":"142794","messageId":"1275467617-23065-3-git-send-email-artagnon@gmail.com","threadId":"23977","inReplyTo":"1275467617-23065-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 2/3] git am: Display some help text when patch is empty","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2010-06-02T08:33:36Z","receivedAt":"2010-06-02T08:33:36Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"When a patch is found to be empty, prompt the user to use either\n--skip or --abort.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-am.sh |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex b75358b..a52c2b4 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -592,6 +592,8 @@ do\n \n \t\ttest -s \"$dotest/patch\" || {\n \t\t\techo \"Patch is empty.  Was it split wrong?\"\n+\t\t\techo \"If you would prefer to skip this patch, instead run \\\"$cmdline --skip\\\".\"\n+\t\t\techo \"To restore the original branch and stop patching run \\\"$cmdline --abort\\\".\"\n \t\t\tstop_here $this\n \t\t}\n \t\trm -f \"$dotest/original-commit\"\n-- \n1.7.1\n"},{"id":"142796","messageId":"1275467617-23065-4-git-send-email-artagnon@gmail.com","threadId":"23977","inReplyTo":"1275467617-23065-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 3/3] git am: Remove stray error message from sed","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2010-06-02T08:33:37Z","receivedAt":"2010-06-02T08:33:37Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"When --continue is invoked without any changes, the following stray\nerror message appears- sed: can't read $dotest/final-commit: No such\nfile or directory. Remove this by making sure that the file actually\nexists.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-am.sh |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex a52c2b4..062b5a7 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -693,8 +693,13 @@ do\n \telse\n \t    action=yes\n \tfi\n-\tFIRSTLINE=$(sed 1q \"$dotest/final-commit\")\n+\n+\tif test -f \"$dotest/final-commit\"\n+\tthen\n+\t\tFIRSTLINE=$(sed 1q \"$dotest/final-commit\")\n+\telse\n+\t\tFIRSTLINE=\"\"\n+\tfi\n \n \tif test $action = skip\n \tthen\n-- \n1.7.1\n"}]}