4 ms·
More than you really wanted to know about Patch
- gglitch 8y agoI hope someone somewhere is compiling this kind of material for the Foundation time capsule.
- jancsika 8y agopatch: hey everybody look at javascript it has two nulls. wat lol javascript: at least my nulls aren't like midnight, january 1, 1970 unix: damn js that's an epoch burn
- anitil 8y agoThat was quite refreshing to read. It's funny how little thought I'd given to such a vital tool I had a good chuckle at 'given a choice between "system with no battery" and "system with systemd" it's no contest'
- smcameron 8y agoIf you ever find yourself needing to maintain a set of patches to apply to two or more similar codebases (e.g. various linux kernels of various distros), I found stacked git to be very helpful for that purpose. http://www.procode.org/stgit/ http://www.procode.org/stgit/ (or maybe just apt-get install stgit).
- pm215 8y agoYes, I can definitely recommend stgit if what you're doing is basically "maintain this stack of patches". It's much more user-friendly as an UI for doing that than raw git rebase, though of course you can achieve the same workflow with the basic git plumbing.
- pjtr 8y agoI was very surprised to learn that diff / patch file formats are essentially unstandardized. Shouldn't there be an RFC or something?
- chii 8y agoIt's standardized the same way Perl is standardized - whatever the reference implementation does is the standard!
- JdeBP 8y agoOf course, this idea goes back further than "back in the 1980s" with Larry Wall. In the mainframe world of the decade before that, people had ZAP, which later was to become SPZAP, OBJZAP, and AMASPZAP (not IAMASPZAP as the Hacker's Dictionary erroneously has it). ZAP's "NAME", "VER", and "REP" records work similarly to the process described by M. Landley: name the file, verify that the original contents at a particular place are thus, replace them with some new contents if so. ZAP could also twiddle metadata, record patches applied, and dump contents. It has several imitators. * https://ibm.com/support/knowledgecenter/en/SSB27U_6.4.0/com.ibm.zvm.v640.dmsb4/zapp.htm https://ibm.com/support/knowledgecenter/en/SSB27U_6.4.0/com.... * https://ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.ieav100/spzap.htm https://ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.... * https://support.sas.com/documentation/onlinedoc/sasc/doc/techsup/zenid-24.htm https://support.sas.com/documentation/onlinedoc/sasc/doc/tec... * https://m204wiki.rocketsoftware.com/index.php/RockZap https://m204wiki.rocketsoftware.com/index.php/RockZap
- samat 8y agoThanks for the links provided, made me happy to realise I don't have to parse that documentation :)
- u801e 8y agoAfter reading the man page for diff and the -e option, I found that they actually generate the diff hunks from the end of the file to the beginning in order to keep the start line numbers consistent. I wonder why the other diff formats decided to do it the other way around (from beginning to end)? Doing it from end to beginning actually makes it easier to apply individual hunks without having to regenerate the diff after applying one (assuming you start with a later hunk before applying earlier ones).