]> git.ipfire.org Git - thirdparty/git.git/commit - Makefile
repository: introduce the repository object
authorBrandon Williams <bmwill@google.com>
Thu, 22 Jun 2017 18:43:32 +0000 (11:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 24 Jun 2017 01:24:34 +0000 (18:24 -0700)
commit359efeffc1f16443be18a80b91ba7cd356eb34f1
treef8cecc22fbe18c585c51f637f6113daf8d742f42
parentbf08c8cfc1cff6aa4377efad8bdc166106b3a4d5
repository: introduce the repository object

Introduce the repository object 'struct repository' which can be used to
hold all state pertaining to a git repository.

Some of the benefits of object-ifying a repository are:

  1. Make the code base more readable and easier to reason about.

  2. Allow for working on multiple repositories, specifically
     submodules, within the same process.  Currently the process for
     working on a submodule involves setting up an argv_array of options
     for a particular command and then launching a child process to
     execute the command in the context of the submodule.  This is
     clunky and can require lots of little hacks in order to ensure
     correctness.  Ideally it would be nice to simply pass a repository
     and an options struct to a command.

  3. Eliminating reliance on global state will make it easier to
     enable the use of threading to improve performance.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
repository.c [new file with mode: 0644]
repository.h [new file with mode: 0644]