Skip to content

git move cannot move remote commit as expected #1454

Answered by arxanas
HAOCHENYE asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @HAOCHENYE, thanks for asking. It'll be good to document this a little more clearly in case others encounter the same issue. This isn't a bug, exactly, but a deliberate limitation in the design. It's a tricky issue from a conceptual and practical perspective, and results in suboptimal UX in some cases.

Design

Recall that, in the Git object model, each commit points to its parents, and there are no edges in the opposite direction (from parent to child). Therefore, to find the children/descendants of a given commit, it means we need to start at every possible leaf node (Git ref) and traverse+index all the ancestors. (This matches the diagrams you drew with the parent pointers.)

For perfo…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by HAOCHENYE
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working question Further information is requested wontfix This will not be worked on has-workaround
2 participants
Converted from issue

This discussion was converted from issue #1452 on November 25, 2024 19:00.