git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v3 0/7] Make submodules work if .gitmodules is not checked out
@ 2018-08-14 11:05 Antonio Ospite
  2018-08-14 11:05 ` [PATCH v3 1/7] submodule: add a print_config_from_gitmodules() helper Antonio Ospite
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Antonio Ospite @ 2018-08-14 11:05 UTC (permalink / raw)
  To: git
  Cc: Brandon Williams, Daniel Graña, Jonathan Nieder,
	Richard Hartmann, Stefan Beller, Antonio Ospite

Hi,

this series teaches git to try and read the .gitmodules file from the
current branch (HEAD:.gitmodules) when it's not readily available in the
working tree.

This can be used, along with sparse checkouts, to enable submodule usage
with programs like vcsh[1] which manage multiple repositories with their
working trees sharing the same path.

[1] https://github.com/RichiH/vcsh


This is v3 of the series from:
https://public-inbox.org/git/20180802134634.10300-1-ao2@ao2.it/

The cover letter of the first proposal contains more background:
https://public-inbox.org/git/20180514105823.8378-1-ao2@ao2.it/

Changes since v2:

  * Removed the extern keyword from the public declaration of
    print_config_from_gitmodules() and
    config_set_in_gitmodules_file_gently()

  * Used test_when_finished in t/t7411-submodule-config.sh and remove
    the problematic commits as soon as they are not needed anymore.

  * Restructured the code in module_config to avoid an unreachable
    section, the code now dies as a fallback if the arguments are not
    supported, as suggested by Jeff.

  * Dropped patches and tests about "submodule--helper config --stage"
    as they are not strictly needed for now and there is no immediate
    benefit from them.

  * Added a check to git-submodule.sh::cdm_add to make it fail earlier
    if the .gitmodules file is not "safely writeable". This also fixes
    one of the new tests which was previously marked as
    "test_expect_failure".

  * Fixed a broken &&-chain in a subshell in one of the new tests, the
    issue was exposed by a recent change in master.

  * Dropped a note about "git rm" and "git mv", it was intended as
    a personal reminder and not for the general public.

  * Squashed t7416-submodule-sparse-gitmodules.sh in the same commit of
    the code it exercises.

  * Dropped the two unrelated patches from v2:
    
      - dir: move is_empty_file() from builtin/am.c to dir.c and make it
        public
      - submodule: remove the .gitmodules file when it is empty

    as they are orthogonal to this series. I will send them as
    a standalone series.

  * Minor wording fixes here and there.


The series looks a lot cleaner and more to the point, thanks for the
review.

Ciao,
   Antonio

Antonio Ospite (7):
  submodule: add a print_config_from_gitmodules() helper
  submodule: factor out a config_set_in_gitmodules_file_gently function
  t7411: be nicer to future tests and really clean things up
  submodule--helper: add a new 'config' subcommand
  submodule: use the 'submodule--helper config' command
  t7506: clean up .gitmodules properly before setting up new scenario
  submodule: support reading .gitmodules even when it's not checked out

 builtin/submodule--helper.c            | 29 +++++++++
 cache.h                                |  1 +
 git-submodule.sh                       | 15 +++--
 new                                    |  0
 submodule-config.c                     | 53 ++++++++++++++-
 submodule-config.h                     |  3 +
 submodule.c                            | 10 +--
 t/t7411-submodule-config.sh            | 33 +++++++++-
 t/t7416-submodule-sparse-gitmodules.sh | 90 ++++++++++++++++++++++++++
 t/t7506-status-submodule.sh            |  3 +-
 10 files changed, 221 insertions(+), 16 deletions(-)
 create mode 100644 new
 create mode 100755 t/t7416-submodule-sparse-gitmodules.sh

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

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

end of thread, other threads:[~2018-08-23 11:48 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14 11:05 [PATCH v3 0/7] Make submodules work if .gitmodules is not checked out Antonio Ospite
2018-08-14 11:05 ` [PATCH v3 1/7] submodule: add a print_config_from_gitmodules() helper Antonio Ospite
2018-08-14 11:05 ` [PATCH v3 2/7] submodule: factor out a config_set_in_gitmodules_file_gently function Antonio Ospite
2018-08-14 11:05 ` [PATCH v3 3/7] t7411: be nicer to future tests and really clean things up Antonio Ospite
2018-08-14 17:06   ` Brandon Williams
2018-08-14 20:16   ` Junio C Hamano
2018-08-20 16:46     ` Antonio Ospite
2018-08-14 11:05 ` [PATCH v3 4/7] submodule--helper: add a new 'config' subcommand Antonio Ospite
2018-08-14 17:10   ` Brandon Williams
2018-08-20 16:50     ` Antonio Ospite
2018-08-14 11:05 ` [PATCH v3 5/7] submodule: use the 'submodule--helper config' command Antonio Ospite
2018-08-14 17:12   ` Brandon Williams
2018-08-14 11:05 ` [PATCH v3 6/7] t7506: clean up .gitmodules properly before setting up new scenario Antonio Ospite
2018-08-14 11:05 ` [PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out Antonio Ospite
2018-08-14 17:22   ` Brandon Williams
2018-08-14 20:36   ` Junio C Hamano
2018-08-20 21:37     ` Antonio Ospite
2018-08-22 11:51       ` Antonio Ospite
2018-08-22 15:29         ` Junio C Hamano
2018-08-23 11:48           ` Antonio Ospite

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).