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

RE: [PATCH 6/6] rm: add absorb a submodules git dir before deletion

From
DTDavid Turner <david.turner@twosigma.com>
Date
Dec 13, 2016, 18:06 UTC
Message-ID
<15196def9a7f4458b053b2d1e182541c@exmbdft7.ad.twosigma.com>
In-Reply-To
<20161213014055.14268-7-sbeller@google.com>
Show 8 quoted lines
> -----Original Message-----
> From: Stefan Beller [mailto:sbeller@google.com]
> Sent: Monday, December 12, 2016 8:41 PM
> To: gitster@pobox.com
> Cc: git@vger.kernel.org; David Turner; bmwill@google.com; Stefan Beller
> Subject: [PATCH 6/6] rm: add absorb a submodules git dir before deletion
> 
> When deleting a submodule we need to keep the actual git directory around,
Nit: comma after submodule.
Show 22 quoted lines
> -					strbuf_reset(&buf);
> -					strbuf_addstr(&buf, path);
> -					if (!remove_dir_recursively(&buf, 0)) {
> -						removed = 1;
> -						if
> (!remove_path_from_gitmodules(path))
> -							gitmodules_modified = 1;
> -						strbuf_release(&buf);
> -						continue;
> -					} else if (!file_exists(path))
> -						/* Submodule was removed by user */
> -						if
> (!remove_path_from_gitmodules(path))
> -							gitmodules_modified = 1;
> +					if (file_exists(path))
> +						depopulate_submodule(path);
> +					removed = 1;
> +					if (!remove_path_from_gitmodules(path))
> +						gitmodules_modified = 1;
> +					continue;
>  					/* Fallthrough and let remove_path() fail.
> */
It seems odd to have a continue right before a comment that says "Fallthrough".  
Previous: Stefan BellerNext: Stefan Beller
Message 9 of 21 in “git-rm absorbs submodule git directory before deletion”
  1. 0/6 git-rm absorbs submodule git directory before deletionStefan Beller, Dec 13, 2016
  2. 2/6 submodule: modernize ok_to_remove_submodule to use argv_arrayStefan Beller, Dec 13, 2016
  3. 4/6 ok_to_remove_submodule: absorb the submodule git dirStefan Beller, Dec 13, 2016
  4. 1/6 submodule.h: add extern keyword to functionsStefan Beller, Dec 13, 2016
  5. 3/6 submodule: add flags to ok_to_remove_submoduleStefan Beller, Dec 13, 2016
  6. 6/6 rm: add absorb a submodules git dir before deletionStefan Beller, Dec 13, 2016
  7. brian m. carlsonDec 13, 2016
  8. Stefan BellerDec 13, 2016
  9. David TurnerDec 13, 2016
  10. 5/6 t3600: slightly modernize styleStefan Beller, Dec 13, 2016
  11. Junio C HamanoDec 13, 2016
  12. Stefan BellerDec 13, 2016
  13. Junio C HamanoDec 13, 2016
  14. Stefan BellerDec 13, 2016
  15. Junio C HamanoDec 13, 2016
  16. Stefan BellerDec 13, 2016
  17. Stefan BellerDec 13, 2016
  18. Junio C HamanoDec 13, 2016
  19. Stefan BellerDec 13, 2016
  20. Stefan BellerDec 13, 2016
  21. Junio C HamanoDec 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.