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

[PATCHv2 0/5] git-rm absorbs submodule git directory before deletion

From
Stefan Beller <sbeller@google.com>
Date
Dec 13, 2016, 20:56 UTC
Message-ID
<20161213205622.841-1-sbeller@google.com>
v2:
* new base where to apply the patch:
  sb/submodule-embed-gitdir merged with sb/t3600-cleanup.
  I got merge conflicts and resolved them this way:
#@@@ -709,9 -687,10 +687,9 @@@ test_expect_success 'checking out a com
#          git commit -m "submodule removal" submod &&
#          git checkout HEAD^ &&
#          git submodule update &&
#-         git checkout -q HEAD^ 2>actual &&
#+         git checkout -q HEAD^ &&
#          git checkout -q master 2>actual &&
# -        echo "warning: unable to rmdir submod: Directory not empty" >expected &&
# -        test_i18ncmp expected actual &&
# +        test_i18ngrep "^warning: unable to rmdir submod:" actual &&
#          git status -s submod >actual &&
#          echo "?? submod/" >expected &&
#          test_cmp expected actual &&
#
* improved commit message in "ok_to_remove_submodule: absorb the submodule git dir"
  (David Turner offered me some advice on how to write better English off list)
* simplified code in last patch:
  -> dropped wrong comment for fallthrough
  -> moved redundant code out of both bodies of an if-clause.
* Fixed last patchs commit message to have "or_die" instead of or_dir.

v1: The "checkout --recurse-submodules" series got too large to comfortably send it out for review, so I had to break it up into smaller series'; this is the first subseries, but it makes sense on its own.

This series teaches git-rm to absorb the git directory of a submodule instead of failing and complaining about the git directory preventing deletion.

It applies on origin/sb/submodule-embed-gitdir.
Any feedback welcome!

Thanks, Stefan

Stefan Beller (5):
  submodule.h: add extern keyword to functions
  submodule: modernize ok_to_remove_submodule to use argv_array
  submodule: add flags to ok_to_remove_submodule
  ok_to_remove_submodule: absorb the submodule git dir
  rm: add absorb a submodules git dir before deletion
 builtin/rm.c  | 33 ++++++++-----------------
 cache.h       |  2 ++
 entry.c       |  5 ++++
 submodule.c   | 77 +++++++++++++++++++++++++++++++++++++++++++++++++----------
 submodule.h   | 64 ++++++++++++++++++++++++++++++-------------------
 t/t3600-rm.sh | 39 ++++++++++++------------------
 6 files changed, 135 insertions(+), 85 deletions(-)
-- 
2.11.0.rc2.35.g26e18c9
Next: Stefan Beller
Message 1 of 10 in “[PATCHv2 0/5] git-rm absorbs submodule git directory before deletion”
  1. Stefan BellerDec 13, 2016
  2. 1/5 submodule.h: add extern keyword to functionsStefan Beller, Dec 13, 2016
  3. 2/5 submodule: modernize ok_to_remove_submodule to use argv_arrayStefan Beller, Dec 13, 2016
  4. Junio C HamanoDec 14, 2016
  5. 4/5 ok_to_remove_submodule: absorb the submodule git dirStefan Beller, Dec 13, 2016
  6. Junio C HamanoDec 14, 2016
  7. Stefan BellerDec 14, 2016
  8. 5/5 rm: add absorb a submodules git dir before deletionStefan Beller, Dec 13, 2016
  9. Junio C HamanoDec 14, 2016
  10. 3/5 submodule: add flags to ok_to_remove_submoduleStefan Beller, Dec 13, 2016

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.