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

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2015, 21:34 UTC
Message-ID
<xmqq4mmam0sq.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CACsJy8A5ikjGmj+ysTUt9FFi9X0WzVXvnFSVbmFoe8rzHdNNoA@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> I think we should stop the ok-to-replace feature when submodules are
> involved, we consider submdules much more valuable than symlinks.

Hmm, I am not sure "valuable" is a good criterion to decide what should happen, though.

The push to use ".git" that is a file pointing at a repository that is safely stored away is a move to make valuable submodule more easily removable from the working tree without losing information, so that we can remove it from the working tree when the user instructs us to, just like we can remove a symlink safely without losing information. The only thing we need to be careful is that that the path that corresponds to the index entry is not "dirty". That is, for a symlink, if you make it point at something different without doing "git add" it, you would lose that working-tree-only change when we "kill" that symbolic link in order to replace it with a regular directory. For a submodule, if you have uncommitted changes in the submodule working tree, you would lose that the same way when we "kill" that submodule in order to replace that directory as part of the superproject's working tree.

There may need some more safety implemented (i.e. how we detect the "dirty"-ness and when we stop the operation based on that), but I would imagine there is nothing fundamentally special about submodule that does not apply to a symlink or a normal blob.

Previous: Duy Nguyen
Message 15 of 15 in “assert failed in submodule edge case”
  1. Dennis KaarsemakerApr 13, 2015
  2. Dennis KaarsemakerApr 13, 2015
  3. Jens LehmannApr 16, 2015
  4. pathspec: adjust prefixlen after striping trailing slashNguyễn Thái Ngọc Duy, Apr 18, 2015
  5. Jens LehmannApr 19, 2015
  6. Duy NguyenApr 20, 2015
  7. Junio C HamanoApr 20, 2015
  8. Duy NguyenApr 20, 2015
  9. Junio C HamanoApr 21, 2015
  10. Jens LehmannApr 22, 2015
  11. Junio C HamanoApr 22, 2015
  12. Jens LehmannApr 22, 2015
  13. Junio C HamanoApr 23, 2015
  14. Duy NguyenJun 14, 2015
  15. Junio C HamanoJun 14, 2015

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.