From: "Dana How" <danahow@gmail.com>
To: "Alex Riesen" <raa.lkml@gmail.com>
Cc: "Junio C Hamano" <junkio@cox.net>,
"Git Mailing List" <git@vger.kernel.org>,
danahow@gmail.com
Subject: Re: [PATCH] Support ent:relative_path
Date: Fri, 4 May 2007 09:57:12 -0700 [thread overview]
Message-ID: <56b7f5510705040957v4580b6c1xbe767892ada3bcde@mail.gmail.com> (raw)
In-Reply-To: <81b0412b0705040246r5a2726b8g4323cadeacee3aa7@mail.gmail.com>
On 5/4/07, Alex Riesen <raa.lkml@gmail.com> wrote:
> On 5/4/07, Dana How <danahow@gmail.com> wrote:
> > > I'd suggest to define a special character for _top_ level. Real pity
> > > ":/" is taken.
> > We could use ://fullpath for top level,
>
> No good. How'd you find a commit starting with "/" than? (without
> changing ":/" syntax).
Oh blechh. get_sha1_oneline uses prefixcmp(), not strstr().
Are there are any commits in git or the kernel starting with "/" ?
> > and :relpath for relative. Then "string" in :/string couldn't start with /,
> > which shouldn't be a problem (right?). I've certainly seen double
> > slashes before;
> > perforce in fact uses them for the root of the repository (depot).
>
> And I really hate perforce for its stupid redundancy (and changing of
> meaning of well-known idioms: why should // be anything special
> but plain top level or root?! Why the hell do they need them at if
> you cannot use relative paths in client specs at all?! Why can't the
> p4 command-line tool figure the fact from context or request the
> context be provided by user?! IOW, Perforce is a real bad example
> of how you do version control).
Whoa! I'm stuck using perforce too; I'm not holding it up as a *big*
example. I originally saw // meaning root in the Apollo DOMAIN
system, so for that reason it makes sense to me. I think it also
means network root in Windoze (well, \\ does ;-) )..
> > This all depends on deciding that :relpath should be the (incompatible)
> > new default, and I'm not sure that's going to happen.
>
> If we are to stay that compatible, maybe ":./" for relative paths and the
> old syntax left to mean top-level would the best choice for now.
Let's summarize so far: I think everyone's convinced me we need
to be careful, so this email will be more tedious than I'd like.
(a) :./relpath clearly inidicates relative path. [Also take :../relpath .]
(b) I'd like a more natural way to do :./relpath (e.g. :relpath),
or at least a future path to such.
(c) We would like to avoid new special characters beyond ":".
This means everything has to be done with "." and "/".
(d) We are left with the following patterns:
1. :string
2. :/string
3. ://string
[ We need a clear way to say relative, a clear way to say absolute,
and the current :string can change from absolute to relative some time
in the future if we so decide. ]
Ideas for (d) 2&3:
I. Make :/string actually match the RE ^[/]*string, and ://string a full path.
The leading [/]* is a very small change to get_sha1_oneline().
[Or change prefixcmp() to strstr() in get_sha1_oneline().]
How often do commit messages start with / ?
II. Make :/string a full path, and ://string match ^string .
Is changing the current :/string to ://string less painful/dangerous?
III. Make :/string match ^string when string has no slashes,
:/string a full path when string does have slashes,
and ://string match ^string . Hmm, seems confusing.
Do you use :/string now? Since it's a case-sensitive exact match,
I don't think I'd even use it.
I find idea (II) most natural: absolute paths have one /,
and string matches have 2 suggesting an RE.
Concerning the current :string , perhaps we could do the following.
There would be 2 internal fixed mode variables (NOT config variables) which
do the following. The first controls whether this means an absolute
or relative path. The second controls whether a warning message
is printed whenever the first is consulted to make a decision. The
interpretation of :string is left as-is, but motivated janitors (like me
in this case) can use the second mode variable to change all
:string patterns to :/string or ://string in scripts, letting us
switch over later
by changing one mode variable.
Someone mentioned DWIM for :string -- check both absolute and relative,
in that order for compatibility probably. This seems a messy
definition to me. Comments?
Anyway, this is more involved than I'd hoped,
but it's good to think about consequences.
Thanks,
--
Dana L. How danahow@gmail.com +1 650 804 5991 cell
next prev parent reply other threads:[~2007-05-04 16:57 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-04 7:18 [PATCH] Support ent:relative_path Dana How
2007-05-04 7:22 ` Dana How
2007-05-04 8:21 ` Junio C Hamano
2007-05-04 8:45 ` Dana How
2007-05-04 8:47 ` Alex Riesen
2007-05-04 8:53 ` Dana How
2007-05-04 9:17 ` Alex Riesen
2007-05-04 9:26 ` Dana How
2007-05-04 9:46 ` Alex Riesen
2007-05-04 16:57 ` Dana How [this message]
2007-05-04 17:17 ` Alex Riesen
2007-05-04 19:00 ` Johannes Schindelin
2007-05-04 20:23 ` Alex Riesen
2007-05-04 9:19 ` Johannes Sixt
2007-05-04 17:17 ` Junio C Hamano
2007-05-04 18:23 ` Dana How
2007-05-04 19:06 ` Johannes Schindelin
2007-05-04 19:22 ` Junio C Hamano
2007-05-04 19:31 ` Johannes Schindelin
2007-05-04 19:38 ` Junio C Hamano
2007-05-04 19:42 ` Johannes Schindelin
2007-05-04 20:21 ` Alex Riesen
2007-05-04 23:36 ` Jakub Narebski
2007-05-05 0:04 ` Junio C Hamano
2007-05-05 0:52 ` Dana How
2007-05-05 1:06 ` Jakub Narebski
2007-05-05 1:15 ` Junio C Hamano
2007-05-04 8:20 ` Alex Riesen
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=56b7f5510705040957v4580b6c1xbe767892ada3bcde@mail.gmail.com \
--to=danahow@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=raa.lkml@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).