Hacker News new | ask | show | jobs
by froh 15 days ago
TIL, thx :-)

somewhat related Q:

how do you give two files the same ancestor? so git log will for each show the history to the beginnings of the originally unsplit file? useful for splitting large files.

1 comments

That's not possible, because files don't have ancestors in git. Each commit's tree is tracked independently and copy/move is just something that's detected via heuristics.
I meanwhile understood that you can commit a copy of a file and then edit both, and then the ancestry tracking options to git log resolve the two split parts ancestry just fine.
But those heuristics could be better than they are now so that a git log <file> will show the shared history for both copies.