mailing list mirror (one of many)
 help / Atom feed
From: Nguyễn Thái Ngọc Duy  <>
Cc: Junio C Hamano <>,
	Michael Haggerty <>,
	Johannes Schindelin <>,,,
	Nguyễn Thái Ngọc Duy  <>
Subject: [PATCH/RFC 00/11] Remove submodule from files-backend.c
Date: Mon, 13 Feb 2017 22:20:00 +0700
Message-ID: <> (raw)

This is on top of mh/submodule-hash, it:

 - centralizes path manipulation around submodule, $GIT_DIR... in
   files-backend.c to a new function files_path() with the intention
   to make it easier to change later. files_path() is destined to

      strbuf_addbuf(&sb, refs->gitdir);
      strbuf_complete(&sb, '/');
      strbuf_vaddf(&sb, fmt, vap);

   but that can only be achieved once we get compound ref store.

 - removes git_path() and submodule_git_path() from files-backend.c. No
   more magic path translation as far as ref backend is concerned.

 - moves submodule path resolution code outside the backend.
   files-backend is now oblivious of submodules and in theory a
   submodule ref-store supports all operations (but I could be wrong,
   I didn't stare hard)

 - exposes get_submodule_ref_store() and get_main_ref_store() as public
   API. A new set of API around ref-store will be added. And
   get_worktree_ref_store() of course. The *_submodule() API might be
   removed, we'll see.

The problem with set_worktree_head_symref() (which peeks into another
gitdir) should be solved once we have get_worktree_ref_store(). That's
my next step.

Compound ref store will have to wait until I'm done with my
gc-in-worktree problem as I think I can live without it for now. I
think after compound ref store is in place, adding lmdb backend back
should be much cleaner because it does not care about either
submodules or worktrees.

Nguyễn Thái Ngọc Duy (11):
  refs-internal.c: make files_log_ref_write() static
  files-backend: convert git_path() to strbuf_git_path()
  files-backend: add files_path()
  files-backend: replace *git_path*() with files_path()
  refs.c: share is_per_worktree_ref() to files-backend.c
  refs-internal.h: correct is_per_worktree_ref()
  files-backend: remove the use of git_path()
  refs.c: factor submodule code out of get_ref_store()
  refs: move submodule code out of files-backend.c
  files-backend: remove submodule_allowed from files_downcast()
  refs: split and make get_*_ref_store() public API

 refs.c               | 125 ++++++++++++------
 refs.h               |  13 ++
 refs/files-backend.c | 350 ++++++++++++++++++++++++++++++---------------------
 refs/refs-internal.h |  28 ++---
 4 files changed, 316 insertions(+), 200 deletions(-)


                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:

 note: .onion URLs require Tor:
       or Tor2web:

AGPL code for this site: git clone public-inbox