{"id":210,"date":"2014-06-05T20:37:19","date_gmt":"2014-06-05T20:37:19","guid":{"rendered":"http:\/\/blog.ignoranthack.me\/?p=210"},"modified":"2014-07-19T19:55:35","modified_gmt":"2014-07-19T19:55:35","slug":"playing-nice-with-others-git1-and-patches-on-freebsd","status":"publish","type":"post","link":"http:\/\/blog.ignoranthack.me\/?p=210","title":{"rendered":"Playing nice with others.  git(1) and patches on #FreeBSD"},"content":{"rendered":"<p>I&#8217;ve been spending a lot of time massaging a branch of patches and other assorted bits and pieces for QEMU user mode on <a href=\"https:\/\/github.com\/seanbruno\/qemu-bsd-user\/tree\/bsd-user\" target=\"_blank\">github <\/a><\/p>\n<p>This led me down the path of being a good git user and contributor, so I&#8217;ll leave these notes for myself and others in the event you come into a situation where you need FreeBSD to play nice with people who are very git(1) centric.<\/p>\n<p>After an update by wxs@freebsd.org to the devel\/git port, you can now install git(1) and have it work out of the box.\u00a0 The most frustrating thing, after using git for like 5 minutes, is to figure out how to extract a patch out of it and send it all pretty-like to the mailing list(s) that would be consuming the patch.<\/p>\n<p>In its simplest incarnation, you can simply reference a commit hash and us it to generate a patch via git format-patch, but this will give you the entire commit diff between the referenced version and HEAD.\u00a0 This, in my case generated approximately 3000 patch files.<\/p>\n<p>e.g. git format-patch &#8211;output-directory ~\/patches &#8211;to=&#8221;qemu-devel@nongnu.org&#8221; c60a1f1b2823a4937535ecb97ddf21d06cfd3d3b<\/p>\n<p>What I want, is a diff of one revision, which requires a start and ending hash:<\/p>\n<p>format-patch &#8211;output-directory ~\/patches &#8211;to=&#8221;qemu-devel@nongnu.org&#8221; c60a1f1b2823a4937535ecb97ddf21d06cfd3d3b&#8230;c6ad44bb288c1fe85d4695b6a48d89823823552b<\/p>\n<p>Now I send this to the mailing lists via my client.\u00a0 Here is where I kind of head-desked a bit.\u00a0 If you are like me and run a mail server yourself and you use SSL with self-signed certs, then this little bit if for you.\u00a0 I lost about an hour trying to figure this little bit out.<\/p>\n<p>The way to dump patches from your patch director (~\/patches) is to use:<\/p>\n<p>git send-email patches\/*<\/p>\n<p>This will use the following variables in your git environment:<\/p>\n<p>sendemail.smtpserver=mail.ignoranthack.me<br \/>\nsendemail.smtpencryption=ssl<br \/>\nsendemail.smtpuser=sbruno@ignoranthack.me<br \/>\nsendemail.smtpserverport=465<br \/>\nsendemail.smtpsslcertpath=<br \/>\nsendemail.annotate=yes<\/p>\n<p>Notice the empty &#8220;sendemail.smtpcertpath&#8221; variable.\u00a0 Without that set to EMPTY, git would repeatedly fail on the self-signed cert that I use.\u00a0 So, I&#8217;m pretty sure something still isn&#8217;t setup correctly.\u00a0 However, it must be set to EMPTY and not undefined.\u00a0 Else, you will repeatedly fail with certificate validation errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been spending a lot of time massaging a branch of patches and other assorted bits and pieces for QEMU user mode on github This led me down the path of being a good git user and contributor, so I&#8217;ll leave these notes for myself and others in the event you come into a situation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"_share_on_mastodon":"0"},"categories":[2],"tags":[],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/210"}],"collection":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=210"}],"version-history":[{"count":1,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":211,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions\/211"}],"wp:attachment":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}