[PATCH 4/4] repository: delete ignore_env member

2018-02-26 Thread Nguyễn Thái Ngọc Duy
This variable was added because the repo_set_gitdir() was created to cover both submodule and main repos, but these two are initialized a bit differently so ignore_env == 0 means main repo, while ignore_env != 0 is submodules. Since the difference part (env variables) has been moved out of

[PATCH 3/4] sha1_file.c: move delayed getenv(altdb) back to setup_git_env()

2018-02-26 Thread Nguyễn Thái Ngọc Duy
getenv() is supposed to work on the main repository only. This delayed getenv() code in sha1_file.c makes it more difficult to convert sha1_file.c to a generic object store that could be used by both submodule and main repositories. Move the getenv() back in setup_git_env() where other env vars

[PATCH 2/4] repository.c: delete dead functions

2018-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- repository.c | 45 - 1 file changed, 45 deletions(-) diff --git a/repository.c b/repository.c index 70dc8dc661..be86da82cc 100644 --- a/repository.c +++ b/repository.c @@ -16,51 +16,6 @@

[PATCH 1/4] repository.c: move env-related setup code back to environment.c

2018-02-26 Thread Nguyễn Thái Ngọc Duy
It does not make sense that generic repository code contains handling of environment variables, which are specific for the main repository only. Refactor repo_set_gitdir() function to take $GIT_DIR and optionally _all_ other customizable paths. These optional paths can be NULL and will be

[PATCH 0/4] Delete ignore_env member in struct repository

2018-02-26 Thread Nguyễn Thái Ngọc Duy
It turns out I don't need my other series [1] in order to delete this field. This series moves getenv() calls from repo_set_gitdir()/repo_setup_env() and prepare_alt_odb() back in environment.c where they belong in my opinion. The repo_set_gitdir() now takes $GIT_DIR and optionally all other

Re: Use of uninitialised value of size 8 in sha1_name.c

2018-02-26 Thread Christian Couder
On Mon, Feb 26, 2018 at 10:53 AM, Jeff King wrote: > On Mon, Feb 26, 2018 at 10:04:22AM +0100, Christian Couder wrote: > >> ==21455== Use of uninitialised value of size 8 >> ==21455==at 0x2D2A73: get_hex_char_from_oid (sha1_name.c:492) >> ==21455==by 0x2D2AFE:

Re: What's cooking in git.git (Feb 2018, #03; Wed, 21)

2018-02-26 Thread Duy Nguyen
On Thu, Feb 22, 2018 at 7:31 AM, Junio C Hamano wrote: > * nd/worktree-move (2018-02-12) 7 commits > - worktree remove: allow it when $GIT_WORK_TREE is already gone > - worktree remove: new command > - worktree move: refuse to move worktrees with submodules > - worktree

Re: Use of uninitialised value of size 8 in sha1_name.c

2018-02-26 Thread Jeff King
On Mon, Feb 26, 2018 at 10:04:22AM +0100, Christian Couder wrote: > ==21455== Use of uninitialised value of size 8 > ==21455==at 0x2D2A73: get_hex_char_from_oid (sha1_name.c:492) > ==21455==by 0x2D2AFE: extend_abbrev_len (sha1_name.c:502) > ==21455==by 0x2D2C3D:

Re: [PATCHv4 01/27] repository: introduce raw object store field

2018-02-26 Thread Duy Nguyen
On Fri, Feb 23, 2018 at 04:47:28PM -0800, Stefan Beller wrote: > /* The main repository */ > static struct repository the_repo = { > - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, _index, > _algos[GIT_HASH_SHA1], 0, 0 > + NULL, NULL, > + RAW_OBJECT_STORE_INIT, > + NULL,

Use of uninitialised value of size 8 in sha1_name.c

2018-02-26 Thread Christian Couder
Hi Derrick, These days when running: ./t5616-partial-clone.sh --valgrind on master, I get a bunch of: ==21455== Use of uninitialised value of size 8 ==21455==at 0x2D2A73: get_hex_char_from_oid (sha1_name.c:492) ==21455==by 0x2D2AFE: extend_abbrev_len (sha1_name.c:502) ==21455==by

Re: [PATCH] strbuf_read_file(): preserve errno across close() call

2018-02-26 Thread Jeff King
On Fri, Feb 23, 2018 at 10:00:24PM +0100, René Scharfe wrote: > How about adding a stealthy close_no_errno(), or do something like the > following to get shorter and more readable code? (We could also keep > a single close() call, but would then set errno even on success.) > [...] > @@ -391,7

Re: [PATCH 08/27] pack: move approximate object count to object store

2018-02-26 Thread Jeff King
On Fri, Feb 23, 2018 at 02:22:14PM -0800, Stefan Beller wrote: > >> + /* > >> + * A fast, rough count of the number of objects in the repository. > >> + * These two fields are not meant for direct access. Use > >> + * approximate_object_count() instead. > >> + */ > >> +

<    1   2