You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2003/12/14 19:36:55 UTC
RFC: Changing anchor/target split to use "" instead of NULL
Back in the dark ages, before we had nailed down svn_path, we determined
that the structure of working copies demands that all operations be
rooted in a directory, even if the operation applies to a file. So, we
have this function svn_wc_get_actual_target, which splits a path into an
"anchor" and a "target". Examples:
svn update foodir/barfile --> "foodir"/"barfile"
svn update foodir --> "foodir"/NULL
svn update --> ""/NULL
This discipline is also reflected in the tree editor (you can only
open_root a directory, not a file), since tree edits are often meant to
be applied to working copies. Because of that, svn_repos_dir_delta()
accepts separate src_parent_dir (read: anchor) and src_entry (read:
target) parameters. The four wc-updating ra_lib functions (do_update,
do_switch, do_status, do_diff) also accept a target parameter which is
expected to be NULL for operations on directories.
In issue 999, I wrote that target should probably be "", not NULL, for
directory operations. In many other contexts we use the empty path,
rather than NULL, to mean "right here". I have composed a patch
(attached) to make this change, and am looking for comments. There is
no way I will apply this change to the trunk if there isn't agreement
that it should be in 1.0, since the trunk should not start out life with
a subtle and permanent API change from the 1.0 branch.
Specifically, I'm looking for comments like:
* You think this is wrong, that we really should be using NULL for
the target, because this is different from other situations
where we use a path element of "right here."
* You think this is right (or at least debatable), but you would
rather live with this API wart for a very long time than apply
such a potentially destabilizing patch to the 1.0 branch.
* You think this is right, and should make it into 1.0.
As an aside, I am developing a distinct antipathy towards
svn_path_is_empty(), because it is verbose and confusing (confusing
because it's a test for a negative, rather than for a positive). The
attached patch uses it all over the place, because I didn't feel that it
was right to ignore an svn_path abstraction, but I would much rather
write "if (*target)" than "if (! svn_path_is_empty (target))". I'd like
to solicit opinions on that point as well. Should I nuke it from
orbit? (We use it in 21 places right now.) Should I leave it alone but
feel free to ignore it? Or should I grit my teeth and use it?
Thanks.
Re: RFC: Changing anchor/target split to use "" instead of NULL
Posted by Ben Collins-Sussman <su...@collab.net>.
On Sun, 2003-12-14 at 22:32, C. Michael Pilato wrote:
> You have my blessing on getting this into 1.0.
Me too, +1.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: RFC: Changing anchor/target split to use "" instead of NULL
Posted by "C. Michael Pilato" <cm...@collab.net>.
Greg Hudson <gh...@MIT.EDU> writes:
> In issue 999, I wrote that target should probably be "", not NULL, for
> directory operations. In many other contexts we use the empty path,
> rather than NULL, to mean "right here". I have composed a patch
> (attached) to make this change, and am looking for comments. There is
> no way I will apply this change to the trunk if there isn't agreement
> that it should be in 1.0, since the trunk should not start out life with
> a subtle and permanent API change from the 1.0 branch.
>
> Specifically, I'm looking for comments like:
>
> * You think this is wrong, that we really should be using NULL for
> the target, because this is different from other situations
> where we use a path element of "right here."
>
> * You think this is right (or at least debatable), but you would
> rather live with this API wart for a very long time than apply
> such a potentially destabilizing patch to the 1.0 branch.
>
> * You think this is right, and should make it into 1.0.
I composed a mail trying to convince you that this is wrong. I
approached the thing from various perspectives.
You'll never gonna see that mail.
You have my blessing on getting this into 1.0.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: RFC: Changing anchor/target split to use "" instead of NULL
Posted by kf...@collab.net.
"Erik Huelsmann" <e....@gmx.net> writes:
> I didn't post this to the list yet, so for the record: +1 on the patch
> itself too.
Sorry, I misquoted you, Erik. Thanks for clarifying.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: RFC: Changing anchor/target split to use "" instead of NULL
Posted by Erik Huelsmann <e....@gmx.net>.
> > Back in the dark ages, before we had nailed down svn_path, we determined
> > that the structure of working copies demands that all operations be
> > rooted in a directory, even if the operation applies to a file. So, we
> > have this function svn_wc_get_actual_target, which splits a path into an
> > "anchor" and a "target". Examples:
>
> I haven't looked at the patch het, but I very much like the idea of a
> consistent interface.
>
> +1 to the idea.
[ quote from the svn list regarding issue #999: ]
http://subversion.tigris.org/servlets/BrowseList?list=dev&by=thread&from=139821
He later posted a patch for it, which got +1's from Mike Pilato and Erik
Huelsmann:
http://subversion.tigris.org/servlets/BrowseList?list=dev&by=thread&from=140319
[ end of quote ]
I didn't post this to the list yet, so for the record: +1 on the patch
itself too.
bye,
Erik.
--
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: RFC: Changing anchor/target split to use "" instead of NULL
Posted by Erik Huelsmann <e....@gmx.net>.
> Back in the dark ages, before we had nailed down svn_path, we determined
> that the structure of working copies demands that all operations be
> rooted in a directory, even if the operation applies to a file. So, we
> have this function svn_wc_get_actual_target, which splits a path into an
> "anchor" and a "target". Examples:
I haven't looked at the patch het, but I very much like the idea of a
consistent interface.
+1 to the idea.
bye,
erik.
--
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org