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

Feature request: relative paths

From
Eli Barzilay <eli@barzilay.org>
Date
May 6, 2010, 06:01 UTC
Message-ID
<19426.23330.525936.981066@winooski.ccs.neu.edu>

An svn feature that I used a lot is `svn cat some-file' -- and with git I can get close to that with `git show :some-file', except that unlike other paths, it must be an absolute path from the repository root. I could obviously make up a script that will do it, but that's just buying myself some time until I find some other command where I'll want to use it.

It looks like it would be relatively easy to do this, since when I do specify the relative path I get an error message suggesting the full one (provided that the relative path is simple -- no ".." etc). So, now that I can actually UTSL, I went there, and tried some half-assed hacking -- I made it so "::path" uses the prefix and normalizes the result, so, for example

  cd git/Documentation
  git show ::../Documentation/./user-manual.conf

works as expected. Using "::" looks bad IMO, and the hack I did is likely suffering from some problems, but overall it doesn't look too hard.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
Next: Jonathan Nieder
Message 1 of 6 in “Feature request: relative paths”
  1. Eli BarzilayMay 6, 2010
  2. Jonathan NiederMay 6, 2010
  3. Björn SteinbrinkMay 6, 2010
  4. Jonathan NiederMay 6, 2010
  5. Jeff KingMay 6, 2010
  6. Jeff KingMay 6, 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.