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

Re: [PATCH v1 2/2] submodule: port submodule subcommand 'deinit' from shell to C

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2018, 21:47 UTC
Message-ID
<xmqqo9m1z8rf.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAME+mvXaL4AcK1ib2rDZKdH0eLc7te+3e9zYv8pNqNj-4cyT3Q@mail.gmail.com>
Prathamesh Chavan <pc44800@gmail.com> writes:
Show 6 quoted lines
> Thanks for pointing out that we can introduce the flag REMOVE_DIR_KEEP_TOPLEVEL
> which solves the issue. And for the case where no directory exists: we
> create an empty
> directory.Since this won't be similar to what happens in the shell
> script, this change
> can be included in a saperate patch as an imporvement.

Exactly. The way the shell script does it is to _always_ honor user's umask and recreate the directory, so before that separate improvement, tweaking "mode" based on the returned value from an extra lstat() is an unneeded change of behaviour. Just passing 0777 and let mkdir() take the umask into account to come up with the final permission bits is more in line with the original scripted version, I would think.

Thanks.
Previous: Prathamesh ChavanNext: Stefan Beller
Message 7 of 19 in “Incremental rewrite of git-submodules”
  1. 0/2 Incremental rewrite of git-submodulesPrathamesh Chavan, Jan 9, 2018
  2. 1/2 submodule: port submodule subcommand 'sync' from shell to CPrathamesh Chavan, Jan 9, 2018
  3. Junio C HamanoJan 9, 2018
  4. 2/2 submodule: port submodule subcommand 'deinit' from shell to CPrathamesh Chavan, Jan 9, 2018
  5. Junio C HamanoJan 9, 2018
  6. Prathamesh ChavanJan 10, 2018
  7. Junio C HamanoJan 10, 2018
  8. Stefan BellerJan 9, 2018
  9. Brandon WilliamsJan 9, 2018
  10. 0/2 Incremental rewrite of git-submodulesPrathamesh Chavan, Jan 11, 2018
  11. 2/2 submodule: port submodule subcommand 'deinit' from shell to CPrathamesh Chavan, Jan 11, 2018
  12. Junio C HamanoJan 11, 2018
  13. 1/2 submodule: port submodule subcommand 'sync' from shell to CPrathamesh Chavan, Jan 11, 2018
  14. Junio C HamanoJan 11, 2018
  15. Junio C HamanoJan 11, 2018
  16. 0/2 Incremental rewrite of git-submodulesPrathamesh Chavan, Jan 14, 2018
  17. 1/2 submodule: port submodule subcommand 'sync' from shell to CPrathamesh Chavan, Jan 14, 2018
  18. 2/2 submodule: port submodule subcommand 'deinit' from shell to CPrathamesh Chavan, Jan 14, 2018
  19. Junio C HamanoJan 16, 2018

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.