{"id":199,"date":"2009-01-29T13:59:57","date_gmt":"2009-01-29T04:29:57","guid":{"rendered":"http:\/\/www.clearchain.com\/blog\/?p=199"},"modified":"2009-01-29T13:59:57","modified_gmt":"2009-01-29T04:29:57","slug":"jhbuild-using-a-git-branch","status":"publish","type":"post","link":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch","title":{"rendered":"jhbuild using a git branch"},"content":{"rendered":"<p>Recently I&#8217;ve been playing around with jhbuild. I wanted to jhbuild to use a custom branch from a git repo I&#8217;ve setup. \u00a0Sadly the documentation on how to do this is a little lacking. Added to the fact that the jhbuild code drops an argument and there&#8217;s a lot of fun at work.<\/p>\n<p>The solution, use the revision attribute in your module set file:<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0&lt;repository type=&#8221;git&#8221; name=&#8221;git.freedesktop.org&#8221;\u00a0\u00a0 href=&#8221;git:\/\/anongit.freedesktop.org\/&#8221;\/&gt;<br \/>\n\u00a0<span style=\"color: #800080;\">&lt;branch repo=&#8221;git.freedesktop.org&#8221;\u00a0\u00a0 \u00a0module=&#8221;~benjsc\/xorg\/proto\/compositeproto&#8221; checkoutdir=&#8221;xorg\/proto\/compositeproto&#8221; <\/span><strong><em><span style=\"color: #800080;\">revision=&#8221;ir&#8221;<\/span><\/em><\/strong><span style=\"color: #800080;\"> \/&gt;<\/span><\/p>\n<p>\u00a0<\/p>\n<p>This checks out the ir branch of the repo: git:\/\/anongit.freedesktop.org\/~benjsc\/xorg\/proto\/compositeproto<br \/>\n<!--more--><br \/>\nFor those looking at the jhbuild code, you can see the fun with the dropped argument:<\/p>\n<p><span style=\"color: #3366ff;\">class GitRepository<\/span><\/p>\n<p>&#8230;<\/p>\n<p>def branch(self, name, module = None, subdir=&#8221;&#8221;, checkoutdir = None,<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>revision = None, tag = None):<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>if name in self.config.branches:<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>module = self.config.branches[name]<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>if not module:<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>raise FatalError(_(&#8216;branch for %s has wrong override, check your .jhbuildrc&#8217;) % name)<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>else:<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>if module is None:<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>module = name<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>module = urlparse.urljoin(self.href, module)<br \/>\n<span style=\"white-space:pre\"><span style=\"white-space:pre\"> <\/span> <\/span>return <strong>GitBranch(self, module, subdir, checkoutdir, <span style=\"text-decoration: underline;\"><em>revision, tag<\/em><\/span>)<\/strong><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"color: #3366ff;\">class GitBranch(Branch):<\/span><br \/>\n<span style=\"white-space: pre;\"> <\/span>&#8220;&#8221;&#8221;A class representing a GIT branch.&#8221;&#8221;&#8221;<\/p>\n<p><span style=\"white-space: pre;\"> <\/span>def __init__(self, repository, module, subdir, checkoutdir=None, branch=None, <strong><span style=\"text-decoration: underline;\">tag=None<\/span><\/strong>):<br \/>\n<span style=\"white-space: pre;\"> <\/span>Branch.__init__(self, repository, module, checkoutdir)<br \/>\n<span style=\"white-space: pre;\"> <\/span>self.subdir = subdir<br \/>\n<span style=\"white-space: pre;\"> <\/span>self.branch = branch<br \/>\n<span style=\"white-space: pre;\"> <\/span>self.tag = tag<\/p>\n<p><span style=\"color: #ff0000;\">So Where revision go?<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I&#8217;ve been playing around with jhbuild. I wanted to jhbuild to use a custom branch from a git repo I&#8217;ve setup. \u00a0Sadly the documentation on how to do this is a little lacking. Added to the fact that the jhbuild code drops an argument and there&#8217;s a lot of fun at work. The solution,<a href=\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch\"> <font size=-2>[..more..]<\/font><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[107,102],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","category-freedesktop","tag-git","tag-jhbuild"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>jhbuild using a git branch - ClearChain<\/title>\n<meta name=\"description\" content=\"Recently I&#039;ve been playing around with jhbuild. I wanted to jhbuild to use a custom branch from a git repo I&#039;ve setup. \u00a0Sadly the documentation on how to\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Close\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch\"},\"author\":{\"name\":\"Benjamin Close\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98\"},\"headline\":\"jhbuild using a git branch\",\"datePublished\":\"2009-01-29T04:29:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch\"},\"wordCount\":239,\"commentCount\":3,\"keywords\":[\"git\",\"jhbuild\"],\"articleSection\":[\"FreeDesktop\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch\",\"url\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch\",\"name\":\"jhbuild using a git branch - ClearChain\",\"isPartOf\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/#website\"},\"datePublished\":\"2009-01-29T04:29:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98\"},\"description\":\"Recently I've been playing around with jhbuild. I wanted to jhbuild to use a custom branch from a git repo I've setup. \u00a0Sadly the documentation on how to\",\"breadcrumb\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.clearchain.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"jhbuild using a git branch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/#website\",\"url\":\"https:\/\/www.clearchain.com\/blog\/\",\"name\":\"ClearChain\",\"description\":\"-= Daily Happenings =-\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.clearchain.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98\",\"name\":\"Benjamin Close\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/19dca0aa372edfa901b93c556dfda2e78ad4434558fe4d139598e086315d714a?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/19dca0aa372edfa901b93c556dfda2e78ad4434558fe4d139598e086315d714a?s=96&d=mm&r=pg\",\"caption\":\"Benjamin Close\"},\"sameAs\":[\"http:\/\/www.clearchain.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"jhbuild using a git branch - ClearChain","description":"Recently I've been playing around with jhbuild. I wanted to jhbuild to use a custom branch from a git repo I've setup. \u00a0Sadly the documentation on how to","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch","twitter_misc":{"Written by":"Benjamin Close","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch#article","isPartOf":{"@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch"},"author":{"name":"Benjamin Close","@id":"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98"},"headline":"jhbuild using a git branch","datePublished":"2009-01-29T04:29:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch"},"wordCount":239,"commentCount":3,"keywords":["git","jhbuild"],"articleSection":["FreeDesktop"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch","url":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch","name":"jhbuild using a git branch - ClearChain","isPartOf":{"@id":"https:\/\/www.clearchain.com\/blog\/#website"},"datePublished":"2009-01-29T04:29:57+00:00","author":{"@id":"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98"},"description":"Recently I've been playing around with jhbuild. I wanted to jhbuild to use a custom branch from a git repo I've setup. \u00a0Sadly the documentation on how to","breadcrumb":{"@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-using-a-git-branch#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.clearchain.com\/blog"},{"@type":"ListItem","position":2,"name":"jhbuild using a git branch"}]},{"@type":"WebSite","@id":"https:\/\/www.clearchain.com\/blog\/#website","url":"https:\/\/www.clearchain.com\/blog\/","name":"ClearChain","description":"-= Daily Happenings =-","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.clearchain.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98","name":"Benjamin Close","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/19dca0aa372edfa901b93c556dfda2e78ad4434558fe4d139598e086315d714a?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/19dca0aa372edfa901b93c556dfda2e78ad4434558fe4d139598e086315d714a?s=96&d=mm&r=pg","caption":"Benjamin Close"},"sameAs":["http:\/\/www.clearchain.com"]}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":2,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/posts\/199\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}