linux using/applying patches and confusion related to hunks
I got a huge patch of about 200 patches from another team. I have divided them into individual patches and applying them.
For some of the patches I see an output as “patching file aa/bb/cc.c”
For some others I see output as “Hunk #1 succeeded at 90 (offset -39 lines).”
- Git/Diff Patch technical explanation
- apply svn patch to git repository
- Pipe git diff to git apply
- How to create git-compatible patch from svn revision, that contains binary file changes?
- Kernel source: Submitting patch
- In git, how do I create a single patch for the last 2+ revisions?
I assume in both the cases patches have been successfully applied.
If my assumption is correct then why do I see different outputs.
My guess is in second case, patch could not be applied at exactly the same place (Same offset). However, PATCH figured out where to apply and applied it at some other offset.
Whereas in first case it was applied exactly where it was intended.
Can someone confirm if my understanding is correct.
One Solution collect form web for “linux using/applying patches and confusion related to hunks”
Yes, your understanding is correct. If it didn’t succeed, you would get an error message from git. If you use
patch, this would create a #.rej file (see man page)
In your case, the patch succeeded, but at a slightly different line then indicated in the patch.