git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Support ent:relative_path

From
Junio C Hamano <junkio@cox.net>
Date
May 4, 2007, 17:17 UTC
Message-ID
<7vabwktsng.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<463AFAAE.853DEF7B@eudaptics.com>
Johannes Sixt <J.Sixt@eudaptics.com> writes:
Show 9 quoted lines
> Alex Riesen wrote:
>> On 5/4/07, Junio C Hamano <junkio@cox.net> wrote:
>> > My preference is (2), (3) and then (1), but I do not have
>> > offhand a suggestion for a good metacharacter we could use.
>> 
>> "./" :)
>
> +1, without the :)
> and ../ should DWIM, too.

I think these feel more or less natural (except that we do not say ":/fullpath" and instead say ":fullpath" which is unfortunate).

In the hindsight, if we had the perfect vision into the future, we would have made <path> relative to where you are when we initially did "<something>:<path>", with obvious semantics for things like "<something>:../<path>" and "<something>:/<path>".

We didn't. Further, we made a mistake to make :/ to mean something completely unrelated. My bad.

So I think "./" is the best compromise in the meantime.

With your suggestion, we can train people's fingers to type "./" now, and perhaps later in one of those big feature release like the 1.5.0 was, we could switch to "default to relative".

At the same time of that big "UI correction", we could make "<something>:/<path>" to mean "full path in commit (or index/stage) no matter where I am".

The current ":/<string>" is about going back, looking for the string, so it should not have used '/'; instead it should have been "<something>:?<string>". Maybe we could fix it by start accepting ":?" now (in addition to ":/"), give a big fat warning about ":/" going to mean a different thing, and encouraging users to use the question-mark form, in preparation for the big "UI correction".

Do people like that plan?
(soon after 1.5.2)
 - start accepting "<something>:./<path>" as "relative to where I am".
 - start accepting "<something>:?<string>" as "look back to find
   the string".
 - clearly explain the plan and prepare the users.
(a big release in the future, perhaps 1.6.0)
 - "<something>:<path>" becomes relative to where you are.
 - stop "<something>:/<string>" and start "<something>:/<fullpath>".
Previous: Johannes SixtNext: Dana How
Message 15 of 28 in “Support ent:relative_path”
  1. Support ent:relative_pathDana How, May 4, 2007
  2. Dana HowMay 4, 2007
  3. Junio C HamanoMay 4, 2007
  4. Dana HowMay 4, 2007
  5. Alex RiesenMay 4, 2007
  6. Dana HowMay 4, 2007
  7. Alex RiesenMay 4, 2007
  8. Dana HowMay 4, 2007
  9. Alex RiesenMay 4, 2007
  10. Dana HowMay 4, 2007
  11. Alex RiesenMay 4, 2007
  12. Johannes SchindelinMay 4, 2007
  13. Alex RiesenMay 4, 2007
  14. Johannes SixtMay 4, 2007
  15. Junio C HamanoMay 4, 2007
  16. Dana HowMay 4, 2007
  17. Johannes SchindelinMay 4, 2007
  18. Junio C HamanoMay 4, 2007
  19. Johannes SchindelinMay 4, 2007
  20. Junio C HamanoMay 4, 2007
  21. Johannes SchindelinMay 4, 2007
  22. Alex RiesenMay 4, 2007
  23. Jakub NarebskiMay 4, 2007
  24. Junio C HamanoMay 5, 2007
  25. Dana HowMay 5, 2007
  26. Jakub NarebskiMay 5, 2007
  27. Junio C HamanoMay 5, 2007
  28. Alex RiesenMay 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.