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

Re: git rebase chokes on directory -> symlink -> directory

From
Junio C Hamano <junkio@cox.net>
Date
May 11, 2007, 17:28 UTC
Message-ID
<7vfy63b789.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<alpine.LFD.0.98.0705110835230.3986@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> That said, wouldn't it potentially be quite easy in "unpack_trees_rec()" 
> to just notice when all the trees are identical, and just not recurse at 
> all in that case (or - alternatively - recurse, but on entry, just exit 
> quickly?)

In the threeway case, it should be able to notice that the trees of the ancestor and the other match, which is the only case we can safely say that the result will be our tree (aka HEAD) and we won't mess with the index nor worry about local modifications made only to the working tree. The case in which all trees match, regardless of the number of trees involved, should work the same way.

However, in the threeway case, we still need to make sure that the index matches the HEAD even when we know the result will be taken from HEAD, as otherwise we would end up including the local "git add" made earlier in the merge result. We need to make sure the index matches HEAD for such a subdirectory in that case before skipping it.

What is troublesome is that kind of policy logic is not supposed to happen in unpack_trees_rec() in the current code structure; instead, that decision is to be made by o->fn().

So, I am not sure if it is that quite easy.
Previous: Linus TorvaldsNext: Junio C Hamano
Message 13 of 17 in “git rebase chokes on directory -> symlink -> directory”
  1. H. Peter AnvinMay 8, 2007
  2. Alex RiesenMay 8, 2007
  3. H. Peter AnvinMay 9, 2007
  4. Alex RiesenMay 9, 2007
  5. H. Peter AnvinMay 9, 2007
  6. Alex RiesenMay 9, 2007
  7. H. Peter AnvinMay 9, 2007
  8. Junio C HamanoMay 10, 2007
  9. Johannes SixtMay 10, 2007
  10. Shawn O. PearceMay 10, 2007
  11. Junio C HamanoMay 11, 2007
  12. Linus TorvaldsMay 11, 2007
  13. Junio C HamanoMay 11, 2007
  14. apply: do not get confused by symlinks in the middleJunio C Hamano, May 11, 2007
  15. Junio C HamanoMay 12, 2007
  16. H. Peter AnvinMay 12, 2007
  17. Junio C HamanoMay 14, 2007

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.