~renato

Recent activity

Re: [PATCH v1 0/1] git: show license spike 1 year, 12 days ago

From Renato Torres to ~emersion/hut-dev

I was exploring your comments a bit further (and learned a lot about
GraphQL...).

If I understood correctly we cannot use "raw" as a generic solution
because that's a specific field from the git.sr.ht GraphQL API.

I've hacked gqlclient to explore a solution for this.

Consider the following schema ("stolen" from 99designs/gqlgen):

```graphql
interface Character {
  # ...
}

Re: [PATCH v1 0/1] git: show license spike 1 year, 12 days ago

From Renato Torres to ~emersion/hut-dev

> Any other ideas?

The client can have an ExecuteRaw method to return json.RawMessage, 
giving developers the possibility to decode the JSON in scenarios with
complicated nested interfaces:

func (c *Client) ExecuteRaw(ctx context.Context,
                            op *Operation) (*json.RawMessage, error) {
    // ...
}

The generate code in gql.go could be augmented with functions like:

Re: [PATCH v1 0/1] git: show license spike 1 year, 12 days ago

From Renato Torres to ~emersion/hut-dev

> I wonder. Maybe a more generally useful feature could be a cat-file
> command.

Sounds good.

> I've been wondering about this, and I'm not sure a Go interface is the 
> best way to represent a GraphQL interface. (...)

I'm checking your suggestions, I have no previous experience with
graphql nor gqlclientgen.

Just adding extra information.

Previouslly I had requested the raw fields and they were empty.

[PATCH v1 1/1] git: show license 1 year, 12 days ago

From Renato Torres to ~emersion/hut-dev

---
 git.go                          | 121 ++++++++++++++++++++------------
 srht/gitsrht/gql.go             |  20 ++++--
 srht/gitsrht/operations.graphql |  14 ++++
 3 files changed, 105 insertions(+), 50 deletions(-)

diff --git a/git.go b/git.go
index cc5f18c..379da20 100644
--- a/git.go
+++ b/git.go
@@ -411,6 +411,7 @@ func newGitACLDeleteCommand() *cobra.Command {
}

func newGitShowCommand() *cobra.Command {
[message trimmed]

[PATCH v1 0/1] git: show license spike 1 year, 12 days ago

From Renato Torres to ~emersion/hut-dev

This is not a final patch.

Following one of the comments from Thorben Günther regarding the git 
show command, I did a spike to show the license of a repository.

The command to show the license is:

go run . git show hut --license 
go run . git show hut -l

If used with the "license" flag the git show command shows only the
license, shipping all the other information. This allows to fetch the
license and use the output to feed other scripts.

Re: [PATCH v3 0/1] git: add show 1 year, 13 days ago

From Renato Torres to ~emersion/hut-dev

I've used the following command to make a reply to the previous patch thread:

git send-email -v3 --cover-letter --reply-to=28459 --annotate 8299f10^..8299f10

But for some reason it created a new patch.
Is this expected? If not, what was my mistake?
Thanks.

[PATCH v3 1/1] git: add show 1 year, 13 days ago

From Renato Torres to ~emersion/hut-dev

---
 git.go                          | 95 +++++++++++++++++++++++++++++++++
 srht/gitsrht/gql.go             | 10 ++++
 srht/gitsrht/methods.go         | 16 ++++--
 srht/gitsrht/operations.graphql | 56 +++++++++++++++++++
 4 files changed, 173 insertions(+), 4 deletions(-)

diff --git a/git.go b/git.go
index 6dfe0d2..ebb6318 100644
--- a/git.go
+++ b/git.go
@@ -4,6 +4,7 @@ import (
	"context"
	"fmt"
[message trimmed]

[PATCH v3 0/1] git: add show 1 year, 13 days ago

From Renato Torres to ~emersion/hut-dev

Here's v3.

> Yes, please always rebase before sending. This ensures the reviewer
> won't have trouble applying your patch.
Done.

> Please don't add editor-specific files to .gitignore. Instead,
> you can use a global gitignore file which will apply to all of
> your Git repos.
Done.

> I think we can remove the ID, it's not very useful. We've removed it
> from `hut git list` already.
Done.

[PATCH v2 1/1] git: add show 1 year, 17 days ago

From Renato Torres to ~emersion/hut-dev

From: Renato Torres <renato.torres@outsystems.com>

---
 .gitignore                      |  1 +
 git.go                          | 89 +++++++++++++++++++++++++++++++++
 srht/gitsrht/gql.go             | 10 ++++
 srht/gitsrht/methods.go         | 16 ++++--
 srht/gitsrht/operations.graphql | 51 +++++++++++++++++++
 5 files changed, 163 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5f86a83..05b34cb 100644
--- a/.gitignore
+++ b/.gitignore
[message trimmed]

[PATCH v2 0/1] git: add show 1 year, 17 days ago

From Renato Torres to ~emersion/hut-dev

I'm new to git send-mail and sourcehut - I still don't know how to
update the previous patch.

For reference, the previous patch is [1].

For the previous patch I have used the web UI and now I'm trying
to use the command line (and replying after with aerc).

Also, as I'm working in a personal fork, I'm not sure if I had to 
rebase using the upstream repository (~emersion/hut) before sending
this patch.

Please advise so next time can I do it correctly.