<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="https://kemitix.net/feed_style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <tabi:metadata xmlns:tabi="https://github.com/welpo/tabi">
        <tabi:base_url>https:&#x2F;&#x2F;kemitix.net</tabi:base_url>
        <tabi:separator>
            •
        </tabi:separator>
        <tabi:about_feeds>This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader. Visit About Feeds to learn more and get started. It&#x27;s free.</tabi:about_feeds>
        <tabi:visit_the_site>Visit website</tabi:visit_the_site>
        <tabi:recent_posts>Recent posts</tabi:recent_posts>
        <tabi:last_updated_on>Updated on $DATE</tabi:last_updated_on>
        <tabi:default_theme></tabi:default_theme>
        <tabi:post_listing_date>date</tabi:post_listing_date>
        <tabi:current_section>go</tabi:current_section>
    </tabi:metadata><title>kemitix.net - go</title>
        <subtitle>Personal blog, for development work</subtitle>
    <link href="https://kemitix.net/tags/go/atom.xml" rel="self" type="application/atom+xml"/>
    <link href="https://kemitix.net/tags/go/" rel="alternate" type="text/html"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-05-09T07:46:00+01:00</updated>
    <id>https://kemitix.net/tags/go/atom.xml</id><entry xml:lang="en">
        <title>PR: Mirror Branch Filter for Forgejo</title>
        <published>2025-05-09T07:46:00+01:00</published>
        <updated>2025-05-09T07:46:00+01:00</updated>
        <author>
            <name>Paul Campbell</name>
        </author>
        <link rel="alternate" href="https://kemitix.net/blog/forgeoj-pr-mirror-push-2025-05-09/" type="text/html"/>
        <id>https://kemitix.net/blog/forgeoj-pr-mirror-push-2025-05-09/</id>
        
            <content type="html">&lt;p&gt;I use a private &lt;a href=&quot;https:&#x2F;&#x2F;forgejo.org&quot;&gt;Forgejo&lt;&#x2F;a&gt; instance to host all my projects, mirroring some to &lt;a href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;kemitix&quot;&gt;codeberg.org&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;However, I’d like to be able to only publish my &lt;code&gt;main&lt;&#x2F;code&gt; branch for each repo to Codeberg.
Forgejo doesn’t support this, so I created a &lt;a href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;forgejo&#x2F;forgejo&#x2F;issues&#x2F;7242&quot;&gt;Feature Request&lt;&#x2F;a&gt;.
Now that I’ve fininished the update to &lt;a href=&quot;https:&#x2F;&#x2F;kemitix.net&#x2F;blog&#x2F;git-next-v2025-05-0&#x2F;&quot;&gt;git-next&lt;&#x2F;a&gt; that I had been working on, I’ve made a stab at implementing this.&lt;&#x2F;p&gt;
&lt;p&gt;Forgejo is written in &lt;a href=&quot;https:&#x2F;&#x2F;go.dev&quot;&gt;Go&lt;&#x2F;a&gt; which I’ve only used very briefly about 5 years ago.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;forgejo&#x2F;forgejo&#x2F;pulls&#x2F;7823&quot;&gt;Pull Request&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;It’s not complete, but I think it hits the main points needed for the implementation.&lt;&#x2F;p&gt;
&lt;p&gt;It is missing things, like tests and documentation.&lt;&#x2F;p&gt;
&lt;p&gt;Hopefully I can get some feedback to make sure I’m even approaching the problem correctly.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;mirror-branch-filtering&quot;&gt;Mirror Branch Filtering&lt;&#x2F;h2&gt;
&lt;p&gt;A new feature to allow filtering which branches get mirrored. The changes span multiple components:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Added &lt;code&gt;BranchFilter&lt;&#x2F;code&gt; field to mirror settings and API models&lt;&#x2F;li&gt;
&lt;li&gt;Updated database schema with migration&lt;&#x2F;li&gt;
&lt;li&gt;Modified push mirror logic to handle branch filtering&lt;&#x2F;li&gt;
&lt;li&gt;Added UI controls in repository settings&lt;&#x2F;li&gt;
&lt;li&gt;When branch filter is specified, mirrors will only push the listed branches (comma-separated)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The mirror branch filtering provides more granular control over repository mirroring operations.&lt;&#x2F;p&gt;
</content>
        </entry>
</feed>
