From: Thomas Rast <tr@thomasrast.ch>
To: Roman Kagan <rkagan@mail.ru>
Cc: git@vger.kernel.org, Benjamin Pabst <benjamin.pabst85@gmail.com>,
Eric Wong <normalperson@yhbt.net>
Subject: Re: [PATCH] git-svn: workaround for a bug in svn serf backend
Date: Mon, 30 Dec 2013 13:20:30 +0100 [thread overview]
Message-ID: <87lhz2o7ht.fsf@thomasrast.ch> (raw)
In-Reply-To: <1388059524-4864-1-git-send-email-rkagan@mail.ru> (Roman Kagan's message of "Thu, 26 Dec 2013 16:05:24 +0400")
Roman Kagan <rkagan@mail.ru> writes:
> + # workaround for a bug in svn serf backend (v1.8.5 and below):
> + # store 3d argument to ->add_file() in a local variable, to make it
> + # have the same lifetime as $fbat
> + my $upa = $self->url_path($m->{file_a});
> my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
> - $self->url_path($m->{file_a}), $self->{r});
> + $upa, $self->{r});
Hmm, now that you put it that way, I wonder if the patch is correct.
Let me first rephrase the problem to verify that I understand the issue:
$fbat keeps a pointer to the $upa string, without maintaining a
reference to it. When $fbat is destroyed, it needs this string, so we
must ensure that the lifetime of $upa is at least as long as that of
$fbat.
However, does Perl make any guarantees as to the order in which local
variables are unreferenced and then destroyed? I can't find any such
guarantee.
In the absence of such, wouldn't we have to keep $upa in an outer,
separate scope to ensure that $fbat is destroyed first?
--
Thomas Rast
tr@thomasrast.ch
next prev parent reply other threads:[~2013-12-30 12:20 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAM-uYMgy8duxdGY8rbCJv9To3FFMAUDv22nnzbQ+e3QrTCLLpQ@mail.gmail.com>
[not found] ` <CAM-uYMigCTK=j3HkyT0F=jtDoDERdtkpZiTXRvBhSHJW3edJ-w@mail.gmail.com>
2013-11-14 15:26 ` Fwd: Error with git-svn pushing a rename Benjamin Pabst
2013-11-15 7:34 ` Andreas Stricker
[not found] ` <CAM-uYMgn4SGqurqRG-RDiicLxpf9NfTPUvNn9FaFUUbxFRJsZw@mail.gmail.com>
2013-11-15 13:36 ` Andreas Stricker
2013-11-15 22:53 ` Jonathan Nieder
2013-11-17 22:55 ` Andreas Stricker
2013-11-20 22:10 ` Benjamin Pabst
2013-12-24 21:11 ` Roman Kagan
2013-12-25 10:52 ` Roman Kagan
2013-12-25 13:13 ` Roman Kagan
2013-12-25 16:31 ` Thomas Rast
2013-12-26 12:05 ` [PATCH] git-svn: workaround for a bug in svn serf backend Roman Kagan
2013-12-26 20:28 ` Jonathan Nieder
2013-12-27 6:09 ` Roman Kagan
2013-12-27 7:52 ` Roman Kagan
2013-12-27 8:05 ` [PATCH v2] " Roman Kagan
2013-12-27 20:07 ` Jonathan Nieder
2013-12-27 20:34 ` Eric Wong
2013-12-27 22:22 ` Junio C Hamano
2013-12-28 9:58 ` Roman Kagan
2013-12-30 19:44 ` Junio C Hamano
2013-12-31 7:20 ` Roman Kagan
2014-01-17 11:32 ` Roman Kagan
2014-01-17 19:23 ` Junio C Hamano
2014-01-06 15:51 ` Andreas Stricker
2013-12-30 12:20 ` Thomas Rast [this message]
2013-12-30 16:01 ` [PATCH] " Roman Kagan
2013-11-18 17:59 ` Fwd: Error with git-svn pushing a rename Benjamin Pabst
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=87lhz2o7ht.fsf@thomasrast.ch \
--to=tr@thomasrast.ch \
--cc=benjamin.pabst85@gmail.com \
--cc=git@vger.kernel.org \
--cc=normalperson@yhbt.net \
--cc=rkagan@mail.ru \
/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).