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

Re: [PATCH 1/3] tree-walk: learn get_tree_enty_follow_symlinks

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 8, 2015, 19:43 UTC
Message-ID
<CAPig+cQTN5OCxfH_OLjaqza4Os8=kton8baiQMgiNZjR10C=ag@mail.gmail.com>
In-Reply-To
<1431108819-6831-1-git-send-email-dturner@twopensource.com>
On Fri, May 8, 2015 at 2:13 PM,  <dturner@twopensource.com> wrote:
> tree-walk: learn get_tree_enty_follow_symlinks
s/enty/entry/ here and in several places in the patch itself.
Show 26 quoted lines
> Add a new function, get_tree_entry_follow_symlinks, to tree-walk.[ch].
> The function is not yet used.  It will be used to implement git
> cat-file --batch --follow-symlinks.
>
> The function locates an object by path, following symlinks in the
> repository.  If the symlinks lead outside the repository, the function
> reports this to the caller.
>
> Signed-off-by: David Turner <dturner@twitter.com>
> ---
> diff --git a/tree-walk.c b/tree-walk.c
> index 5dd9a71..6fb4b7d 100644
> --- a/tree-walk.c
> +++ b/tree-walk.c
> @@ -415,6 +415,228 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
>  static int find_tree_entry(struct tree_desc *t, const char *name, unsigned char *result, unsigned *mode)
>  {
> diff --git a/tree-walk.h b/tree-walk.h
> index ae7fb3a..002e5a9 100644
> --- a/tree-walk.h
> +++ b/tree-walk.h
> @@ -40,6 +40,8 @@ struct traverse_info;
>  typedef int (*traverse_callback_t)(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *);
>  int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info);
>
> +int get_tree_enty_follow_symlinks(unsigned char *tree_sha1, const char *name, unsigned char *result, unsigned char *result_path, unsigned *mode);
Previous: David Turner
Message 15 of 15 in “tree-walk: learn get_tree_enty_follow_symlinks”
  1. 1/3 tree-walk: learn get_tree_enty_follow_symlinksdturner@twopensource.com, May 8, 2015
  2. 2/3 sha1_name: get_sha1_with_context learns to follow symlinksdturner@twopensource.com, May 8, 2015
  3. Eric SunshineMay 8, 2015
  4. Junio C HamanoMay 8, 2015
  5. Junio C HamanoMay 8, 2015
  6. Jeff KingMay 8, 2015
  7. Junio C HamanoMay 8, 2015
  8. David TurnerMay 8, 2015
  9. Philip OakleyMay 8, 2015
  10. Junio C HamanoMay 8, 2015
  11. 3/3 cat-file: add --follow-symlinks to --batchdturner@twopensource.com, May 8, 2015
  12. Eric SunshineMay 8, 2015
  13. Junio C HamanoMay 8, 2015
  14. David TurnerMay 8, 2015
  15. Eric SunshineMay 8, 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.