logoalt Hacker News

SuperNinKenDolast Wednesday at 8:18 AM2 repliesview on HN

Isn't that technically not the case if you wanted to apply a specific patch without every other change that's been made to the same file.

The more changes, the more likely it is for a patch to fail, but in principle it seems like cherry-picking and applying a change is a valid use of a diff.


Replies

account42last Wednesday at 10:22 AM

Git already conceptually stores an entire tree of files for each commit and has no problem with rebasing, cherry-picking etc. And the patches it generates for you are derived on the fly from those snapshots - a commit doesn't have a fixed canonical patch text.

show 1 reply
aidenn0last Wednesday at 3:22 PM

The original file plus the file with the changes you care about is a superset of the information included in a diff file.