From: Eric Wong <e@80x24.org>
To: Christian Couder <christian.couder@gmail.com>,
Jacob Godserv <jacobgodserv@gmail.com>
Cc: Christian Couder <chriscool@tuxfamily.org>, git@vger.kernel.org
Subject: [PATCH] git-svn: warn instead of dying when commit data is missing
Date: Sat, 2 Jul 2016 10:33:18 +0000 [thread overview]
Message-ID: <20160702103317.GA6120@dcvr.yhbt.net> (raw)
In-Reply-To: <CAP8UFD0+vG3i26=w7WqjYcpOLj+V6X35_W6DAiMmTpiC2kxRWA@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> wrote:
> On Fri, Jun 24, 2016 at 10:06 PM, Eric Wong <e@80x24.org> wrote:
> > Jacob Godserv <jacobgodserv@gmail.com> wrote:
> >> > Christian (Cc-ed) also noticed the problem a few weeks ago
> >> > and took a more drastic approach by having git-svn die
> >> > instead of warning:
> >> > http://mid.gmane.org/1462604323-18545-1-git-send-email-chriscool@tuxfamily.org
> >> > which landed as commit 523a33ca17c76bee007d7394fb3930266c577c02
> >> > in git.git: https://bogomips.org/mirrors/git.git/patch?id=523a33ca17c7
> >> >
> >> > Is dying here too drastic and maybe warn is preferable?
> >>
> >> In my opinion this is too drastic. It keeps me from storing
> >> git-specific data on a git-svn mirror.
> >
> > I tend to agree, but will wait to see what Christian thinks.
>
> Yeah a warning is probably enough.
OK, patch below.
> Another possibility would be to default to an error that tells people
> about a configuration variable that could let them decide depending on
> their workflow if this should be an error, a warning or just be
> ignored.
I think that's too much. I'm not a fan of having too many
configuration variables to throw on users.
------8<------
Subject: [PATCH] git-svn: warn instead of dying when commit data is missing
It is possible to have refs globbed by git-svn which stores data
purely in git; gently skip those instead of dying and assuming
user error.
ref: http://mid.gmane.org/CALi1mtdtNF_GtzyPTbfb7N51wwxsFY7zm8hsgwxr3tHcZZboyg@mail.gmail.com
Suggested-by: Jacob Godserv <jacobgodserv@gmail.com>
Cc: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Eric Wong <e@80x24.org>
---
perl/Git/SVN.pm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index bee1e7d..018beb8 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -97,8 +97,12 @@ sub resolve_local_globs {
"existing: $existing\n",
" globbed: $refname\n";
}
- my $u = (::cmt_metadata("$refname"))[0] or die
- "$refname: no associated commit metadata\n";
+ my $u = (::cmt_metadata("$refname"))[0];
+ if (!defined($u)) {
+ warn
+"W: $refname: no associated commit metadata from SVN, skipping\n";
+ next;
+ }
$u =~ s!^\Q$url\E(/|$)!! or die
"$refname: '$url' not found in '$u'\n";
if ($pathname ne $u) {
--
EW
prev parent reply other threads:[~2016-07-02 10:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 18:48 git-svn aborts with "Use of uninitialized value $u" when a non-svn-backed branch is present in remote Jacob Godserv
2016-06-24 14:44 ` Jacob Godserv
2016-06-24 19:35 ` Eric Wong
[not found] ` <CALi1mtc6Byb39kbAv16vmkUVu3JDdGG4-yVrLroDVraPDxGFng@mail.gmail.com>
2016-06-24 20:06 ` Eric Wong
2016-06-25 8:39 ` Christian Couder
2016-07-02 10:33 ` Eric Wong [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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160702103317.GA6120@dcvr.yhbt.net \
--to=e@80x24.org \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=jacobgodserv@gmail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).