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

Re: Submodule/contents conflict

From
Philip Oakley <philipoakley@iee.org>
Date
Apr 25, 2017, 11:10 UTC
Message-ID
<C3A8A88B8DDD468095B7FD256330EEF7@PhilipOakley>
In-Reply-To
<CAGZ79kZDzuSHw4siSkiekw73bBq9R8gg_R+a7NyNUG6bYxc2Og@mail.gmail.com>
From: "Stefan Beller" <sbeller@google.com>
Show 33 quoted lines
> On Mon, Apr 24, 2017 at 4:33 PM, Philip Oakley <philipoakley@iee.org> 
> wrote:
>
>> This is almost the same as just reported by 'vvs' [1]
>> https://public-inbox.org/git/CAM1zWBtfgHT=pT0pidQo1HD=DfrXLG3gNaUvs0vZKvYfG1BHFw@mail.gmail.com/,
>> originally on the 'git user' list
>> https://groups.google.com/forum/?hl=en#!topic/git-users/9ziZ6yq-BfU
>
> For this issue, +cc Jeff King due to this pointer:
>
>>> On the main list thare is a similar "issue" [1] regarding the 
>>> expectation for `git checkout`,
>>> and importantly (for me) these collected views regarding the "Git Data 
>>> Protection and
>>> Management Principles" is not within the Git documentation.
>>
>> Yes, that's an interesting point. What concerns me is that the commit
>> c5326bd62b7e168ba1339dacb7ee812d0fe98c7c which introduced this
>> into checkout isn't consistent with reset. Seems that nobody noticed this 
>> before.
>
> It seems as if we'd want to see the code from
> c5326bd62b7e168ba1339dacb7ee812d0fe98c7c
> to be part of any worktree touching command, specifically reset?
>
>> It also has a similarity to
>> https://public-inbox.org/git/1492287435.14812.2.camel@gmail.com/ 
>> regarding
>> how checkout operates.
>
> This seems to be orthogonal to the original topic (no submodules, nor 
> checkout
> bugs, just a doc update?)

At the moment that topic has ended up as an attempt at a documentation update, but I think it may not succeed ynless there is clarity about the (reported) underlying problem.

As I recall Christoph was using checkout to copy a file (e.g. a template file) from an older commit/revision into his worktree, and was suprised that this (git checkout <tree> <path>) also _staged_ the file, rather than simply letting it be in a modified/untracked state.

It in a sense is the same issue of relating the worktree content to the index status, though I think that checkout is acting as designed/intended. I don't think that there is a command (is ther?) to do what Christoph hoped for of not staging the new content (e.g. a template file), but the index knowing/remembering its stat details, just in case.

The submodule case appears to be more about deciding if the content of submodule's index should be considered for inclusion in the super project prior to the checkout of the other branch's tree that is already unchanged and in-place.

Show 8 quoted lines
>
>
>> It does feel as if there are two slightly different optimisations that 
>> could
>> be used when the desired file pre-exists in the worktree, but isn't
>> immediately known to the index.
>>
>

-- Philip

Previous: Junio C HamanoNext: Junio C Hamano
Message 10 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.