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

Re: git ls-files -X option is relative to repo root

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 13, 2015, 20:42 UTC
Message-ID
<xmqqmw4hmtlw.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAG4vEKM-2sy0z3=YLS+rgH99w6ukdcNBode9CAh4C4t9eSa02A@mail.gmail.com>
Daniel Finnie <dan@danfinnie.com> writes:
> My question deals with the --exclude-from option to git-ls-files.

You will be fine if you remember that these plumbing commands work by first cd'ing to the top-level of the working tree (and adjust the paths given from the command line by prefixing the prefix to them).

The input lines that come from --exclude-per-directory should go through the prefixing, but -X=<file> makes that single file affect the whole operation. It does not make sense to allow where you are to affect behaviour of the command, i.e. in these two invocations of ls-files:

	git ls-files -X /var/tmp/exclude -i
        cd example && git ls-files -X /var/tmp/exclude -i

if the same line in /var/tmp/exclude meant completely different things, it would be crazy.

Previous: Daniel FinnieNext: Junio C Hamano
Message 2 of 5 in “git ls-files -X option is relative to repo root”
  1. Daniel FinnieFeb 13, 2015
  2. Junio C HamanoFeb 13, 2015
  3. Junio C HamanoFeb 13, 2015
  4. Daniel FinnieFeb 13, 2015
  5. Junio C HamanoFeb 13, 2015

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.