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

Re: [PATCH 3/4] submodule--helper list: lose the extra prefix option

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2016, 18:32 UTC
Message-ID
<xmqqshze2ysx.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kZ=de7jh7b2OnTuEoTUSJKhoNkjb+Mw41JP7w9SVWH3iA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 5 quoted lines
> Exactly, sorry for not writing my chain of thoughts down completely.
>
> To make them reusable, I'd assume we want them to be easy to
> understand, and by using a well known way in git it is easier to
> understand.

I already said I do not care too deeply either way, but I have to point out that "git -C $prefix" would put extra cognitive burden on those who will be picking it up where you left off. When they start by first literally translating shell to C, "git -C" would mislead them to think if they have to chdir(2) to the directory first, which is not the case at all. "git -C $prefix submodule--helper" in the code after [3/4] is there only because submodule--helper code no longer is told what the caller already knows (i.e. what is the prefix) and is forced to find it out by itself. Contrasting to that, with an explicit --prefix option, the reader would know there is no need to chdir(2) anywhere at that point, but the paths that are held in variables it uses from the surrounding code are not relative to the current working directory when the code is called and $prefix is there to help adjusting it.

The reason I do not care too deeply was that I thought people who will be taking over after you are done (well, after all that might include you; plans would change) are clueful, but there is no need for us to make their life more difficult than necessary.

Previous: Stefan BellerNext: Stefan Beller
Message 20 of 23 in “[PATCHv2 0/4] submodule helper: cleanup prefix passing”
  1. Stefan BellerMar 24, 2016
  2. 1/4 submodule: fix recursive path printing from non root directoryStefan Beller, Mar 24, 2016
  3. Jacob KellerMar 24, 2016
  4. Stefan BellerMar 24, 2016
  5. Junio C HamanoMar 25, 2016
  6. Stefan BellerMar 25, 2016
  7. 2/4 submodule: fix recursive execution from non root directoryStefan Beller, Mar 24, 2016
  8. Jacob KellerMar 24, 2016
  9. Junio C HamanoMar 25, 2016
  10. Stefan BellerMar 25, 2016
  11. 3/4 submodule--helper list: lose the extra prefix optionStefan Beller, Mar 24, 2016
  12. Jacob KellerMar 24, 2016
  13. Junio C HamanoMar 25, 2016
  14. Junio C HamanoMar 25, 2016
  15. Junio C HamanoMar 25, 2016
  16. Stefan BellerMar 25, 2016
  17. Stefan BellerMar 25, 2016
  18. Junio C HamanoMar 25, 2016
  19. Stefan BellerMar 25, 2016
  20. Junio C HamanoMar 25, 2016
  21. 4/4 submodule: add more tests for recursive submodule behaviorStefan Beller, Mar 24, 2016
  22. Eric SunshineMar 25, 2016
  23. Stefan BellerMar 25, 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.