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

[PATCH] Fix git-am --skip

From
Jan Harkes <jaharkes@cs.cmu.edu>
Date
Dec 17, 2005, 06:01 UTC
Message-ID
<20051217060106.GS30531@delft.aura.cs.cmu.edu>

git-am --skip does not unpack the next patch and ends up reapplying the old patch, believing that it is the new patch in the sequence.

If the old patch applied successfully it will commit it with the supposedly skipped log message and ends up dropping the following patch. If the patch did not apply the user is left with the conflict he tried to skip and has to unpack the next patch in the sequence by hand to get git-am back on track.

By clearing the resume variable whenever skips bumps the sequence counter we correctly unpack the next patch. I also added another resume= in the case a patch file is missing from the sequence to avoid the same problem when a file in the sequence was removed.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
---
 git-am.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
5cfce3a48e6a6cf08caa5fae990eeeaf08154921
diff --git a/git-am.sh b/git-am.sh
index 1a114bc..731ab1f 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -211,6 +211,7 @@ this=`cat "$dotest/next"`
 if test "$skip" = t
 then
 	this=`expr "$this" + 1`
+	resume=
 fi
 
 if test "$this" -gt "$last"
@@ -225,6 +226,7 @@ do
 	msgnum=`printf "%0${prec}d" $this`
 	next=`expr "$this" + 1`
 	test -f "$dotest/$msgnum" || {
+		resume=
 		go_next
 		continue
 	}
-- 
0.99.9.GIT
Next: Junio C Hamano
Message 1 of 2 in “Fix git-am --skip”
  1. Fix git-am --skipJan Harkes, Dec 17, 2005
  2. Junio C HamanoDec 17, 2005

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.