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

Re: [PATCH v5 3/3] cat-file: add --follow-symlinks to --batch

From
Junio C Hamano <gitster@pobox.com>
Date
May 12, 2015, 23:02 UTC
Message-ID
<xmqq617xe6x8.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1431470204.16652.52.camel@ubuntu>
David Turner <dturner@twopensource.com> writes:
> On Tue, 2015-05-12 at 13:22 -0700, Junio C Hamano wrote:
>
>> Are there other cases?  The only other case I think of is when the
>> link resolves cleanly inside the tree, which you already handle.
Funny double-inclusion ;-)
Show 14 quoted lines
> While updating the tests, I noticed another two cases:
> 1. HEAD:broken-link/file
>
> I am inclined to describe this as "dangling" as well.  (It is not useful
> to tell users that "file" is the remaining bit to be resolved, because
> due to chains of symlinks, users have no idea what file would be
> relative to).  I think the filesystem returns ENOENT in the equivalent
> case.
>
> 2. HEAD:link-to-file/file
>
> This should be "notdir", I think, in that it is a distinct way of
> failing that the user might care to know. The filesystem returns ENOTDIR
> in the equivalent case.
Thanks.
> In addition, I would like to have the format for the dangling, loop, and
> notdir cases match the missing case.  In other words, "HEAD:link
> missing", "HEAD:link dangling", etc.  Users already need to parse the
> missing case, so we might as well make the others match.

Interesting to see our opinions differ here, especially because the previous suggestion was coming from "users already need to parse the 'symlink' case, so we might as well make the others match" ;-).

Between 'missing' and 'symlink', the latter is richer in information and easier to parse, I would have thought.

Previous: David TurnerNext: Junio C Hamano
Message 14 of 20 in “cat-file --follow-symlinks”
  1. 0/3 cat-file --follow-symlinksdturner@twopensource.com, May 11, 2015
  2. 1/3 tree-walk: learn get_tree_entry_follow_symlinksdturner@twopensource.com, May 11, 2015
  3. Johannes SixtMay 12, 2015
  4. 2/3 sha1_name: get_sha1_with_context learns to follow symlinksdturner@twopensource.com, May 11, 2015
  5. 3/3 cat-file: add --follow-symlinks to --batchdturner@twopensource.com, May 11, 2015
  6. Johannes SixtMay 12, 2015
  7. Junio C HamanoMay 12, 2015
  8. David TurnerMay 12, 2015
  9. Junio C HamanoMay 12, 2015
  10. David TurnerMay 12, 2015
  11. Junio C HamanoMay 12, 2015
  12. Junio C HamanoMay 12, 2015
  13. David TurnerMay 12, 2015
  14. Junio C HamanoMay 12, 2015
  15. Junio C HamanoMay 12, 2015
  16. Junio C HamanoMay 12, 2015
  17. David TurnerMay 12, 2015
  18. Junio C HamanoMay 12, 2015
  19. David TurnerMay 12, 2015
  20. Junio C HamanoMay 14, 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.