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

Re: [PATCH] quiltimport: Skip non-existent patches

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 27, 2007, 22:02 UTC
Message-ID
<7vejgjsr6k.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<91705d080709271445k62f2867am99114eb0e98fc408@mail.gmail.com>
"Dan Nicholson" <dbn.lists@gmail.com> writes:
Show 9 quoted lines
> When you run the command `quilt series', it just lists what's in the
> series file (minus any comments). And when you run `quilt push' with a
> non-existent patch, it says "Patch foo.patch does not exist; applied
> empty patch"
>
> So, I think the consistent thing to do is what's in my patch: just
> skip the patch with a message to the user. Maybe the message can be
> tailored to match quilt's output. Actually, it would be best to also
> skip on empty files since quiltimport will bomb in that case as well.

Thanks for your helpful explanation. So perhaps we can do this on top of yours to be safer and more consistent.

---
 git-quiltimport.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index 880c81d..627e023 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -79,8 +79,8 @@ for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
 	git mailinfo "$tmp_msg" "$tmp_patch" \
 		<"$QUILT_PATCHES/$patch_name" >"$tmp_info" || exit 3
 	test -s "$tmp_patch" || {
-		echo "Patch is empty.  Was it split wrong?"
-		exit 1
+		echo "Patch is empty. Skipping."
+		continue
 	}
 
 	# Parse the author information
Previous: Dan NicholsonNext: Dan Nicholson
Message 7 of 9 in “git-quiltimport and non-existent patches”
  1. Geert UytterhoevenSep 27, 2007
  2. Junio C HamanoSep 27, 2007
  3. quiltimport: Skip non-existent patchesDan Nicholson, Sep 27, 2007
  4. Dan NicholsonSep 27, 2007
  5. Junio C HamanoSep 27, 2007
  6. Dan NicholsonSep 27, 2007
  7. Junio C HamanoSep 27, 2007
  8. Dan NicholsonSep 27, 2007
  9. Geert UytterhoevenSep 28, 2007

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.