Skip to content

Commit

Permalink
instructions on readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Jan 22, 2024
1 parent c94ee31 commit 3fef9d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# gitstr

Send and receive git patches over Nostr, using [NIP-34](https://github.com/nostr-protocol/nips/blob/master/34.md)
Send and receive git patches over Nostr, using [NIP-34](https://github.com/nostr-protocol/nips/pull/997).

## How to receive patches

If you want to receive patches in our repo, call `git str init -r <relay> [-r <relay>...]`, this will ask you a bunch of questions (you can also answer them using flags and not be asked, see `git str init --help`) and then it will announce your repository to the relays specified with `-r`.

After someone has sent you a patch you'll be able to call `git str download` and fetch all patches. They will be stored in the `.git/str/patches/` directory. You can also pass arguments to `git str download`, like an `nevent1...` code or a `npub1...` code, to download only patches narrowed by these arguments.

After that you can call `git am <patch-file>` to apply the patch.

## How to send patches

First you need to know the `naddr1...` code that corresponds to the target upstream repository you're sending the patch to. Until someone makes an explorer of git repositories or something like that, you'll have to get that manually from the repository owner.

Then you just call `git send <commit>` (you can use `HEAD^` for the last commit and other git tricks here). You'll be asked some questions (which you can also answer with flags, see `git str send --help`) and the patch will be sent.
2 changes: 1 addition & 1 deletion send.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func getAndApplyTargetThread(
evt *nostr.Event,
) (patchRelays []string, err error) {
target := c.String("in-reply-to")
if target == "" {
if target == "" && !c.IsSet("in-reply-to") {
var err error
target, err = ask("reference a thread? (nevent or hex) (leave blank if not): ", "", func(answer string) bool {
if answer == "" {
Expand Down

0 comments on commit 3fef9d9

Please sign in to comment.