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

[PATCH 0/9] magic pathspec updates

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2011, 05:51 UTC
Message-ID
<1305006678-4051-1-git-send-email-gitster@pobox.com>
In-Reply-To
<1304852906-29272-1-git-send-email-pclouds@gmail.com>

This is a series to update the magic pathspec topic, primarily the area around the empty ':' pathspec.

The failing tests from Duy's are mostly due to the fact that this round is not converting the codebase fully and still use char **pathspec in places.

As get_pathspec() gives only a munged string for pattern matching, while losing the original pathspec information such as up to which point in the resulting string came from the prefix (hence it must match literally even under icase) or what the original string looked like, there is no way for these tests, especially the ones to check failure mode and the information in the error report, to pass.

As NEEDSWORK comment in prefix_pathspec() says, all the callers need to be converted to use "struct pathspec" interface, so that they can preserve the original information for error reporting purposes (and also to pass to external subprocesses --- see how pathspec is used to spawn the "add -i" helper for example).

Other than that, I think the current code is probably more or less safe to dogfood with known rough edges.

Junio C Hamano (8):
  grep: use get_pathspec() correctly
  get_pathspec(): an empty ':' pathspec should stand alone
  count_pathspec(): return number of elements in pathspec
  add ":" is a pathspec that is too wide
  git rm ":" is like specifying nothing
  clean ":" is like specifying nothing
  mv ":" ":" is like moving nothing from nowhere to nowhere
  checkout ":" is not giving any pathspec
Nguyễn Thái Ngọc Duy (1):
  t3703, t4208: add test cases for magic pathspec
 Documentation/glossary-content.txt |    3 +
 builtin/add.c                      |    4 +-
 builtin/checkout.c                 |    9 +---
 builtin/clean.c                    |    1 +
 builtin/grep.c                     |    8 +---
 builtin/mv.c                       |    6 ++-
 builtin/rm.c                       |    4 +-
 cache.h                            |    3 +-
 setup.c                            |   18 ++++++++-
 t/t3703-add-magic-pathspec.sh      |   78 ++++++++++++++++++++++++++++++++++++
 t/t4208-log-magic-pathspec.sh      |   45 +++++++++++++++++++++
 11 files changed, 160 insertions(+), 19 deletions(-)
 create mode 100755 t/t3703-add-magic-pathspec.sh
 create mode 100755 t/t4208-log-magic-pathspec.sh
-- 
1.7.5.1.290.g1b565
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 28 in “t3703: add test cases for pathspec magic”
  1. t3703: add test cases for pathspec magicNguyễn Thái Ngọc Duy, May 7, 2011
  2. Junio C HamanoMay 7, 2011
  3. Nguyen Thai Ngoc DuyMay 8, 2011
  4. t3703, t4208: add test cases for magic pathspecNguyễn Thái Ngọc Duy, May 8, 2011
  5. Junio C HamanoMay 8, 2011
  6. Nguyen Thai Ngoc DuyMay 9, 2011
  7. Junio C HamanoMay 9, 2011
  8. Junio C HamanoMay 9, 2011
  9. 0/9 magic pathspec updatesJunio C Hamano, May 10, 2011
  10. 1/9 grep: use get_pathspec() correctlyJunio C Hamano, May 10, 2011
  11. 2/9 get_pathspec(): an empty ':' pathspec should stand aloneJunio C Hamano, May 10, 2011
  12. 3/9 count_pathspec(): return number of elements in pathspecJunio C Hamano, May 10, 2011
  13. Nguyen Thai Ngoc DuyMay 10, 2011
  14. 4/9 add ":" is a pathspec that is too wideJunio C Hamano, May 10, 2011
  15. 5/9 git rm ":" is like specifying nothingJunio C Hamano, May 10, 2011
  16. 6/9 clean ":" is like specifying nothingJunio C Hamano, May 10, 2011
  17. Thiago FarinaMay 10, 2011
  18. 7/9 mv ":" ":" is like moving nothing from nowhere to nowhereJunio C Hamano, May 10, 2011
  19. Nguyen Thai Ngoc DuyMay 10, 2011
  20. 8/9 checkout ":" is not giving any pathspecJunio C Hamano, May 10, 2011
  21. 9/9 t3703, t4208: add test cases for magic pathspecJunio C Hamano, May 10, 2011
  22. t3703: Skip tests using directory name ":" on WindowsJohannes Sixt, May 12, 2011
  23. Ævar Arnfjörð BjarmasonMay 29, 2011
  24. Junio C HamanoMay 29, 2011
  25. Ævar Arnfjörð BjarmasonMay 29, 2011
  26. Nguyen Thai Ngoc DuyMay 10, 2011
  27. Junio C HamanoMay 10, 2011
  28. Nguyen Thai Ngoc DuyMay 11, 2011

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.