librelist archives

« back to archive

[libgit2] Thoughts about MAX_GITDIR_TREE_STRUCTURE_PATH_LENGTH

[libgit2] Thoughts about MAX_GITDIR_TREE_STRUCTURE_PATH_LENGTH

From:
Emeric Fermas
Date:
2010-12-20 @ 10:28
Hello,

MAX_GITDIR_TREE_STRUCTURE_PATH_LENGTH is a local constant which is
supposed to guard against creation of a too nested Git repository.
It's declared in repo_init_find_dir() in 'repository.c'.

Its current definition is 66. Which basically means ... nothing.

Below are some possible path samples:
objects\0a\aa6e39fbba3a71e86732271e39a9234ebec766
refs\heads\repo-lookup-leak
refs\remotes\nulltoken\repo-lookup-leak
refs\tags\v0.2.0
logs\refs\heads\repo-lookup-leak
hooks\prepare-commit-msg.sample

Current longest one is 49 chars wide. However, as name of branches,
remotes and hooks are quite hard to predict, I can't figure what
should be the correct value of this constant.

-Should we declare it with a value of 100 ? more ?
-Should we add a comment in order to help future troubleshooting ?

Cheers,
Em.