Commit Diff


commit - b5bd6133383ebef019a1d03cfc0943d596d71722
commit + 28ba46a1cd9718938899ca2a671fc955acbfbb84
blob - 126742de73491b0f8156d26fe8258747ab5de1e9
blob + bf97a8b9f756c8367dc52092e98ebe37477ca486
--- examples.html
+++ examples.html
@@ -166,8 +166,152 @@ pick bcb49d15e041ddffb59397d2fe851fdb1729b005 fixed ve
 
 <h2 id="ports"><a class="permalink" href="#ports">Using got(1) with ports tree</a></h2>
 
-WIP, coming soon...
+Clone the ports repository from github. This step currently requires git(1):
+<p></p>
+<pre class="cmdbox">
+$ <b>mkdir /var/git</b>
+$ <b>cd /var/git</b>
+$ <b>git clone --bare https://github.com/openbsd/ports.git</b>
+</pre>
+<p>We jump into ports.git directory and we create our new branch to work with (let's say
+<tt>mystuff</tt>):
+<p></p>
+<pre class="cmdbox">
+$ <b>cd ports.git</b>
+$ <b>got branch mystuff</b>
+</pre>
+We check that the <tt>master</tt> and the new branch are in sync:
+<p></p>
+<pre class="cmdbox">
+$ <b>got branch -l</b>
+master: 05a7abcec81fc1865d1983314b6783680ab31f689
+mystuff: 05a7abcec81fc1865d1983314b6783680ab31f689
+</pre>
+<p>Now we need to checkout the content inside our new branch <tt>mystuff</tt>
+<p></p>
+<pre class="cmdbox">
+$ <b>cd /var/git</b>
+$ <b>got checkout -b mystuff ports.git</b>
+...
+A  /var/git/ports/x11/yeahconsole/distinfo
+A  /var/git/ports/x11/yeahconsole/patches/patch-Makefile
+A  /var/git/ports/x11/yeahconsole/pkg/DESCR
+A  /var/git/ports/x11/yeahconsole/pkg/PLIST
+A  /var/git/ports/x11/yeahlaunch/Makefile
+A  /var/git/ports/x11/yeahlaunch/distinfo
+A  /var/git/ports/x11/yeahlaunch/patches/patch-yeahlaunch_c
+A  /var/git/ports/x11/yeahlaunch/pkg/DESCR
+A  /var/git/ports/x11/yeahlaunch/pkg/PLIST
+Now shut up and hack
+</pre>
+<p>As <code>got</code> says, now shut up and hack:
+<p></p>
+<pre class="cmdbox">
+$ <b>cd /var/git/ports</b>
+$ <b>cd www/nextcloud</b>
+$ <b>vim pkg/README</b>
+</pre>
+<p>So we changed the README file inside the Nextcloud port and we need to cook the diff:
+<p></p>
+<pre class="cmdbox">
+$ <b>got diff</b>
+diff 05a7abcec81fc1865d1983314b6783680ab31f689 /var/git/ports
+blob - 47bfbdd7fa7aaf027971ac5c62db25dde75595d7
+file + www/nextcloud/pkg/README
+--- www/nextcloud/pkg/README
++++ www/nextcloud/pkg/README
+@@ -96,12 +96,20 @@ server "domain.tld" {
+                block return 301 "$DOCUMENT_URI/index.php"
+        }
 
+-       location "/nextcloud/ocm-provider/" {
+-               block return 301 "$DOCUMENT_URI/index.php"
++       location "/.well-known/carddav" {
++               block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
+        }
 
+-       location "/nextcloud/ocs-provider/" {
+-               block return 301 "$DOCUMENT_URI/index.php"
++       location "/.well-known/caldav" {
++               block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
++       }
++
++       location "/.well-known/webfinger" {
++               block return 301 "https://$SERVER_NAME/nextcloud/public.php?service=webfinger"
++       }
++
++       location match "/nextcloud/oc[ms]%-provider/*" {
++               directory index index.php
+        }
+ }
+ ---8<---------------------------------------------------------------------------
+</pre>
+<p>Time to commit those changes in our branch <tt>mystuff</tt>, so we can keep
+track of our work:
+<p></p>
+<pre class="cmdbox">
+$ <b>got commit -m "Add new examples for httpd(8) to shut up warnings"</b>
+M  www/nextcloud/pkg/README
+Created commit 7848652ef6243db09841d449f346f21fc6386633
+</pre>
+<p>Paranoid? Probably yes, let's check again our diff against <tt>master</tt>:
+<pre class="cmdbox">
+$ <b>got diff master mystuff</b>
+diff refs/heads/master refs/heads/mystuff
+blob - 47bfbdd7fa7aaf027971ac5c62db25dde75595d7
+file + www/nextcloud/pkg/README
+--- www/nextcloud/pkg/README
++++ www/nextcloud/pkg/README
+@@ -96,12 +96,20 @@ server "domain.tld" {
+                block return 301 "$DOCUMENT_URI/index.php"
+        }
+
+-       location "/nextcloud/ocm-provider/" {
+-               block return 301 "$DOCUMENT_URI/index.php"
++       location "/.well-known/carddav" {
++               block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
+        }
+
+-       location "/nextcloud/ocs-provider/" {
+-               block return 301 "$DOCUMENT_URI/index.php"
++       location "/.well-known/caldav" {
++               block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
++       }
++
++       location "/.well-known/webfinger" {
++               block return 301 "https://$SERVER_NAME/nextcloud/public.php?service=webfinger"
++       }
++
++       location match "/nextcloud/oc[ms]%-provider/*" {
++               directory index index.php
+        }
+ }
+ ---8<---------------------------------------------------------------------------
+</pre>
+<p>Now, let's send that diff to ports@ for some OKs.
+</p>
+
+<p>Once the diff has been committed to CVS the same change will eventually show
+up on github as well. Fetch incoming changes to the <tt>master</tt> branch
+with:</p>
+
+<pre class="cmdbox">
+$ <b>cd /var/git/ports.git</b>
+$ <b>git fetch origin master:master</b>
+</pre>
+
+<p>Next, rebase the <tt>mystuff</tt> branch onto the latest <tt>master</tt>:</p>
+
+<pre class="cmdbox">
+$ <b>cd /var/git/ports</b>
+$ <b>got status</b>
+(status should be clean; revert or commit local changes if needed)
+$ <b>got update -b master</b>
+$ <b>got rebase mystuff</b>
+</pre>
+
+<p>
+Now we can shut up and hack again!
+
 </body>
 </html>