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

Re: RFC: git cat-file --follow-symlinks?

From
Jeff King <peff@peff.net>
Date
Apr 29, 2015, 23:11 UTC
Message-ID
<20150429231150.GB3887@peff.net>
In-Reply-To
<1430346576.14907.40.camel@ubuntu>
On Wed, Apr 29, 2015 at 03:29:36PM -0700, David Turner wrote:
Show 13 quoted lines
> Overall, I agree.  I think the disadvantages are somewhat overstated.
> 
> As I said above, I don't think the cwd is a problem.  The output for
> symlinks which point outside the repo should be absolute (in the case of
> absolute symlinks), or relative to the repo root (for relative
> symlinks).  In other words, if my repo contains:
> foo/bar -> ../../baz
> then the output[1] would be 
> symlink 6
> ../baz
> 
> I can't think of any other output that would be reasonable here, but
> maybe there's something I don't understand.

Yeah, I agree if you let git punt on leaving the filesystem, most of the complicated problems go away. It still feels a bit more magical than I expect out of cat-file, and there are still corner cases (e.g., do we do cycle detection? Or just have a limit to the recursion depth?)

And if you are punting on some cases, I think you'd still want to be able to report on the symlinks you couldn't resolve (e.g., because they went out of tree, pointed to non-existent files, or caused cycles). So it seems like %(intreemode) is a good first step, because it lets you express that (and more).

And then you could implement --follow-symlinks on top of that; it can't catch all cases, but you've left callers with an escape hatch to do their own resolution if they want, without having to implement a new syntax for it.

-Peff
Previous: David TurnerNext: Jeff King
Message 10 of 43 in “RFC: git cat-file --follow-symlinks?”
  1. David TurnerApr 29, 2015
  2. Jonathan NiederApr 29, 2015
  3. David TurnerApr 29, 2015
  4. Junio C HamanoApr 29, 2015
  5. David TurnerApr 29, 2015
  6. Jeff KingApr 29, 2015
  7. Jonathan NiederApr 29, 2015
  8. Jeff KingApr 29, 2015
  9. David TurnerApr 29, 2015
  10. Jeff KingApr 29, 2015
  11. Jeff KingApr 30, 2015
  12. David TurnerApr 30, 2015
  13. Jeff KingApr 30, 2015
  14. Junio C HamanoApr 30, 2015
  15. Jeff KingApr 30, 2015
  16. David TurnerApr 30, 2015
  17. Jeff KingApr 30, 2015
  18. Junio C HamanoApr 30, 2015
  19. Michael HaggertyApr 30, 2015
  20. David TurnerApr 30, 2015
  21. Junio C HamanoApr 30, 2015
  22. David TurnerApr 30, 2015
  23. Jeff KingApr 30, 2015
  24. David TurnerApr 30, 2015
  25. Jeff KingApr 30, 2015
  26. David TurnerApr 30, 2015
  27. Jeff KingApr 30, 2015
  28. David TurnerApr 30, 2015
  29. Andreas SchwabApr 30, 2015
  30. Jeff KingApr 30, 2015
  31. Junio C HamanoApr 30, 2015
  32. David TurnerApr 30, 2015
  33. Junio C HamanoApr 30, 2015
  34. Jeff KingApr 30, 2015
  35. Junio C HamanoApr 30, 2015
  36. David TurnerMay 1, 2015
  37. Jeff KingMay 1, 2015
  38. David TurnerMay 1, 2015
  39. Jeff KingMay 1, 2015
  40. David TurnerMay 1, 2015
  41. Junio C HamanoApr 29, 2015
  42. David TurnerApr 29, 2015
  43. Michael HaggertyApr 30, 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.