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

[PATCH 0/4] Re-fix get_pathspec()

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 7, 2008, 08:38 UTC
Message-ID
<1204879119-7528-1-git-send-email-gitster@pobox.com>

After 1.5.4, we improved get_pathspec() to allow absolute paths, because people wanted to cut&paste from file managers and such, so that you can feed absolute paths to "git add" and friends.

However, the paths still must be inside work tree, so there must be a way to ensure that. d089eba (setup: sanitize absolute and funny paths in get_pathspec()) botched the interface, by making the check the responsibility of the callers, while keeping the interface to the function intact, which meant that the callers needed to count returned pathspecs and compared it with the number of paths fed to the function.

This miniseries cleans up the interface by making get_pathspec() to die again.

Junio C Hamano (4):
  get_pathspec(): die when an out-of-tree path is given
  Revert part of 744dacd (builtin-mv: minimum fix to avoid losing files)
  Revert part of 1abf095 (git-add: adjust to the get_pathspec() changes)
  Revert part of d089eba (setup: sanitize absolute and funny paths in
    get_pathspec())
 builtin-add.c              |   12 ------------
 builtin-ls-files.c         |   11 +----------
 builtin-mv.c               |    6 +-----
 setup.c                    |    2 ++
 t/t3101-ls-tree-dirname.sh |    2 +-
 t/t7010-setup.sh           |    7 ++++---
 6 files changed, 9 insertions(+), 31 deletions(-)
Next: Junio C Hamano
Message 1 of 7 in “Re-fix get_pathspec()”
  1. 0/4 Re-fix get_pathspec()Junio C Hamano, Mar 7, 2008
  2. 1/4 get_pathspec(): die when an out-of-tree path is givenJunio C Hamano, Mar 7, 2008
  3. Robin RosenbergMar 7, 2008
  4. Junio C HamanoMar 7, 2008
  5. Johannes SchindelinMar 7, 2008
  6. Junio C HamanoMar 7, 2008
  7. Junio C HamanoMar 8, 2008

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.