Hacker News new | past | comments | ask | show | jobs | submit login

git forgets nothing. A branch is just a reference to a commit, that reference goes nowhere unless you delete it



Not GP.

I may be wrong here, but I would argue that git does forget something: it forgets where the branch reference used to point when a new commit is made on that branch. If a commit has more than one parent, that means some information is lost because it has to guess which parent the branch reference came from.


That info is in the reflog, but it will be GCd eventually.


afaik, only merge commits have two parents. Then the source branch would still point to the head of that branch. Furthermore, without having checked, aren't merge commits deterministic in the order of references? I wouldn't be surprised if this information isn't trivially available in a porcelain command but more surprised if it's lost


If a branch is just a reference, then how that reference changes over time will be lost. As astrange says, that info will be in the reflog, but the reflog is subject to GC. Once a GC happens, that info is forgotten.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: