Browse Source

feat: add git-remote-nostr guide

as a seperate quick start page

update copy to reflect additional tool
master
DanConwayDev 2 years ago
parent
commit
67521de4ad
No known key found for this signature in database
GPG Key ID: 68E15486D73F75E1
  1. 207
      src/routes/+page.svelte
  2. 16
      src/routes/about/+page.svelte
  3. 6
      src/routes/ngit/+page.svelte
  4. 347
      src/routes/quick-start/+page.svelte

207
src/routes/+page.svelte

@ -83,8 +83,7 @@ @@ -83,8 +83,7 @@
</h3>
</div>
<div class="prose">
just for syncing data related to nostr's state eg. Gitea, Github,
Gitlab, self-hosted...
used only for syncing data eg. Gitea, Github, Gitlab, self-hosted...
</div>
</div>
</div>
@ -132,10 +131,12 @@ @@ -132,10 +131,12 @@
<div class="card-body">
<div class="card-title">
<h3>
<span class="text-yellow-600">git</span> remote nostr
<span class="text-yellow-600">git</span>-remote-nostr
</h3>
</div>
<div class="prose">git plugin for seemless nostr integration</div>
<div class="prose">
git remote helper (plugin) for seemless nostr integration
</div>
</div>
</div>
<div class="card bg-base-300">
@ -146,8 +147,8 @@ @@ -146,8 +147,8 @@
</h3>
</div>
<div class="prose">
a command line tool to manage repos and advanced patch submission
and review
a command line tool to manage repos and advanced patch
submission&nbsp;/&nbsp;review
</div>
</div>
</div>
@ -164,13 +165,195 @@ @@ -164,13 +165,195 @@
collaboration layer for code changes.
</p>
<p>
ngit and gitworkshop.dev are tools to enable code collaboration over
nostr. ngit allows contributors to manage the flow to open a proposal,
maintainers to verify proposals and incorporate them into the project.
Gitworkshop.dev provides a visual interface to discuss proposals and open
issues.
Gitworkshop.dev, git-remote-nostr and ngit are tools to enable code
collaboration over nostr. Gitworkshop.dev provides a visual interface to
discuss proposals and open issues. git-remote-nostr enables proposal
creation, review and incorporation using standard git tooling. ngit
handles repository setup and advanced proposal submission.
</p>
<a href="/about" class="btn btn-secondary text-right">learn more</a>
<div class="flex justify-end">
<a href="/about" class="btn btn-secondary text-right">details</a>
</div>
</div></Container
>
<Container>
<div class="prose m-auto mb-6 mt-6">
<h2>Quick Start</h2>
<h3>
Install <span class="text-purple-600">n</span>git and
<span class="text-yellow-600">git</span>-remote-nostr
</h3>
<p>
donwload binaries and add them to a directory from which they can be run
globally:
</p>
<p>
<a
href="https://github.com/DanConwayDev/ngit-cli/releases/download/v1.3.1/ngit-x86_64-unknown-linux-gnu.tar.gz"
class="btn btn-neutral">Linux</a
>
<a
href="https://github.com/DanConwayDev/ngit-cli/releases/download/v1.3.1/ngit-x86_64-apple-darwin.tar.gz"
class="btn btn-neutral">Mac</a
>
<a
href="https://github.com/DanConwayDev/ngit-cli/releases/download/v1.3.1/ngit-x86_64-pc-windows-msvc.zip"
class="btn btn-neutral">Windows</a
>
v1.3.1
</p>
<p>
alternatively, if you have cargo installed run<code
>cargo install ngit</code
>
</p>
</div>
<div class="m-auto max-w-5xl">
<div class="grid gap-4 md:grid-cols-2">
<div class="card bg-base-200">
<div class="card-body">
<div class="card-title">
<h3>for the contributor</h3>
</div>
<p>
clone the nostr url and use normal git operations with tool you are
used it (eg. your IDE)
</p>
<div class="text-sm">
<div>
<code
><span class="text-yellow-600">git</span> clone nostr://<span
class="text-purple-600">npub123</span
>/<span class="text-primary">repo-identifier</span></code
>
</div>
<div>
<code
><span class="text-green-600"
>// use pr/ branch prefix to create a nostr proposal</span
></code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> checkout -b pr/great-feature</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> commit -am "improve the
world"</code
>
</div>
<div>
<code><span class="text-yellow-600">git</span> push -u</code>
</div>
<div>
<code
><span class="text-green-600"
>// any branch with pr/ prefix is nostr proposal</span
></code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> branch -r --list origin/pr/*</code
>
</div>
</div>
<div class="card-actions mt-auto justify-end">
<a
href="/quick-start#contributor"
class="btn btn-secondary text-right">full guide</a
>
</div>
</div>
</div>
<div class="card bg-base-200">
<div class="card-body">
<div class="card-title">
<h3>for the maintainer</h3>
</div>
<div class="text-sm">
<div class="not-prose text-sm">
<div>
<code
><span class="text-green-600"
>// create a git repo and push to a git server</span
></code
>
</div>
<div>
<code><span class="text-yellow-600">git</span> init</code>
</div>
<div>
<code
><span class="text-yellow-600">git</span> commit -am "initial commit"</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> remote add origin https://dm.co/usr/my-repo</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> push -u origin master</code
>
</div>
<div>
<code
><span class="text-green-600">// announce on nostr</span
></code
>
</div>
<div>
<div>
<code
><span class="text-purple-600">ngit</span> init --identifier
<span class="text-primary">my-repo</span></code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> remote set-url
origin nostr://<span class="text-purple-600">npub123</span
>/<span class="text-primary">my-repo</span></code
>
</div>
<div>
<code
><span class="text-green-600"
>// pushing merged commits updates proposal status</span
></code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> merge origin/pr/great-feature(e8246b2)</code
>
</div>
<div>
<code><span class="text-yellow-600">git</span> push</code>
</div>
</div>
</div>
</div>
<div class="card-actions mt-auto justify-end">
<a
href="/quick-start#maintainer"
class="btn btn-secondary text-right">full guide</a
>
</div>
</div>
</div>
</div>
</div></Container
>
<Container>
<div class="prose m-auto mb-6 mt-6">
<h2>Example Repositories</h2>
<p>These repositories have plenty of issues and proposals to explore</p>
<div class="not-prose lg:w-[64rem]">

16
src/routes/about/+page.svelte

@ -20,8 +20,8 @@ @@ -20,8 +20,8 @@
<div class="prose m-auto mt-8">
<h2 class="">About</h2>
<p>
gitworkshop.dev and <a href="/ngit">ngit</a> are tools to enable code
collaboration over nostr created and maintained by
gitworkshop.dev, <a href="/ngit">ngit</a> and git-remote-nostr are tools
to enable code collaboration over nostr created and maintained by
<a
class="link-primary"
href="https://njump.me/nprofile1qy88wumn8ghj7mn0wvhxcmmv9uq3vamnwvaz7tmsw4e8qmr9wfjkccte9e3k7mf0qqs2qzx779ted7af5rt04vzw3l2hpzfgtk0a2pw6t2plaz4d2734vng80y96x"
@ -147,8 +147,8 @@ @@ -147,8 +147,8 @@
</p>
<p>
ngit and gitworkshop.dev implements optional features of nip34, which
enable:
git-remote-nostr, ngit and gitworkshop.dev implements optional features of
nip34, which enable:
</p>
<ul>
<li>
@ -157,10 +157,18 @@ @@ -157,10 +157,18 @@
<li>
amendments to a proposal can be made by pushing a commit using <span
class="rounded bg-neutral p-2 font-mono"
><span class="py-5">git&nbsp;push</span></span
>
or
<span class="rounded bg-neutral p-2 font-mono"
><span class="py-5">ngit&nbsp;push</span></span
>
rather than issuing a complete revision, which modifies the original
commits (still possible with
<span class="rounded bg-neutral p-2 font-mono"
><span class="py-5">git&nbsp;push --force</span></span
>
or
<span class="rounded bg-neutral p-2 font-mono"
><span class="py-5">ngit&nbsp;push&nbsp;--force</span></span
>

6
src/routes/ngit/+page.svelte

@ -81,12 +81,6 @@ @@ -81,12 +81,6 @@
>
v1.3.1
</p>
<p>
alternatively, if you have cargo installed run<code
>cargo install ngit</code
>
</p>
<p>
alternatively, if you have cargo installed run<code
>cargo install ngit</code

347
src/routes/quick-start/+page.svelte

@ -0,0 +1,347 @@ @@ -0,0 +1,347 @@
<script lang="ts">
import Container from '$lib/components/Container.svelte'
</script>
<svelte:head>
<title>GitWorkshop - ngit</title>
</svelte:head>
<Container>
<div class="prose m-auto mt-8">
<h3>Quick Start</h3>
</div>
</Container>
<div class="bg-base-300">
<Container>
<div class="prose m-auto my-4 py-4">
<h3 id="contributor">Contributor Quick Start</h3>
<div class="text-sm">
<div>
<div class="prose">
<h4>1. find repository</h4>
<ul>
<li>
browse <a href="/repos" class="link link-primary"
>gitworkshop.dev/repos</a
> for the repository
</li>
<li>explore proposals and issues</li>
<li>
copy the git clone url (or press the green clone button to copy
the clone command)
</li>
</ul>
<h4>2. clone repository</h4>
<ul>
<li>
<div>
using your prefered git client or with the git command you
just copied:
</div>
<div class="not-prose text-sm">
<code
><span class="text-yellow-600">git</span> clone nostr://<span
class="text-purple-600">npub123</span
>/<span class="text-primary">repo-identifier</span></code
>
</div>
</li>
</ul>
<h4>3. submit proposal</h4>
<div>
<ul>
<li>
<div>
<div>
push a branch with the prefix `pr/` for example using git
commands:
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> checkout -b pr/great-feature</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> commit -am "improve
the world"</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> push -u</code
>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
OR for more options such as including a cover letter use
ngit:
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-purple-600">ngit</span> send</code
>
</div>
</div>
</div>
</li>
</ul>
</div>
<h4>4. view proposals</h4>
<div>
<ul>
<li>
<div>
<div>
for open proposals view remote branches with prefix `pr/`
for example using git command:
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> branch -r --list
origin/pr/*</code
>
</div>
</div>
</div>
</li>
<li>
<div>
<div>OR using ngit:</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-purple-600">ngit</span> list</code
>
</div>
</div>
</div>
</li>
</ul>
</div>
<h4>5. update proposal</h4>
<div>
<ul>
<li>
<div>
<div>
if you are the proposal author, or a maintainer you can
add commits to a proposal:
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> commit -am "extra
thing"</code
>
</div>
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> push</code
>
</div>
</div>
</div>
</li>
<li>
<div>
<div>or revising it:</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> commit -a -amend</code
>
</div>
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> push --force</code
>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</Container>
</div>
<div class="">
<Container>
<div class="prose m-auto my-4 py-4">
<h3 id="maintainer">Maintainer Quick Start</h3>
<div class="text-sm">
<div>
<div class="prose">
<h4>1. create a git repo and push to a git server</h4>
<div>
<ul>
<li>
<div>
<div>for example using git commands:</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> init</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> commit -am "initial
commit"</code
>
</div>
<div>
<code
><span class="text-green-600"
>// create repository on git server and the:
</span></code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> remote add origin
https://codeberg.org/johnedoe/my-repo.git</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> push -u origin
master</code
>
</div>
</div>
</div>
</li>
</ul>
</div>
<h4>2. initialize on nostr</h4>
<div>
<ul>
<li>
<div>
<div>initialize and use the nostr remote:</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-purple-600">ngit</span> init
</code>
</div>
<div>
<code
><span class="text-yellow-600">git</span> remote
set-url origin nostr://<span class="text-purple-600"
>npub123</span
>/<span class="text-primary">my-repo</span></code
>
</div>
</div>
</div>
</li>
<li>
ensure all maintainers push to the nostr remote and not git
server directly so that the state is updated on nostr
</li>
</ul>
</div>
<h4>3. view proposals</h4>
<div>
<ul>
<li>
<div>
<div>
for open proposals view remote branches with prefix `pr/`
for example using git command:
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> branch -r --list
origin/pr/*</code
>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
OR using ngit with more options such as applying them
directly:
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-purple-600">ngit</span> list</code
>
</div>
</div>
</div>
</li>
</ul>
</div>
<h4>4. merge / incorporate proposals</h4>
<div>
<ul>
<li>
<div>
<div>
the proposal status will be automatically updated if you
merge the branch:
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-yellow-600">git</span> checkout master</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> merge pr/great-feature(e8246b2)</code
>
</div>
<div>
<code
><span class="text-yellow-600">git</span> push</code
>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
use gitworkshop.dev to make comments or manually set the
status.
</div>
<div class="not-prose text-sm">
<div>
<code
><span class="text-purple-600">ngit</span> list</code
>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</Container>
</div>
Loading…
Cancel
Save