git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFCv3 PATCH 00/14] Checkout aware of Submodules!
@ 2017-02-15  0:34 Stefan Beller
  2017-02-15  0:34 ` [PATCH 01/14] lib-submodule-update.sh: reorder create_lib_submodule_repo Stefan Beller
                   ` (15 more replies)
  0 siblings, 16 replies; 94+ messages in thread
From: Stefan Beller @ 2017-02-15  0:34 UTC (permalink / raw)
  Cc: git, bmwill, jrnieder, sandals, gitster, Stefan Beller

previous work:
https://public-inbox.org/git/20161203003022.29797-1-sbeller@google.com/

v3:
 * moved tests from t2013 to the generic submodule library.
 * factored out the refactoring patches to be up front
 * As I redid the complete implementation, I have the impression this time
   it is cleaner than previous versions.
 
 I think we still have to fix the corner cases of directory/file/submodule 
 conflicts before merging, but this serves as a status update on my current
 way of thinking how to implement the worktree commands being aware of
 submodules.
 
Thanks,
Stefan

v2:
* based on top of the series sent out an hour ago
  "[PATCHv4 0/5] submodule embedgitdirs"
* Try to embed a submodule if we need to remove it.
* Strictly do not change behavior if not giving the new flag.
* I think I missed some review comments from v1, but I'd like to get
  the current state out over the weekend, as a lot has changed so far.
  On Monday I'll go through the previous discussion with a comb to see
  if I missed something.
  
v1:
When working with submodules, nearly anytime after checking out
a different state of the projects, that has submodules changed
you'd run "git submodule update" with a current version of Git.

There are two problems with this approach:

* The "submodule update" command is dangerous as it
  doesn't check for work that may be lost in the submodule
  (e.g. a dangling commit).
* you may forget to run the command as checkout is supposed
  to do all the work for you.

Integrate updating the submodules into git checkout, with the same
safety promises that git-checkout has, i.e. not throw away data unless
asked to. This is done by first checking if the submodule is at the same
sha1 as it is recorded in the superproject. If there are changes we stop
proceeding the checkout just like it is when checking out a file that
has local changes.

The integration happens in the code that is also used in other commands
such that it will be easier in the future to make other commands aware
of submodule.

This also solves d/f conflicts in case you replace a file/directory
with a submodule or vice versa.

The patches are still a bit rough, but the overall series seems
promising enough to me that I want to put it out here.

Any review, specifically on the design level welcome!

Thanks,
Stefan


Stefan Beller (14):
  lib-submodule-update.sh: reorder create_lib_submodule_repo
  lib-submodule-update.sh: define tests for recursing into submodules
  make is_submodule_populated gently
  connect_work_tree_and_git_dir: safely create leading directories
  update submodules: add submodule config parsing
  update submodules: add a config option to determine if submodules are
    updated
  update submodules: introduce is_interesting_submodule
  update submodules: move up prepare_submodule_repo_env
  update submodules: add submodule_go_from_to
  unpack-trees: pass old oid to verify_clean_submodule
  unpack-trees: check if we can perform the operation for submodules
  read-cache: remove_marked_cache_entries to wipe selected submodules.
  entry.c: update submodules when interesting
  builtin/checkout: add --recurse-submodules switch

 Documentation/git-checkout.txt |   7 +
 builtin/checkout.c             |  28 +++
 builtin/grep.c                 |   2 +-
 dir.c                          |   2 +
 entry.c                        |  28 +++
 read-cache.c                   |   3 +
 submodule-config.c             |  22 ++
 submodule-config.h             |  17 +-
 submodule.c                    | 216 +++++++++++++++--
 submodule.h                    |  16 +-
 t/lib-submodule-update.sh      | 534 +++++++++++++++++++++++++++++++++++++++--
 t/t2013-checkout-submodule.sh  |   5 +
 unpack-trees.c                 | 115 +++++++--
 unpack-trees.h                 |   1 +
 14 files changed, 936 insertions(+), 60 deletions(-)

-- 
2.12.0.rc0.16.gd1691994b4.dirty


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

end of thread, other threads:[~2017-02-24 19:21 UTC | newest]

Thread overview: 94+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15  0:34 [RFCv3 PATCH 00/14] Checkout aware of Submodules! Stefan Beller
2017-02-15  0:34 ` [PATCH 01/14] lib-submodule-update.sh: reorder create_lib_submodule_repo Stefan Beller
2017-02-15  1:44   ` brian m. carlson
2017-02-15  0:34 ` [PATCH 02/14] lib-submodule-update.sh: define tests for recursing into submodules Stefan Beller
2017-02-15 16:51   ` Brandon Williams
2017-02-15 18:52     ` Stefan Beller
2017-02-15  0:34 ` [PATCH 03/14] make is_submodule_populated gently Stefan Beller
2017-02-15 18:10   ` Junio C Hamano
2017-02-15 22:42     ` Stefan Beller
2017-02-15  0:34 ` [PATCH 04/14] connect_work_tree_and_git_dir: safely create leading directories Stefan Beller
2017-02-15 18:22   ` Junio C Hamano
2017-02-15 22:52     ` Stefan Beller
2017-02-15 23:19       ` Junio C Hamano
2017-02-15  0:34 ` [PATCH 05/14] update submodules: add submodule config parsing Stefan Beller
2017-02-15 18:29   ` Junio C Hamano
2017-02-15  0:34 ` [PATCH 06/14] update submodules: add a config option to determine if submodules are updated Stefan Beller
2017-02-15  0:34 ` [PATCH 07/14] update submodules: introduce is_interesting_submodule Stefan Beller
2017-02-15 17:04   ` Brandon Williams
2017-02-15 18:46     ` Stefan Beller
2017-02-15  0:34 ` [PATCH 08/14] update submodules: move up prepare_submodule_repo_env Stefan Beller
2017-02-15  0:34 ` [PATCH 09/14] update submodules: add submodule_go_from_to Stefan Beller
2017-02-15  2:06   ` brian m. carlson
2017-02-15  0:34 ` [PATCH 10/14] unpack-trees: pass old oid to verify_clean_submodule Stefan Beller
2017-02-15  0:34 ` [PATCH 11/14] unpack-trees: check if we can perform the operation for submodules Stefan Beller
2017-02-15  0:34 ` [PATCH 12/14] read-cache: remove_marked_cache_entries to wipe selected submodules Stefan Beller
2017-02-15  0:34 ` [PATCH 13/14] entry.c: update submodules when interesting Stefan Beller
2017-02-15  0:34 ` [PATCH 14/14] builtin/checkout: add --recurse-submodules switch Stefan Beller
2017-02-15  2:08   ` brian m. carlson
2017-02-16  0:33     ` Stefan Beller
2017-02-15  2:13 ` [RFCv3 PATCH 00/14] Checkout aware of Submodules! brian m. carlson
2017-02-15 18:34 ` Junio C Hamano
2017-02-16  0:37   ` [RFCv4 " Stefan Beller
2017-02-16  0:37     ` [PATCH 01/15] lib-submodule-update.sh: reorder create_lib_submodule_repo Stefan Beller
2017-02-16  0:37     ` [PATCH 02/15] lib-submodule-update.sh: do not use ./. as submodule remote Stefan Beller
2017-02-16  0:37     ` [PATCH 03/15] lib-submodule-update.sh: define tests for recursing into submodules Stefan Beller
2017-02-16 20:39       ` Junio C Hamano
2017-02-22 18:43         ` Stefan Beller
2017-02-16  0:38     ` [PATCH 04/15] make is_submodule_populated gently Stefan Beller
2017-02-16  0:38     ` [PATCH 05/15] connect_work_tree_and_git_dir: safely create leading directories Stefan Beller
2017-02-16 20:54       ` Junio C Hamano
2017-02-16 21:16         ` Stefan Beller
2017-02-16 21:25           ` Junio C Hamano
2017-02-16  0:38     ` [PATCH 06/15] update submodules: add submodule config parsing Stefan Beller
2017-02-17 18:24       ` Jacob Keller
2017-02-21 19:42         ` Stefan Beller
2017-02-21 20:48           ` Jacob Keller
2017-02-16  0:38     ` [PATCH 07/15] update submodules: add a config option to determine if submodules are updated Stefan Beller
2017-02-16  0:38     ` [PATCH 08/15] submodules: introduce check to see whether to touch a submodule Stefan Beller
2017-02-16 21:02       ` Junio C Hamano
2017-02-16 22:34       ` Jacob Keller
2017-02-17 18:36       ` Jacob Keller
2017-02-21 20:56         ` Stefan Beller
2017-02-16  0:38     ` [PATCH 09/15] update submodules: move up prepare_submodule_repo_env Stefan Beller
2017-02-16  0:38     ` [PATCH 10/15] update submodules: add submodule_go_from_to Stefan Beller
2017-02-16 21:15       ` Junio C Hamano
2017-02-16 21:33         ` Stefan Beller
2017-02-16  0:38     ` [PATCH 11/15] unpack-trees: pass old oid to verify_clean_submodule Stefan Beller
2017-02-16 21:19       ` Junio C Hamano
2017-02-16  0:38     ` [PATCH 12/15] unpack-trees: check if we can perform the operation for submodules Stefan Beller
2017-02-16 18:01       ` Brandon Williams
2017-02-16 21:23       ` Junio C Hamano
2017-02-17 18:42       ` Jacob Keller
2017-02-21 22:16         ` Stefan Beller
2017-02-21 23:35           ` Jacob Keller
2017-02-21 23:44             ` Stefan Beller
2017-02-22  0:31               ` Jacob Keller
2017-02-16  0:38     ` [PATCH 13/15] read-cache: remove_marked_cache_entries to wipe selected submodules Stefan Beller
2017-02-16 21:32       ` Junio C Hamano
2017-02-16  0:38     ` [PATCH 14/15] entry.c: update submodules when interesting Stefan Beller
2017-02-16  0:38     ` [PATCH 15/15] builtin/checkout: add --recurse-submodules switch Stefan Beller
2017-02-16 22:00     ` [RFCv4 PATCH 00/14] Checkout aware of Submodules! Junio C Hamano
2017-02-16 22:54       ` Jacob Keller
2017-02-16 22:56         ` Stefan Beller
2017-02-16 23:27           ` Jacob Keller
2017-02-23 22:57       ` [RFCv5 " Stefan Beller
2017-02-23 22:57         ` [PATCH 01/15] lib-submodule-update.sh: reorder create_lib_submodule_repo Stefan Beller
2017-02-23 22:57         ` [PATCH 02/15] lib-submodule-update.sh: do not use ./. as submodule remote Stefan Beller
2017-02-23 22:57         ` [PATCH 03/15] lib-submodule-update.sh: define tests for recursing into submodules Stefan Beller
2017-02-23 22:57         ` [PATCH 04/15] make is_submodule_populated gently Stefan Beller
2017-02-23 22:57         ` [PATCH 05/15] connect_work_tree_and_git_dir: safely create leading directories Stefan Beller
2017-02-23 22:57         ` [PATCH 06/15] update submodules: add submodule config parsing Stefan Beller
2017-02-23 22:57         ` [PATCH 07/15] update submodules: add a config option to determine if submodules are updated Stefan Beller
2017-02-23 22:57         ` [PATCH 08/15] submodules: introduce check to see whether to touch a submodule Stefan Beller
2017-02-23 22:57         ` [PATCH 09/15] update submodules: move up prepare_submodule_repo_env Stefan Beller
2017-02-23 22:57         ` [PATCH 10/15] update submodules: add submodule_move_head Stefan Beller
2017-02-24  1:21           ` Ramsay Jones
2017-02-24 19:08             ` Stefan Beller
2017-02-23 22:57         ` [PATCH 11/15] unpack-trees: pass old oid to verify_clean_submodule Stefan Beller
2017-02-23 22:57         ` [PATCH 12/15] unpack-trees: check if we can perform the operation for submodules Stefan Beller
2017-02-23 22:57         ` [PATCH 13/15] read-cache, remove_marked_cache_entries: wipe selected submodules Stefan Beller
2017-02-23 22:57         ` [PATCH 14/15] entry.c: update submodules when interesting Stefan Beller
2017-02-23 22:57         ` [PATCH 15/15] builtin/checkout: add --recurse-submodules switch Stefan Beller
2017-02-24  1:25           ` Ramsay Jones
2017-02-24 19:20             ` Stefan Beller

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).