From: "Dan Nicholson" <dbn.lists@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] quiltimport: Skip non-existent patches
Date: Thu, 27 Sep 2007 15:20:46 -0700 [thread overview]
Message-ID: <91705d080709271520r11546361hdbe5e028d415e961@mail.gmail.com> (raw)
In-Reply-To: <7vejgjsr6k.fsf@gitster.siamese.dyndns.org>
On 9/27/07, Junio C Hamano <gitster@pobox.com> wrote:
> "Dan Nicholson" <dbn.lists@gmail.com> writes:
>
> > 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
That's seems fine. IIUC, mailinfo will only create an empty patch if
there's no actual patch content in the original mail/patch. In that
case, you probably do want to skip and not bomb. I'd changed my patch
to do 'if ! [ -s "$patch" ]' to catch an empty file, but this is
probably better. Hmm, checking `quilt push' on a patch with no actual
patch bombs. Here's the output:
$ quilt push
Applying patch foo.patch
patch: **** Only garbage was found in the patch input.
Patch foo.patch does not apply (enforce with -f)
$ echo $?
1
$ cat patches/foo.patch
Here's info about an empty patch.
So, it might be better to leave the original behavior there to match quilt.
--
Dan
next prev parent reply other threads:[~2007-09-27 22:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-27 9:59 git-quiltimport and non-existent patches Geert Uytterhoeven
2007-09-27 19:41 ` Junio C Hamano
2007-09-27 20:30 ` [PATCH] quiltimport: Skip " Dan Nicholson
2007-09-27 20:39 ` Dan Nicholson
2007-09-27 20:50 ` Junio C Hamano
2007-09-27 21:45 ` Dan Nicholson
2007-09-27 22:02 ` Junio C Hamano
2007-09-27 22:20 ` Dan Nicholson [this message]
2007-09-28 14:06 ` Geert Uytterhoeven
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=91705d080709271520r11546361hdbe5e028d415e961@mail.gmail.com \
--to=dbn.lists@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).