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

Re: [PATCH] Support ent:relative_path

From
DHDana How <danahow@gmail.com>
Date
May 4, 2007, 08:45 UTC
Message-ID
<56b7f5510705040145k781da6farff3d02c3c1a5f3f9@mail.gmail.com>
In-Reply-To
<7v7irpuhhr.fsf@assigned-by-dhcp.cox.net>
On 5/4/07, Junio C Hamano <junkio@cox.net> wrote:
Show 33 quoted lines
> I do not think it is wrong per-se, to want to make this hold true:
>
>         A=$(git rev-parse :somedir/file)
>         B=$(cd somedir && git rev-parse :file)
>         test "$A" = "$B"
>
> One thing I am reasonably certain however is that this should
> NOT be conditional to a config setting.  Doing so would force
> scripts that take (or compute) path and commit and concatenate
> them to make "${commit}:${path}" to name a blob (or tree) to
> first inspect the current setting of core.relativepaths and undo
> what the new code does by prefixing/subtracting the prefix
> string depending on the config.
>
> In other words, having that config is not really helping scripts
> or compatibility.
>
> I think the choices are:
>
>  (1) we say it was a mistake that we did not make it relative to
>      the current directory when we introduced the X:<path>
>      syntax (X could be empty or :[0-3]: for index, or a commit
>      or tree object name), and change the semantics in a future
>      major release for everybody, apologizing for potentially
>      breaking existing scripts; or
>
>  (2) keep the current behaviour as is, and come up with a
>      different syntax to use relative; or
>
>  (3) do nothing.
>
> My preference is (2), (3) and then (1), but I do not have
> offhand a suggestion for a good metacharacter we could use.
Let us require:
* No config settings as you prefer
* Current interpretations are unchanged.
The current path supports
  :fullpath
  :/string
  :./relpath
[assuming core.relativepaths=no always since it goes away].
(:/string is the "find string in commit msg" feature.)
A new metacharacter lets us drop the "./" ,
and I think that's desirable.
How about = ? It's not even shifted on my keyboard:
 ent=relpath
 ent=2=relpath
 ent=/fullpath
1. We would accept the same new metacharacter before stage if any.
2, You could still use ent:/string , or ent:fullpath .

The patch should also be extended so relpath can start with a sequence of ./ or ../ prefixes, which is easily handled in prepend_prefix()..

What do you think of "=" ?
-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell
Previous: Junio C HamanoNext: Alex Riesen
Message 4 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.