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

Re: [RFC PATCH 1/1] dir: consider worktree config in path recursion

From
ODoss dev <gg.oss.dev@gmail.com>
Date
May 7, 2022, 17:59 UTC
Message-ID
<CAAA5oLmAMu=Dj8pOgMLGCeYO2c4mrNP38bjdKEVuBkzdb1=R9g@mail.gmail.com>
In-Reply-To
<CABPp-BFwiLXMVaFs-Lc-zU6X=pBiF8+o9rOuHEAArD2zMQ1NNQ@mail.gmail.com>
On Fri, May 6, 2022 at 11:26 PM Elijah Newren <newren@gmail.com> wrote:
> I haven't thought it through, but is there a reason you can't just
> compare the_repository->gitdir to sb.buf at this point?  Why is
> real_pathdup needed?

I used `real_pathdup` here because `the_repository->gitdir` is not necessarily normalized as required for the `strcmp`. For example, when using option `--git-dir=./././xyz/.git` while outside the worktree, the path will remain as is (see [1] and [2]).

[1]: https://github.com/git/git/blob/e8005e4871f130c4e402ddca2032c111252f070a/setup.c#L962 [2]: https://github.com/git/git/blob/e8005e4871f130c4e402ddca2032c111252f070a/environment.c#L353

> Thanks for finding, reporting, and sending in a patch.  Could you
> split up the patch as indicated above, and add a testcase to the patch
> with the fix, and include your Signed-off-by trailer on the commits?
WIll do, thx.
Previous: Elijah NewrenNext: Junio C Hamano
Message 4 of 31 in “dir: consider worktree config in path recursion”
  1. 0/1 dir: consider worktree config in path recursionGoss Geppert, May 5, 2022
  2. 1/1 dir: consider worktree config in path recursionGoss Geppert, May 5, 2022
  3. Elijah NewrenMay 7, 2022
  4. oss devMay 7, 2022
  5. Junio C HamanoMay 6, 2022
  6. oss devMay 6, 2022
  7. 0/2 dir: consider worktree config in path recursionGoss Geppert, May 10, 2022
  8. 1/2 dir: consider worktree config in path recursionGoss Geppert, May 10, 2022
  9. Junio C HamanoMay 11, 2022
  10. oss devMay 20, 2022
  11. Elijah NewrenMay 24, 2022
  12. Junio C HamanoMay 24, 2022
  13. Elijah NewrenMay 25, 2022
  14. Junio C HamanoMay 11, 2022
  15. oss devMay 20, 2022
  16. Derrick StoleeMay 23, 2022
  17. oss devMay 30, 2022
  18. 2/2 dir: minor refactoring / clean-upGoss Geppert, May 10, 2022
  19. Junio C HamanoMay 11, 2022
  20. oss devMay 20, 2022
  21. 0/3 dir: traverse into repositoryGoss Geppert, May 20, 2022
  22. 1/3 dir: traverse into repositoryGoss Geppert, May 20, 2022
  23. 3/3 dir: minor refactoring / clean-upGoss Geppert, May 20, 2022
  24. 2/3 dir: cache git_dir's realpathGoss Geppert, May 20, 2022
  25. Elijah NewrenMay 24, 2022
  26. 0/2 dir: traverse into repositoryGoss Geppert, Jun 16, 2022
  27. Elijah NewrenJun 22, 2022
  28. 0/2 dir: traverse into repository (resending)Goss Geppert, Jun 16, 2022
  29. 1/2 dir: traverse into repositoryGoss Geppert, Jun 16, 2022
  30. 1/2 dir: traverse into repositoryGoss Geppert, Jun 16, 2022
  31. 2/2 dir: minor refactoring / clean-upGoss Geppert, Jun 16, 2022

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.