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

Re: git-quiltimport and non-existent patches

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 27, 2007, 19:41 UTC
Message-ID
<7vps03uc9x.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<Pine.LNX.4.62.0709271154440.10467@pademelon.sonytel.be>
Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> writes:
Show 5 quoted lines
> It would be nice if git-quiltimport would just warn about
> non-existent patches, just like quilt.  This will make it work
> with `markers' we put in our quilt series files. Commenting
> out the markers is no solution as `quilt series' doesn't show
> commented-out patches.

I cannot decide if this should be the default (that's up to heavy users of git-quiltimport script), but something along this line should do. Care to test it and ack?

---
 git-quiltimport.sh |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index 74a54d5..3c38959 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -4,6 +4,7 @@ SUBDIRECTORY_ON=Yes
 . git-sh-setup
 
 dry_run=""
+error_empty=t
 quilt_author=""
 while test $# != 0
 do
@@ -25,6 +26,11 @@ do
 		dry_run=1
 		;;
 
+	--expect-marker)
+		shift
+		error_empty=
+		;;
+
 	--pa=*|--pat=*|--patc=*|--patch=*|--patche=*|--patches=*)
 		QUILT_PATCHES=$(expr "z$1" : 'z-[^=]*\(.*\)')
 		shift
@@ -74,10 +80,17 @@ for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
 	echo $patch_name
 	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
-	}
+	if test ! -s "$tmp_patch"
+	then
+		if test -z "$error_empty"
+		then
+			echo "Patch is empty.  Was it split wrong?"
+			exit 1
+		else
+			echo "Marker seen."
+			continue
+		fi
+	fi
 
 	# Parse the author information
 	export GIT_AUTHOR_NAME=$(sed -ne 's/Author: //p' "$tmp_info")
Previous: Geert UytterhoevenNext: Dan Nicholson
Message 2 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.