{"id":929,"date":"2016-11-19T17:52:31","date_gmt":"2016-11-19T15:52:31","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=929"},"modified":"2016-12-07T01:14:31","modified_gmt":"2016-12-06T23:14:31","slug":"an-alternative-to-git-bisect-with-gentoo-and-the-live-ebuild","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2016\/11\/19\/an-alternative-to-git-bisect-with-gentoo-and-the-live-ebuild\/","title":{"rendered":"An alternative to git bisect with Gentoo and the live ebuild"},"content":{"rendered":"<p>Git bisect is absolutely powerful, but sometimes is more comfortable use emerge instead of compile the software outside the package manager.<\/p>\n<p>That was my case with media-libs\/jasper which I&#8217;m picking as example for this &#8216;howto&#8217;<\/p>\n<p>So basically, you are running Gentoo, you can install a live ebuild (9999) and you want to find which commit id fixes an issue. Let&#8217;s see step-by-step what to do.<\/p>\n<p>1) Clone the repository to obtain the commit ids and put them in a file<\/p>\n<pre><font size=\"2\"><strong>ago@blackgate ~ $<\/strong> cd \/tmp\r\n<strong>ago@blackgate \/tmp $<\/strong> git clone https:\/\/github.com\/mdadams\/jasper.git\r\n<strong>ago@blackgate \/tmp $<\/strong> cd jasper\/\r\n<strong>ago@blackgate \/tmp\/jasper $<\/strong> git --no-pager log --format=%H &gt; \/tmp\/commitlist.txt\r\n<\/font><\/pre>\n<p>The file should contain the git commit ids, for example:<\/p>\n<pre><font size=\"2\">883f85876a463019a16b6d38dd9afc022d1f07cf\r\nde4e3953fd3ef9d539c5187b7988e8750b3d67c9\r\nf9ccc661fd1094c8d1c3df38b51295677d268dbf\r\n<\/font><\/pre>\n<p>2) Use a simple script which runs emerge and the command you need to test.<\/p>\n<pre><font size=\"2\">#!\/bin\/bash\r\nfor COMMIT_ID in $( cat \/tmp\/commitlist.txt )\r\ndo\r\n      echo \"Testing with the commit id: \"${COMMIT_ID}\"\"\r\n      EGIT_COMMIT=\"${COMMIT_ID}\" emerge -q media-libs\/jasper\r\n      imginfo -f \/tmp\/myjpg.jpg\r\n      echo -ne \"\\n\\n\\n\"\r\ndone\r\n<\/font><\/pre>\n<p>With the EGIT_COMMIT variable from the git-* eclass, we can emerge the live ebuild at a specific commit id.<br \/>\nimginfo is in my case the command I need and then I print some blank lines to better separate the output of the commands and understand what is happening.<\/p>\n<p>Now you need to wait and just check what is the output of the specified command.<\/p>\n<p><strong>SOME IMPORTANT NOTES:<\/strong><br \/>\n&#8211; This howto looks to be valid when the project you are building is small; running this script with e.g. libreoffice will take months.<br \/>\n&#8211; This howto looks to be valid when you know that the problem is near to the commit master and will take few emerge cycles to found the issue.<br \/>\n&#8211; If you know that the problem is fixed e.g. a year ago, you can manually edit the commitlist.txt file and delete some recent ids, to have a specified and minor range of commits.<\/p>\n<p>That&#8217;s all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git bisect is absolutely powerful, but sometimes is more comfortable use emerge instead of compile the software outside the package manager. That was my case with media-libs\/jasper which I&#8217;m picking as example for this &#8216;howto&#8217; So basically, you are running &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2016\/11\/19\/an-alternative-to-git-bisect-with-gentoo-and-the-live-ebuild\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":140,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2EaBc-eZ","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/929"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/comments?post=929"}],"version-history":[{"count":12,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/929\/revisions"}],"predecessor-version":[{"id":1039,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/929\/revisions\/1039"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}