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

[PATCH v2 0/2] ns/tmp-objdir: add support for temporary writable databases

From
NGNeeraj K. Singh via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 6, 2021, 00:36 UTC
Message-ID
<pull.1091.v2.git.1638750965.gitgitgadget@gmail.com>
In-Reply-To
<pull.1091.git.1638585658.gitgitgadget@gmail.com>

V2 changes: I lost a couple changes in the shuffle while splitting these changes out

 * Make the will-destroy boolean a single bit field of type unsigned int so
   that it doesn't change twice in this small patch series.
 * Remove a the_repository reference in the disable ref updates code. Now
   the repository is taken from the ref_store.

New interface into the tmp-objdir API to help in-core use of the quarantine feature.

This patch series was formerly part of the ns/batched-fsync topic [1]. It's now split out into its own gitgitgadget PR and discussion thread since it is the base for en/remerge-diff as well.

The most recent feedback was in [2]. I removed printing from prune_subdir and simplified the strbuf handling in prune_tmp_file.

References: [1]
https://lore.kernel.org/git/pull.1076.v9.git.git.1637020263.gitgitgadget@gmail.com/
[2]
https://lore.kernel.org/git/CABPp-BH6m4q_EoX77bqLcpCN1HRfJ_XayeCV2O0sRybX53rPrw@mail.gmail.com/
Neeraj Singh (2):
  tmp-objdir: new API for creating temporary writable databases
  tmp-objdir: disable ref updates when replacing the primary odb
 builtin/prune.c        | 20 ++++++++++++---
 builtin/receive-pack.c |  2 +-
 environment.c          |  9 +++++++
 object-file.c          | 50 ++++++++++++++++++++++++++++++++++++--
 object-store.h         | 26 ++++++++++++++++++++
 object.c               |  2 +-
 refs.c                 |  2 +-
 repository.c           |  2 ++
 repository.h           |  1 +
 tmp-objdir.c           | 55 +++++++++++++++++++++++++++++++++++++++---
 tmp-objdir.h           | 29 +++++++++++++++++++---
 11 files changed, 183 insertions(+), 15 deletions(-)
base-commit: cd3e606211bb1cf8bc57f7d76bab98cc17a150bc
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1091%2Fneerajsi-msft%2Fns%2Ftmp-objdir-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1091/neerajsi-msft/ns/tmp-objdir-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1091
Range-diff vs v1:
 1:  4ae4303595e ! 1:  36c00613d9a tmp-objdir: new API for creating temporary writable databases
     @@ object-store.h: struct object_directory {
      +	/*
      +	 * This object store is ephemeral, so there is no need to fsync.
      +	 */
     -+	int will_destroy;
     ++	unsigned int will_destroy : 1;
      +
       	/*
       	 * Path to the alternative object store. If this is a relative path,
 2:  d8ae001500c ! 2:  f667cbcc47d tmp-objdir: disable ref updates when replacing the primary odb
     @@ object-store.h: struct object_directory {
       	/*
       	 * This object store is ephemeral, so there is no need to fsync.
       	 */
     --	int will_destroy;
     -+	unsigned int will_destroy : 1;
     - 
     - 	/*
     - 	 * Path to the alternative object store. If this is a relative path,
      
       ## refs.c ##
      @@ refs.c: int ref_transaction_prepare(struct ref_transaction *transaction,
     @@ refs.c: int ref_transaction_prepare(struct ref_transaction *transaction,
       	}
       
      -	if (getenv(GIT_QUARANTINE_ENVIRONMENT)) {
     -+	if (the_repository->objects->odb->disable_ref_updates) {
     ++	if (refs->repo->objects->odb->disable_ref_updates) {
       		strbuf_addstr(err,
       			      _("ref updates forbidden inside quarantine environment"));
       		return -1;
-- 
gitgitgadget
Previous: Neeraj SinghNext: Neeraj Singh via GitGitGadget
Message 8 of 18 in “ns/tmp-objdir: add support for temporary writable databases”
  1. 0/2 ns/tmp-objdir: add support for temporary writable databasesNeeraj K. Singh via GitGitGadget, Dec 4, 2021
  2. 1/2 tmp-objdir: new API for creating temporary writable databasesNeeraj Singh via GitGitGadget, Dec 4, 2021
  3. 2/2 tmp-objdir: disable ref updates when replacing the primary odbNeeraj Singh via GitGitGadget, Dec 4, 2021
  4. Junio C HamanoDec 5, 2021
  5. Neeraj SinghDec 5, 2021
  6. Junio C HamanoDec 5, 2021
  7. Neeraj SinghDec 6, 2021
  8. 0/2 ns/tmp-objdir: add support for temporary writable databasesNeeraj K. Singh via GitGitGadget, Dec 6, 2021
  9. 1/2 tmp-objdir: new API for creating temporary writable databasesNeeraj Singh via GitGitGadget, Dec 6, 2021
  10. Junio C HamanoDec 6, 2021
  11. Neeraj SinghDec 6, 2021
  12. Junio C HamanoDec 6, 2021
  13. 2/2 tmp-objdir: disable ref updates when replacing the primary odbNeeraj Singh via GitGitGadget, Dec 6, 2021
  14. Neeraj SinghDec 6, 2021
  15. 0/2 ns/tmp-objdir: add support for temporary writable databasesNeeraj K. Singh via GitGitGadget, Dec 6, 2021
  16. 1/2 tmp-objdir: new API for creating temporary writable databasesNeeraj Singh via GitGitGadget, Dec 6, 2021
  17. 2/2 tmp-objdir: disable ref updates when replacing the primary odbNeeraj Singh via GitGitGadget, Dec 6, 2021
  18. Elijah NewrenDec 8, 2021

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.