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

Re: log/show: relative pathnames do not work in rev:path

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2007, 20:45 UTC
Message-ID
<7v8x3qv2g3.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<56b7f5510712181430w798d4a65x20a24f061c5d0eb6@mail.gmail.com>
"Dana How" <danahow@gmail.com> writes:
> How about this:
> <tree-ish>:./path -> NEW: relative

I think making "<tree>:./" mean "replace ./ with the current prefix and retry the usual expansion" is relatively confusion free. You have to work hard to confuse yourself:

	d=$(git rev-parse --verify HEAD:Documentation)
        git rev-parse "$d":./howto ;# would not work
	cd Documentation && git rev-parse "$d":./howto ;# would work
> <tree-ish>:../path -> NEW: relative

I would rather avoid up (../) processing if we can, but making "<tree>:" immediately followed by 1 or more "../" mean "take the current prefix, strip away the same number of trailing directory components as we have "../" there, and tuck the remainder in front of the path before trying the usual expansion" would be a natural and relatively confusion free extension of the above. I think I can live with that, too.

> <tree-ish>:?pattern -> NEW: same as next (current :/ )

I'd prefer keeping :? (or some other unlikely-in-path letter other than '?') as a special extension introducer character, i.e. leaving the door open to:

	<tree>:?(magic)parameter
whose semantics is to be defined later, depending on "magic".
Similarly, we could do the same for
	:?(magic)parameter
> <tree-ish>:/pattern -> unchanged (sha1_name_oneline IIRC)

I do not think this is oneline. "<commit>:/pattern" could be a natural extension to the current ":/pattern" that instructs "dig from only this commit, not all refs, and find a commit with the oneline," but I do not think it is a good idea. It is too similar to "locate this tree entry from the given tree" syntax.

> <tree-ish>:path -> unchanged: absolute
Absolutely ;-)
Previous: Johannes SchindelinNext: Alex Riesen
Message 18 of 43 in “log/show: relative pathnames do not work in rev:path”
  1. Alex RiesenDec 18, 2007
  2. Jakub NarebskiDec 18, 2007
  3. Alex RiesenDec 18, 2007
  4. Simple support for tree entry specification with relative pathnamesAlex Riesen, Dec 18, 2007
  5. Introduce pathexpand: syntax-level chdir into the given cwdAlex Riesen, Dec 18, 2007
  6. Use pathexpand to preparse the relative pathnames in blob referencesAlex Riesen, Dec 18, 2007
  7. Dana HowDec 18, 2007
  8. Jeff KingDec 19, 2007
  9. Dana HowDec 18, 2007
  10. Alex RiesenDec 18, 2007
  11. Jakub NarebskiDec 18, 2007
  12. Linus TorvaldsDec 18, 2007
  13. Dana HowDec 18, 2007
  14. Alex RiesenDec 18, 2007
  15. Junio C HamanoDec 18, 2007
  16. Dana HowDec 18, 2007
  17. Johannes SchindelinDec 18, 2007
  18. Junio C HamanoDec 19, 2007
  19. Alex RiesenDec 18, 2007
  20. Johannes SchindelinDec 18, 2007
  21. Dana HowDec 18, 2007
  22. Johannes SchindelinDec 18, 2007
  23. Linus TorvaldsDec 19, 2007
  24. Dana HowDec 19, 2007
  25. Alex RiesenDec 19, 2007
  26. Jakub NarebskiDec 19, 2007
  27. Dana HowDec 19, 2007
  28. Jakub NarebskiDec 19, 2007
  29. sha1_name: grok <revision>:./<relative-path>Johannes Schindelin, Dec 19, 2007
  30. Jeff KingDec 19, 2007
  31. Dana HowDec 19, 2007
  32. Alex RiesenDec 19, 2007
  33. Junio C HamanoDec 20, 2007
  34. Johannes SchindelinDec 20, 2007
  35. Nguyen Thai Ngoc DuyDec 21, 2007
  36. Junio C HamanoDec 21, 2007
  37. Nguyen Thai Ngoc DuyDec 21, 2007
  38. Johannes SchindelinDec 22, 2007
  39. Jakub NarebskiDec 18, 2007
  40. Dana HowDec 18, 2007
  41. Junio C HamanoDec 18, 2007
  42. Jakub NarebskiDec 18, 2007
  43. Alex RiesenDec 19, 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.