{"id":1816,"date":"2011-03-06T10:27:33","date_gmt":"2011-03-06T09:27:33","guid":{"rendered":"http:\/\/glandium.org\/blog\/?p=1816"},"modified":"2011-03-06T10:27:40","modified_gmt":"2011-03-06T09:27:40","slug":"a-good-reason-to-keep-patched-source-in-vcs","status":"publish","type":"post","link":"https:\/\/glandium.org\/blog\/?p=1816","title":{"rendered":"A good reason to keep patched source in $VCS"},"content":{"rendered":"<p>There are a lot of different workflows to maintain Debian packages under a Version Control System. Some people prefer to only keep the <code>debian<\/code> directory, some the whole source. And in the latter category, some prefer the source tree to be patched with Debian changes, while others prefer to keep it unpatched and exclusively use <code>debian\/patches<\/code>.<\/p>\n<p>It turns out the former and the latter don't work so well in one specific case that any package may hit some day ; and that day, you realize how wrong you were not tracking the entire patched source. That happened to me recently, though instead of actually going forward and switch to tracking the patched source, I cheated and simply ditched the patch, because I didn't strictly need it.<\/p>\n<p>In all fairness, this is not only a case against not tracking patched source, but also a case of the 3.0 (quilt) source format being cumbersome.<\/p>\n<p>In my specific case, I cherry picked an upstream patch modifying and adding some test cases related to a cherry-picked fix. One of the added test cases was a UTF-16 file. UTF-16 files can't be diff'ed nor patch'ed except in the git patch format, but quilt doesn't use nor support that. The solution around this limitation of 3.0 (quilt) format is to include the plain modified file in the Debian tarball, and add its path to <code>debian\/source\/include-binaries<\/code>.<\/p>\n<p>On the VCS side of things, it means you have to modify the file in the source directory, and fill <code>debian\/source\/include-binaries<\/code> accordingly. Wait. Modify the file in the source directory ? But the other files aren't ! They're tracked by patches !<\/p>\n<p>So here you are, with all of your modifications exclusively in <code>debian\/patches<\/code>... except one.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are a lot of different workflows to maintain Debian packages under a Version Control System. Some people prefer to only keep the debian directory, some the whole source. And in the latter category, some prefer the source tree to be patched with Debian changes, while others prefer to keep it unpatched and exclusively use [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[23],"class_list":["post-1816","post","type-post","status-publish","format-standard","hentry","category-debian","tag-en"],"_links":{"self":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1816"}],"version-history":[{"count":5,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1816\/revisions"}],"predecessor-version":[{"id":1841,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1816\/revisions\/1841"}],"wp:attachment":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}