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

Re: [PATCH 0/3] Support relative path in <blah>:path syntax

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Nov 18, 2010, 01:47 UTC
Message-ID
<20101118014701.GA30452@do>
In-Reply-To
<7vk4kbg7jz.fsf@alter.siamese.dyndns.org>
On Wed, Nov 17, 2010 at 09:54:08AM -0800, Junio C Hamano wrote:
Show 17 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
> 
> > Sorry Jonathan I lied. I did not pick up your fast-import changes.
> > Could not find how to test it. And it seems fast-import only cares
> > about commits, not the target audience of this syntax.
> >
> > Document is not updated because I think it's intuitive enough.
> 
> When you say <tree>:<path>, you would intuitively expect that the path is
> relative to <tree>, but this patch deliberately breaks (in a good way)
> that expectation by introducing a magic token "./".  Once you know that
> "./" magic _exists_, it is obvious what it means, but people may not even
> imagine that such a magic may exist in the first place (certainly old
> timers won't), and would not know what the magic token is if you do not
> tell them.
> 
> It needs to be documented.
OK. How about this, squashing in the last patch of this series?
--8<--
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index 3d4b79c..3fc3e8b 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -121,6 +121,10 @@ the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
   ':path' (with an empty part before the colon, e.g. `:README`)
   is a special case of the syntax described next: content
   recorded in the index at the given path.
+  A path starting with './' or '../' is relative to current working directory.
+  The given path will be converted to be relative to working tree's root directory.
+  This is most useful to address a blob or tree from a commit or tree that has
+  the same tree structure with the working tree.
 
 * A colon, optionally followed by a stage number (0 to 3) and a
   colon, followed by a path (e.g. `:0:README`); this names a blob object in the
--8<--
Previous: Junio C Hamano
Message 12 of 12 in “Support relative path in <blah>:path syntax”
  1. 0/3 Support relative path in <blah>:path syntaxNguyễn Thái Ngọc Duy, Nov 11, 2010
  2. 1/3 setup: save prefix (original cwd relative to toplevel) in startup_infoNguyễn Thái Ngọc Duy, Nov 11, 2010
  3. 2/3 Make prefix_path() return char* without constNguyễn Thái Ngọc Duy, Nov 11, 2010
  4. 3/3 get_sha1: support relative path ":path" syntaxNguyễn Thái Ngọc Duy, Nov 11, 2010
  5. Thiago FarinaNov 14, 2010
  6. get_sha1: support relative path ":path" syntaxNguyễn Thái Ngọc Duy, Nov 15, 2010
  7. Sverre RabbelierNov 15, 2010
  8. Junio C HamanoNov 15, 2010
  9. Junio C HamanoNov 15, 2010
  10. get_sha1: support relative path ":path" syntaxNguyễn Thái Ngọc Duy, Nov 28, 2010
  11. Junio C HamanoNov 17, 2010
  12. Nguyen Thai Ngoc DuyNov 18, 2010

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.