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

Re: [PATCH] do not overwrite untracked symlinks

From
Clemens Buchacher <drizzd@aon.at>
Date
Feb 22, 2011, 19:26 UTC
Message-ID
<20110222192632.GB4881@localhost>
In-Reply-To
<7v62scftjl.fsf@alter.siamese.dyndns.org>
On Mon, Feb 21, 2011 at 10:54:38PM -0800, Junio C Hamano wrote:
Show 6 quoted lines
> 
> Yes, I agree with that reading.  I'd squash in this on top, first making
> sure that "do not overwrite untracked symlinks" (which is the title of
> this patch) won't be broken, and then the original test that wanted to
> make sure that checking out a/b/c/d when a/b is pointing to an unrelated
> part of the tree does not nuke whatever is pointed at that symbolic link.
Ok, perfect.
> My unhappiness with the undescriptive "check_leading_path()" still
> remains, though...

Ok. If I can't figure anything out this weekend, I'll rename it. Promise.

It's just that I'm even more unhappy about the actual code rather than the function name. And each time I look at it I end up trying to fix it, only to find out that it affects so many parts of the code that don't make any sense.

For example, we already have a function check_path() in entry.c, which does something very similar and is called by checkout_entry(), which in turn does something similar to verify_absent(). In fact, I suspect that both functions are called twice by the same code path around unpack_trees, for the same paths and for the same reason.

I strongly feel that we should separate the merge process into two steps.

 - First, do everything in the index, ignoring the work tree.
 - Second, checkout the index to the work tree while making sure no
   changes or untracked files get overwritten.

I know I have talked about this before, and I don't know if I will ever find the time to implement such a major change. But I can't get myself to feel good about fixing the function name, but not the function.

Clemens
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 14 in “untracked symlinks are less precious than untracked files?”
  1. Johannes SixtFeb 2, 2011
  2. Junio C HamanoFeb 2, 2011
  3. Johannes SixtFeb 2, 2011
  4. Demonstrate breakage: checkout overwrites untracked symlink with directoryJohannes Sixt, Feb 5, 2011
  5. Clemens BuchacherFeb 5, 2011
  6. Junio C HamanoFeb 9, 2011
  7. Clemens BuchacherFeb 10, 2011
  8. do not overwrite untracked symlinksClemens Buchacher, Feb 20, 2011
  9. Junio C HamanoFeb 21, 2011
  10. Clemens BuchacherFeb 21, 2011
  11. Junio C HamanoFeb 22, 2011
  12. Clemens BuchacherFeb 22, 2011
  13. Junio C HamanoFeb 22, 2011
  14. Johannes SixtFeb 15, 2011

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.