From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: git@vger.kernel.org
Cc: Dan Nicholson <dbn.lists@gmail.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Gerrit Pape <pape@smarden.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Junio C Hamano <gitster@pobox.com>,
Pierre Habouzit <madcoder@debian.org>
Subject: [PATCH] quiltimport: use quilt to do patch/series parsing and application
Date: Fri, 20 Mar 2009 20:18:03 +0100 [thread overview]
Message-ID: <1237576683-5516-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20090320190617.GA28784@pengutronix.de>
quilt supports packed patches that are not recognized by quiltimport.
Instead of adding this feature explicitly, use quilt to do the dirty
work.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Dan Nicholson <dbn.lists@gmail.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>
Cc: Pierre Habouzit <madcoder@debian.org>
---
Hello,
note I didn't test it deeply, but I succeeded to import the preempt-rt patch.
Things that might be worth testing are:
missing patches referenced in series
patch conflicts
Best regards
Uwe
git-quiltimport.sh | 51 ++++++++++++++++++++++++---------------------------
1 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index 9a6ba2b..8b76682 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -51,6 +51,7 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
echo "The \"$QUILT_PATCHES\" directory does not exist."
exit 1
fi
+export QUILT_PATCHES
# Temporary directories
tmp_dir="$GIT_DIR"/rebase-apply
@@ -62,31 +63,23 @@ tmp_info="$tmp_dir/info"
# Find the intial commit
commit=$(git rev-parse HEAD)
+# TODO: assert wc == index == HEAD
+# TODO: assert .pc doesn't exist
+
+# detach HEAD
+git checkout -q "$commit"
+
mkdir $tmp_dir || exit 2
-while read patch_name level garbage <&3
+while quilt unapplied > /dev/null
do
- case "$patch_name" in ''|'#'*) continue;; esac
- case "$level" in
- -p*) ;;
- ''|'#'*)
- level=;;
- *)
- echo "unable to parse patch level, ignoring it."
- level=;;
- esac
- case "$garbage" in
- ''|'#'*);;
- *)
- echo "trailing garbage found in series file: $garbage"
- exit 1;;
- esac
- if ! [ -f "$QUILT_PATCHES/$patch_name" ] ; then
- echo "$patch_name doesn't exist. Skipping."
- continue
- fi
+ # apply patch
+ quilt push || exit 3
+
+ patch_name="$(quilt top)";
+
echo $patch_name
- git mailinfo "$tmp_msg" "$tmp_patch" \
- <"$QUILT_PATCHES/$patch_name" >"$tmp_info" || exit 3
+ (quilt header; echo "---") | git mailinfo "$tmp_msg" "$tmp_patch" \
+ >"$tmp_info" || exit 3
test -s "$tmp_patch" || {
echo "Patch is empty. Was it split wrong?"
exit 1
@@ -129,10 +122,14 @@ do
fi
if [ -z "$dry_run" ] ; then
- git apply --index -C1 ${level:+"$level"} "$tmp_patch" &&
- tree=$(git write-tree) &&
- commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git commit-tree $tree -p $commit) &&
- git update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4
+ quilt files | git update-index --add --remove --stdin &&
+ (echo "$SUBJECT"; echo; cat "$tmp_msg") | git commit -F - ||
+ exit 4
fi
-done 3<"$QUILT_PATCHES/series"
+done
+
+if [ -n "$dry_run" ] ; then
+ quilt pop -a;
+fi
+
rm -rf $tmp_dir || exit 5
--
1.6.2
prev parent reply other threads:[~2009-03-20 19:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-20 19:06 git quiltimport and git apply fail importing the PREEMPT_RT patches Uwe Kleine-König
2009-03-20 19:18 ` Uwe Kleine-König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1237576683-5516-1-git-send-email-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=dbn.lists@gmail.com \
--cc=ebiederm@xmission.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=madcoder@debian.org \
--cc=pape@smarden.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).