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

Re: [RFC/PATCH 1/3] tree.c: add support for traversal of submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2009, 03:15 UTC
Message-ID
<7vr639kyf0.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1231717555-10559-2-git-send-email-hjemli@gmail.com>
Lars Hjemli <hjemli@gmail.com> writes:
Show 20 quoted lines
> If the commit referenced by a gitlink is available in the (possibly
> alternate) object database, read_tree_recursive() is now able to descend
> into the tree of the linked commit if the flag 'traverse_gitlinks' is
> turned on.
>
> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
> ---
>  tree.c |   20 +++++++++++++++++---
>  tree.h |    1 +
>  2 files changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/tree.c b/tree.c
> index 03e782a..1468e10 100644
> --- a/tree.c
> +++ b/tree.c
> @@ -7,6 +7,7 @@
>  #include "tree-walk.h"
>  
>  const char *tree_type = "tree";
> +int traverse_gitlinks = 0;

I think we tend to put these global settings that will affect everybody in environment.c. You do not have to initialize variable to zero; BSS will take care of it.

When the user explicitly asks you to traverse into submodules and the necessary commit is not available in a submodule, the code goes on without complaining. I am not saying it is bad, but I wonder if we would want to distinguish these three cases:

 (1) the submodule is initialized and the necessary commit is there.
 (2) the submodule is initialized, but the necessary commit is missing.
 (3) the submodule is not even initialized (aka "the user is not
     interested in it"); there is only an empty directory.

I think it is perfectly fine not to say anything for (3) but I am unsure about the second case.

Previous: Lars HjemliNext: Lars Hjemli
Message 5 of 9 in “Enable in-process submodule traversal”
  1. 0/3 Enable in-process submodule traversalLars Hjemli, Jan 11, 2009
  2. 1/3 tree.c: add support for traversal of submodulesLars Hjemli, Jan 11, 2009
  3. 2/3 archive.c: enable traversal of submodulesLars Hjemli, Jan 11, 2009
  4. 3/3 builtin-ls-tree: enable traversal of submodulesLars Hjemli, Jan 11, 2009
  5. Junio C HamanoJan 12, 2009
  6. Lars HjemliJan 12, 2009
  7. Junio C HamanoJan 12, 2009
  8. Lars HjemliJan 12, 2009
  9. Junio C HamanoJan 12, 2009

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.