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

Re: Submodule/contents conflict

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 28, 2017, 02:08 UTC
Message-ID
<xmqq37ctmgh6.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<DAB03BFCBBCA4C4F95D21A86E3B1DF2F@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 5 quoted lines
>> In the modern day, it might be useful if the "--working-tree-only"
>> mode added a new file as an intent-to-add entry to the index, but
>> that is not what "git apply (no other options)" (which is the gold
>
> did you mean `git add` ? Or am I missing something.

I did mean "git apply" that applies the patch (0) only to the working tree by default, (1) to the index without touching the working tree with the "--cached" option and (2) both to the working tree and the index with the "--index" option. As "git add" is all about the index, having these three modes wouldn't make much sense there.

Show 10 quoted lines
>> +'git checkout' --working-tree-only <tree-ish> [--] <pathspec>...::
>> + Similar to `git checkout <tree-ish> [--] <pathspec>`, but
>> + the index file is left in the same state as it was before
>> + running this command.
>
> I feel that the docs should also contain a little of the commit
> message highlighting that `This complements the usual convention of
> "--cached" and "--index" options for other commands.`, and would pick
> up on Stefan's "I didn't know that" response - A little education of
> the reader goes a long way, maybe ;-)

I do not think "If we were building Git from scratch today without having any existing user of `git checkout`, we probably would have made this to be the default mode of operation, and instead required the user to say `git checkout --index <tree-ish> <pathspec>' if the user wants checkout to affect both the index and the working tree, to be more consistent with other parts of the system" would help the readers of the current system very much, even if we were promising that such a more consistent system may come in a future (and we are not, at least not yet, with this addition).

Previous: Philip OakleyNext: Junio C Hamano
Message 16 of 18 in “Submodule/contents conflict”
  1. Orgad ShanehApr 24, 2017
  2. Stefan BellerApr 24, 2017
  3. Philip OakleyApr 24, 2017
  4. Stefan BellerApr 24, 2017
  5. Jeff KingApr 25, 2017
  6. Jeff KingApr 25, 2017
  7. Philip OakleyApr 27, 2017
  8. Jeff KingApr 28, 2017
  9. Junio C HamanoMay 1, 2017
  10. Philip OakleyApr 25, 2017
  11. Junio C HamanoApr 26, 2017
  12. Stefan BellerApr 26, 2017
  13. Junio C HamanoApr 27, 2017
  14. Junio C HamanoApr 27, 2017
  15. Philip OakleyApr 27, 2017
  16. Junio C HamanoApr 28, 2017
  17. Junio C HamanoApr 25, 2017
  18. Stefan BellerApr 25, 2017

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.