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

Re: mangled file names in git checkout-index --temp output when run in repo subdirectory

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 23, 2014, 23:27 UTC
Message-ID
<CAPig+cQ4Bb=bUKeKuBp-ykorBV+mSuztvzh=AA5CDNPFLVQw5Q@mail.gmail.com>
In-Reply-To
<CAA8EjDRsw6o8T1sS=rpSt_+KaKt9QnONCmF23yHDdKhgKHcdww@mail.gmail.com>
On Tue, Dec 23, 2014 at 11:36 AM, Russ Cox <rsc@golang.org> wrote:
Show 17 quoted lines
> I am using git checkout-index --temp to obtain copies of files from
> the index, but it does not always print valid file names unless run
> from the repository root.
>
> git checkout-index --temp prints names of files in the index
> interpreted relative to the current directory below the repository
> root.
>
> If you have a git repo in /tmp/gitbug, you are in /tmp/gitbug/dir1,
> and you run git checkout-index --temp /tmp/gitbug/dir1/file1, the file
> listing prints just "file1". So far so good.
>
> However, this file name shortening appears to assume that all file
> names being printed will be within the subtree rooted at the current
> directory, and it just skips over the first N characters in the name,
> where N is the length of the current directory name relative to the
> repo root (in the above example, N = len("dir1/") = 5).

Indeed, although the "checkout" functionality of checkout-index properly handles relative paths above the current directory, the code which prints them doesn't. I'm working up a patch.

Previous: Russ Cox
Message 2 of 2 in “mangled file names in git checkout-index --temp output when run in repo subdirectory”
  1. Russ CoxDec 23, 2014
  2. Eric SunshineDec 23, 2014

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.