git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv6 0/7] submodule embedgitdirs
@ 2016-12-08  1:46 Stefan Beller
  2016-12-08  1:46 ` [PATCHv6 1/7] submodule: use absolute path for computing relative path connecting Stefan Beller
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Stefan Beller @ 2016-12-08  1:46 UTC (permalink / raw)
  To: bmwill; +Cc: git, pclouds, gitster, Stefan Beller

v6:
 * renamed embedgitdirs to absorbgitdirs embedding may be interpreted as
   embedding the git dir into the working directory, whereas absorbing sounds
   more like the submodule is absorbed by the superproject, making the
   submodule less independent
 * Worktrees API offer uses_worktrees(void) and submodule_uses_worktree(path).
 * moved the printing to stderr and one layer up (out of the pure
   relocate_git_dir function).
 * connect_... is in dir.h now.

v5:
* Add another layer of abstraction, i.e. the relocate_git_dir is only about
  moving a git dir of one repository. The submodule specific stuff (e.g.
  recursion into nested submodules) is in submodule.{c,h}

  This was motivated by reviews on the series of checkout aware of submodules
  building on top of this series, as we want to directly call the embed-git-dirs
  function without the overhead of spawning a child process.

v4:
* rebuilt on top of nd/worktree-list-fixup
* fix and test behavior for un-init submodules (don't crash, rather do nothing)
* incorporated a "static" as pointed out by Ramsay
* use internal functions instead of duplicating code in worktree.c
  (use get_common_dir_noenv for the submodule to actually get the common dir)
* fixed a memory leak in relocate_gitdir

v3:
* have a slightly more generic function "relocate_gitdir".
  The recursion is strictly related to submodules, though.
* bail out if a submodule is using worktrees.
  This also lays the groundwork for later doing the proper thing,
  as worktree.h offers a function `get_submodule_worktrees(path)`
* nit by duy: use git_path instead of git_common_dir

v2:
* fixed commit message for patch:
 "submodule: use absolute path for computing relative path connecting"
* a new patch "submodule helper: support super prefix"
* redid the final patch with more tests and fixing bugs along the way
* "test-lib-functions.sh: teach test_commit -C <dir>" unchanged

v1:
The discussion of the submodule checkout series revealed to me that a command
is needed to move the git directory from the submodules working tree to be
embedded into the superprojects git directory.

So I wrote the code to intern the submodules git dir into the superproject,
but whilst writing the code I realized this could be valueable for our use
in testing too. So I exposed it via the submodule--helper. But as the
submodule helper ought to be just an internal API, we could also
offer it via the proper submodule command.

The command as it is has little value to the end user for now, but
breaking it out of the submodule checkout series hopefully makes review easier.

Thanks,
Stefan

Stefan Beller (7):
  submodule: use absolute path for computing relative path connecting
  submodule helper: support super prefix
  test-lib-functions.sh: teach test_commit -C <dir>
  worktree: get worktrees from submodules
  worktree: add function to check if worktrees are in use
  move connect_work_tree_and_git_dir to dir.h
  submodule: add absorb-git-dir function

 Documentation/git-submodule.txt    |  15 +++++
 builtin/submodule--helper.c        |  69 ++++++++++++++++----
 dir.c                              |  38 +++++++++++
 dir.h                              |   4 ++
 git-submodule.sh                   |   7 +-
 git.c                              |   2 +-
 submodule.c                        | 127 ++++++++++++++++++++++++++++++-------
 submodule.h                        |   5 +-
 t/t7412-submodule-absorbgitdirs.sh | 101 +++++++++++++++++++++++++++++
 t/test-lib-functions.sh            |  20 ++++--
 worktree.c                         |  70 +++++++++++++++++---
 worktree.h                         |  13 ++++
 12 files changed, 418 insertions(+), 53 deletions(-)
 create mode 100755 t/t7412-submodule-absorbgitdirs.sh

-- 
2.11.0.rc2.30.gc512cbd.dirty


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-12-09 23:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-08  1:46 [PATCHv6 0/7] submodule embedgitdirs Stefan Beller
2016-12-08  1:46 ` [PATCHv6 1/7] submodule: use absolute path for computing relative path connecting Stefan Beller
2016-12-08  9:45   ` Duy Nguyen
2016-12-08  1:46 ` [PATCHv6 2/7] submodule helper: support super prefix Stefan Beller
2016-12-08  9:52   ` Duy Nguyen
2016-12-08 20:19     ` Stefan Beller
2016-12-08  1:46 ` [PATCHv6 3/7] test-lib-functions.sh: teach test_commit -C <dir> Stefan Beller
2016-12-08  1:46 ` [PATCHv6 4/7] worktree: get worktrees from submodules Stefan Beller
2016-12-08 10:09   ` Duy Nguyen
2016-12-08 18:55     ` Stefan Beller
2016-12-09 12:46       ` Duy Nguyen
2016-12-09 23:00       ` Brandon Williams
2016-12-09 23:10         ` Stefan Beller
2016-12-08  1:46 ` [PATCHv6 5/7] worktree: add function to check if worktrees are in use Stefan Beller
2016-12-08 10:40   ` Duy Nguyen
2016-12-08 10:51     ` Duy Nguyen
2016-12-08 19:32       ` Stefan Beller
2016-12-08  1:46 ` [PATCHv6 6/7] move connect_work_tree_and_git_dir to dir.h Stefan Beller
2016-12-08  1:46 ` [PATCHv6 7/7] submodule: add absorb-git-dir function Stefan Beller
2016-12-08 10:56   ` Duy Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).