From bcdf221ca724cba7c9126b3d9eb6125987ec7699 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Fri, 28 Jun 2024 18:24:40 +0000
Subject: [PATCH 01/50] Update version for new devel version
Signed-off-by: Nico Sonack
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 429e3463..7faaf71d 100755
--- a/configure
+++ b/configure
@@ -4,7 +4,7 @@
CONFIGURE_CMD_ARGS="${*}"
-PACKAGE_VERSION="2.4.0-devel"
+PACKAGE_VERSION="2.5.0-devel"
PACKAGE_DATE="UNRELEASED"
PACKAGE_STRING="gcli $PACKAGE_VERSION"
PACKAGE_BUGREPORT="https://lists.sr.ht/~herrhotzenplotz/gcli-discuss"
From 04f49f0f92bc797032ddf5e6b351bccd18798d74 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 17:29:46 +0200
Subject: [PATCH 02/50] changelog: add new unreleased version
Signed-off-by: Nico Sonack
---
Changelog.md | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Changelog.md b/Changelog.md
index eb53925e..6c8f306a 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -2,6 +2,16 @@
This changelog does not follow semantic versioning.
+## UNRELEASED
+
+### Added
+
+### Fixed
+
+### Changed
+
+### Removed
+
## 2.4.0 (2024-June-28)
### Added
From d485941ee8bac9f1c233dc0f49df935792c9750c Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:04 +0200
Subject: [PATCH 03/50] ui: print comment ids in comment list
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
src/cmd/comment.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/cmd/comment.c b/src/cmd/comment.c
index be72e765..8f258117 100644
--- a/src/cmd/comment.c
+++ b/src/cmd/comment.c
@@ -166,9 +166,11 @@ gcli_print_comment_list(struct gcli_comment_list const *const list)
{
for (size_t i = 0; i < list->comments_size; ++i) {
printf("AUTHOR : %s%s%s\n"
- "DATE : %s\n",
+ "DATE : %s\n"
+ "ID : %"PRIid"\n",
gcli_setbold(), list->comments[i].author, gcli_resetbold(),
- list->comments[i].date);
+ list->comments[i].date,
+ list->comments[i].id);
pretty_print(list->comments[i].body, 9, 80, stdout);
putchar('\n');
}
From 53b0207b2907b8c5ef8f972088c510b6c9e09445 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:05 +0200
Subject: [PATCH 04/50] comments: const-ptrify submit options struct
This allows for better optimisations due to avoided copy through the
stack. Also, it aligns better with our code style.
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
include/gcli/comments.h | 2 +-
include/gcli/forges.h | 2 +-
include/gcli/gitea/comments.h | 2 +-
include/gcli/github/comments.h | 2 +-
include/gcli/gitlab/comments.h | 2 +-
src/cmd/comment.c | 2 +-
src/comments.c | 2 +-
src/gitea/comments.c | 3 ++-
src/github/comments.c | 10 +++++-----
src/gitlab/comments.c | 13 +++++++------
src/gitlab/merge_requests.c | 4 ++--
11 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/include/gcli/comments.h b/include/gcli/comments.h
index f82b6363..1cc29eca 100644
--- a/include/gcli/comments.h
+++ b/include/gcli/comments.h
@@ -72,6 +72,6 @@ int gcli_get_pull_comments(struct gcli_ctx *ctx, char const *owner,
char const *repo, gcli_id issue,
struct gcli_comment_list *out);
-int gcli_comment_submit(struct gcli_ctx *ctx, struct gcli_submit_comment_opts opts);
+int gcli_comment_submit(struct gcli_ctx *ctx, struct gcli_submit_comment_opts const *opts);
#endif /* COMMENTS_H */
diff --git a/include/gcli/forges.h b/include/gcli/forges.h
index 2e191261..4fc8890e 100644
--- a/include/gcli/forges.h
+++ b/include/gcli/forges.h
@@ -59,7 +59,7 @@ struct gcli_forge_descriptor {
* Submit a comment to a pull/mr or issue */
int (*perform_submit_comment)(
struct gcli_ctx *ctx,
- struct gcli_submit_comment_opts opts);
+ struct gcli_submit_comment_opts const *opts);
/**
* List comments on the given issue */
diff --git a/include/gcli/gitea/comments.h b/include/gcli/gitea/comments.h
index 04c0f03c..56ec3367 100644
--- a/include/gcli/gitea/comments.h
+++ b/include/gcli/gitea/comments.h
@@ -41,6 +41,6 @@ int gitea_get_comments(struct gcli_ctx *ctx, char const *owner, char const *repo
gcli_id issue, struct gcli_comment_list *out);
int gitea_perform_submit_comment(struct gcli_ctx *ctx,
- struct gcli_submit_comment_opts opts);
+ struct gcli_submit_comment_opts const *opts);
#endif /* GITEA_COMMENTS_H */
diff --git a/include/gcli/github/comments.h b/include/gcli/github/comments.h
index dc1a6c53..2325b663 100644
--- a/include/gcli/github/comments.h
+++ b/include/gcli/github/comments.h
@@ -38,7 +38,7 @@
#include
int github_perform_submit_comment(struct gcli_ctx *ctx,
- struct gcli_submit_comment_opts opts);
+ struct gcli_submit_comment_opts const *opts);
int github_get_comments(struct gcli_ctx *ctx, char const *owner, char const *repo,
gcli_id issue, struct gcli_comment_list *out);
diff --git a/include/gcli/gitlab/comments.h b/include/gcli/gitlab/comments.h
index c886519d..3f71dbbf 100644
--- a/include/gcli/gitlab/comments.h
+++ b/include/gcli/gitlab/comments.h
@@ -38,7 +38,7 @@
#include
int gitlab_perform_submit_comment(struct gcli_ctx *ctx,
- struct gcli_submit_comment_opts opts);
+ struct gcli_submit_comment_opts const *opts);
int gitlab_get_issue_comments(struct gcli_ctx *ctx, char const *owner,
char const *repo, gcli_id issue,
diff --git a/src/cmd/comment.c b/src/cmd/comment.c
index 8f258117..c987e0f4 100644
--- a/src/cmd/comment.c
+++ b/src/cmd/comment.c
@@ -121,7 +121,7 @@ comment_submit(struct gcli_submit_comment_opts opts, int always_yes)
errx(1, "Aborted by user");
}
- rc = gcli_comment_submit(g_clictx, opts);
+ rc = gcli_comment_submit(g_clictx, &opts);
free(message);
opts.message = NULL;
diff --git a/src/comments.c b/src/comments.c
index 169f228c..bbbbf1e0 100644
--- a/src/comments.c
+++ b/src/comments.c
@@ -70,7 +70,7 @@ gcli_get_pull_comments(struct gcli_ctx *ctx, char const *owner, char const *repo
}
int
-gcli_comment_submit(struct gcli_ctx *ctx, struct gcli_submit_comment_opts opts)
+gcli_comment_submit(struct gcli_ctx *ctx, struct gcli_submit_comment_opts const *const opts)
{
gcli_null_check_call(perform_submit_comment, ctx, opts);
}
diff --git a/src/gitea/comments.c b/src/gitea/comments.c
index 36e18368..ecd02287 100644
--- a/src/gitea/comments.c
+++ b/src/gitea/comments.c
@@ -38,7 +38,8 @@ gitea_get_comments(struct gcli_ctx *ctx, char const *owner, char const *repo,
}
int
-gitea_perform_submit_comment(struct gcli_ctx *ctx, struct gcli_submit_comment_opts opts)
+gitea_perform_submit_comment(struct gcli_ctx *ctx,
+ struct gcli_submit_comment_opts const *const opts)
{
return github_perform_submit_comment(ctx, opts);
}
diff --git a/src/github/comments.c b/src/github/comments.c
index 6b2f9698..a17865bb 100644
--- a/src/github/comments.c
+++ b/src/github/comments.c
@@ -38,19 +38,19 @@
int
github_perform_submit_comment(struct gcli_ctx *ctx,
- struct gcli_submit_comment_opts opts)
+ struct gcli_submit_comment_opts const *const opts)
{
int rc = 0;
struct gcli_jsongen gen = {0};
- char *e_owner = gcli_urlencode(opts.owner);
- char *e_repo = gcli_urlencode(opts.repo);
+ char *e_owner = gcli_urlencode(opts->owner);
+ char *e_repo = gcli_urlencode(opts->repo);
char *payload = NULL, *url = NULL;
gcli_jsongen_init(&gen);
gcli_jsongen_begin_object(&gen);
{
gcli_jsongen_objmember(&gen, "body");
- gcli_jsongen_string(&gen, opts.message);
+ gcli_jsongen_string(&gen, opts->message);
}
gcli_jsongen_end_object(&gen);
@@ -58,7 +58,7 @@ github_perform_submit_comment(struct gcli_ctx *ctx,
gcli_jsongen_free(&gen);
url = sn_asprintf("%s/repos/%s/%s/issues/%"PRIid"/comments",
- gcli_get_apibase(ctx), e_owner, e_repo, opts.target_id);
+ gcli_get_apibase(ctx), e_owner, e_repo, opts->target_id);
rc = gcli_fetch_with_method(ctx, "POST", url, payload, NULL, NULL);
diff --git a/src/gitlab/comments.c b/src/gitlab/comments.c
index 22885c43..fde9fd9e 100644
--- a/src/gitlab/comments.c
+++ b/src/gitlab/comments.c
@@ -35,17 +35,18 @@
#include
int
-gitlab_perform_submit_comment(struct gcli_ctx *ctx, struct gcli_submit_comment_opts opts)
+gitlab_perform_submit_comment(struct gcli_ctx *ctx,
+ struct gcli_submit_comment_opts const *const opts)
{
char *url = NULL, *payload = NULL, *e_owner = NULL, *e_repo = NULL;
char const *type = NULL;
struct gcli_jsongen gen = {0};
int rc = 0;
- e_owner = gcli_urlencode(opts.owner);
- e_repo = gcli_urlencode(opts.repo);
+ e_owner = gcli_urlencode(opts->owner);
+ e_repo = gcli_urlencode(opts->repo);
- switch (opts.target_type) {
+ switch (opts->target_type) {
case ISSUE_COMMENT:
type = "issues";
break;
@@ -58,7 +59,7 @@ gitlab_perform_submit_comment(struct gcli_ctx *ctx, struct gcli_submit_comment_o
gcli_jsongen_begin_object(&gen);
{
gcli_jsongen_objmember(&gen, "body");
- gcli_jsongen_string(&gen, opts.message);
+ gcli_jsongen_string(&gen, opts->message);
}
gcli_jsongen_end_object(&gen);
@@ -67,7 +68,7 @@ gitlab_perform_submit_comment(struct gcli_ctx *ctx, struct gcli_submit_comment_o
url = sn_asprintf("%s/projects/%s%%2F%s/%s/%"PRIid"/notes",
gcli_get_apibase(ctx), e_owner, e_repo, type,
- opts.target_id);
+ opts->target_id);
rc = gcli_fetch_with_method(ctx, "POST", url, payload, NULL, NULL);
diff --git a/src/gitlab/merge_requests.c b/src/gitlab/merge_requests.c
index 325bb336..6eff06bf 100644
--- a/src/gitlab/merge_requests.c
+++ b/src/gitlab/merge_requests.c
@@ -1147,7 +1147,7 @@ post_diff_comment(struct gcli_ctx *ctx,
int
gitlab_mr_create_review(struct gcli_ctx *ctx,
- struct gcli_pull_create_review_details const *details)
+ struct gcli_pull_create_review_details const *const details)
{
int rc;
struct gcli_diff_comment const *comment;
@@ -1172,7 +1172,7 @@ gitlab_mr_create_review(struct gcli_ctx *ctx,
.message = details->body,
};
- rc = gitlab_perform_submit_comment(ctx, opts);
+ rc = gitlab_perform_submit_comment(ctx, &opts);
if (rc < 0)
return rc;
}
From 4cfd1917623e8fac5e00256ee9445b1d52f52c4d Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:06 +0200
Subject: [PATCH 05/50] comments: add routine for fetching a specific issue
comment
Also adds an implementation for GitLab as I am currently testing with
it. This will in the end be used for replies to comments.
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
include/gcli/comments.h | 4 +++
include/gcli/forges.h | 10 ++++++++
include/gcli/gitlab/comments.h | 4 +++
src/comments.c | 8 ++++++
src/forges.c | 1 +
src/gitlab/comments.c | 47 ++++++++++++++++++++++++++++++++++
6 files changed, 74 insertions(+)
diff --git a/include/gcli/comments.h b/include/gcli/comments.h
index 1cc29eca..b91b555d 100644
--- a/include/gcli/comments.h
+++ b/include/gcli/comments.h
@@ -64,6 +64,10 @@ void gcli_comments_free(struct gcli_comment_list *list);
void gcli_comment_free(struct gcli_comment *const it);
+int gcli_get_issue_comment(struct gcli_ctx *ctx, char const *owner, char const *repo,
+ gcli_id issue_id, gcli_id comment_id,
+ struct gcli_comment *out);
+
int gcli_get_issue_comments(struct gcli_ctx *ctx, char const *owner,
char const *repo, gcli_id issue,
struct gcli_comment_list *out);
diff --git a/include/gcli/forges.h b/include/gcli/forges.h
index 4fc8890e..2a0e700d 100644
--- a/include/gcli/forges.h
+++ b/include/gcli/forges.h
@@ -79,6 +79,16 @@ struct gcli_forge_descriptor {
gcli_id pr,
struct gcli_comment_list *out);
+ /**
+ * Get a specific comment on an issue with the given ID */
+ int (*get_issue_comment)(
+ struct gcli_ctx *ctx,
+ char const *owner,
+ char const *repo,
+ gcli_id issue_id,
+ gcli_id comment_id,
+ struct gcli_comment *out);
+
/**
* List forks of the given repo */
int (*get_forks)(
diff --git a/include/gcli/gitlab/comments.h b/include/gcli/gitlab/comments.h
index 3f71dbbf..7cadc6a7 100644
--- a/include/gcli/gitlab/comments.h
+++ b/include/gcli/gitlab/comments.h
@@ -40,6 +40,10 @@
int gitlab_perform_submit_comment(struct gcli_ctx *ctx,
struct gcli_submit_comment_opts const *opts);
+int gitlab_get_issue_comment(struct gcli_ctx *ctx, char const *owner,
+ char const *repo, gcli_id issue_id,
+ gcli_id comment_id, struct gcli_comment *out);
+
int gitlab_get_issue_comments(struct gcli_ctx *ctx, char const *owner,
char const *repo, gcli_id issue,
struct gcli_comment_list *out);
diff --git a/src/comments.c b/src/comments.c
index bbbbf1e0..54c1337b 100644
--- a/src/comments.c
+++ b/src/comments.c
@@ -55,6 +55,14 @@ gcli_comments_free(struct gcli_comment_list *const list)
list->comments_size = 0;
}
+int
+gcli_get_issue_comment(struct gcli_ctx *ctx, char const *const owner,
+ char const *repo, gcli_id const issue_id,
+ gcli_id const comment_id, struct gcli_comment *const out)
+{
+ gcli_null_check_call(get_issue_comment, ctx, owner, repo, issue_id, comment_id, out);
+}
+
int
gcli_get_issue_comments(struct gcli_ctx *ctx, char const *owner, char const *repo,
gcli_id const issue, struct gcli_comment_list *out)
diff --git a/src/forges.c b/src/forges.c
index 5aa2bc04..b1194ba6 100644
--- a/src/forges.c
+++ b/src/forges.c
@@ -178,6 +178,7 @@ static struct gcli_forge_descriptor const
gitlab_forge_descriptor =
{
/* Comments */
+ .get_issue_comment = gitlab_get_issue_comment,
.get_issue_comments = gitlab_get_issue_comments,
.get_pull_comments = gitlab_get_mr_comments,
.perform_submit_comment = gitlab_perform_submit_comment,
diff --git a/src/gitlab/comments.c b/src/gitlab/comments.c
index fde9fd9e..403d4dee 100644
--- a/src/gitlab/comments.c
+++ b/src/gitlab/comments.c
@@ -149,3 +149,50 @@ gitlab_get_issue_comments(struct gcli_ctx *ctx, char const *owner,
return gitlab_fetch_comments(ctx, url, out);
}
+
+static int
+gitlab_fetch_comment(struct gcli_ctx *ctx, char const *const url,
+ struct gcli_comment *const out)
+{
+ int rc = 0;
+ struct gcli_fetch_buffer buffer = {0};
+ struct json_stream stream = {0};
+
+ rc = gcli_fetch(ctx, url, NULL, &buffer);
+ if (rc < 0)
+ return rc;
+
+ json_open_buffer(&stream, buffer.data, buffer.length);
+ rc = parse_gitlab_comment(ctx, &stream, out);
+ json_close(&stream);
+
+ gcli_fetch_buffer_free(&buffer);
+
+ return rc;
+}
+
+int
+gitlab_get_issue_comment(struct gcli_ctx *ctx, char const *const owner,
+ char const *const repo, gcli_id const issue_id,
+ gcli_id const comment_id,
+ struct gcli_comment *const out)
+{
+ char *url, *e_owner, *e_repo;
+ int rc;
+
+ e_owner = gcli_urlencode(owner);
+ e_repo = gcli_urlencode(repo);
+
+ url = sn_asprintf("%s/projects/%s%%2F%s/issues/%"PRIid"/notes/%"PRIid,
+ gcli_get_apibase(ctx), e_owner, e_repo, issue_id,
+ comment_id);
+
+ free(e_owner);
+ free(e_repo);
+
+ rc = gitlab_fetch_comment(ctx, url, out);
+
+ free(url);
+
+ return rc;
+}
From 76b22bbb9926c682851ff320ab7e1e92307cb805 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:07 +0200
Subject: [PATCH 06/50] comments: add new reply-to option
When specifying -R to the comment subcommand this will
now fetch the comment and put it into the file prefixed with '> ' such
that one can easily reply to it. Currently it only works with issues
and merge requests on GitLab but I will extend it for other use cases
too.
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
include/gcli/comments.h | 6 +-
include/gcli/forges.h | 7 ++-
include/gcli/gitlab/comments.h | 7 ++-
src/cmd/comment.c | 101 ++++++++++++++++++++++++---------
src/comments.c | 9 +--
src/forges.c | 2 +-
src/gitlab/comments.c | 24 +++++---
7 files changed, 107 insertions(+), 49 deletions(-)
diff --git a/include/gcli/comments.h b/include/gcli/comments.h
index b91b555d..4e508cd5 100644
--- a/include/gcli/comments.h
+++ b/include/gcli/comments.h
@@ -64,9 +64,9 @@ void gcli_comments_free(struct gcli_comment_list *list);
void gcli_comment_free(struct gcli_comment *const it);
-int gcli_get_issue_comment(struct gcli_ctx *ctx, char const *owner, char const *repo,
- gcli_id issue_id, gcli_id comment_id,
- struct gcli_comment *out);
+int gcli_get_comment(struct gcli_ctx *ctx, char const *owner, char const *repo,
+ enum comment_target_type target_type, gcli_id target_id,
+ gcli_id comment_id, struct gcli_comment *out);
int gcli_get_issue_comments(struct gcli_ctx *ctx, char const *owner,
char const *repo, gcli_id issue,
diff --git a/include/gcli/forges.h b/include/gcli/forges.h
index 2a0e700d..420f562b 100644
--- a/include/gcli/forges.h
+++ b/include/gcli/forges.h
@@ -80,12 +80,13 @@ struct gcli_forge_descriptor {
struct gcli_comment_list *out);
/**
- * Get a specific comment on an issue with the given ID */
- int (*get_issue_comment)(
+ * Get a specific comment on an issue or pull request with the given ID */
+ int (*get_comment)(
struct gcli_ctx *ctx,
char const *owner,
char const *repo,
- gcli_id issue_id,
+ enum comment_target_type target_type,
+ gcli_id target_id,
gcli_id comment_id,
struct gcli_comment *out);
diff --git a/include/gcli/gitlab/comments.h b/include/gcli/gitlab/comments.h
index 7cadc6a7..68932eb9 100644
--- a/include/gcli/gitlab/comments.h
+++ b/include/gcli/gitlab/comments.h
@@ -40,9 +40,10 @@
int gitlab_perform_submit_comment(struct gcli_ctx *ctx,
struct gcli_submit_comment_opts const *opts);
-int gitlab_get_issue_comment(struct gcli_ctx *ctx, char const *owner,
- char const *repo, gcli_id issue_id,
- gcli_id comment_id, struct gcli_comment *out);
+int gitlab_get_comment(struct gcli_ctx *ctx, char const *owner,
+ char const *repo, enum comment_target_type target_type,
+ gcli_id issue_id, gcli_id comment_id,
+ struct gcli_comment *out);
int gitlab_get_issue_comments(struct gcli_ctx *ctx, char const *owner,
char const *repo, gcli_id issue,
diff --git a/src/cmd/comment.c b/src/cmd/comment.c
index c987e0f4..9a1b63e4 100644
--- a/src/cmd/comment.c
+++ b/src/cmd/comment.c
@@ -52,18 +52,42 @@ usage(void)
fprintf(stderr, " -r repo The repository name\n");
fprintf(stderr, " -p pr PR id to comment under\n");
fprintf(stderr, " -i issue issue id to comment under\n");
+ fprintf(stderr, " -R comment-id Reply to the comment with the given ID\n");
fprintf(stderr, " -y Do not ask for confirmation\n");
version();
copyright();
}
+struct submit_ctx {
+ struct gcli_submit_comment_opts opts;
+ struct gcli_comment reply_comment;
+};
+
+void
+gcli_print_prefixed(FILE *f, char const *const text, char const *const prefix)
+{
+ char const *bol = text;
+
+ while (bol) {
+ char const *const eol = strchr(bol, '\n');
+ size_t const len = eol ? (size_t)(eol - bol) : strlen(bol);
+
+ fprintf(f, "%s%.*s\n", prefix, (int)len, bol);
+
+ if (!eol)
+ break;
+
+ bol = eol + 1;
+ }
+}
+
static void
comment_init(struct gcli_ctx *ctx, FILE *f, void *_data)
{
- struct gcli_submit_comment_opts *info = _data;
+ struct submit_ctx *sctx = _data;
const char *target_type = NULL;
- switch (info->target_type) {
+ switch (sctx->opts.target_type) {
case ISSUE_COMMENT:
target_type = "issue";
break;
@@ -84,29 +108,34 @@ comment_init(struct gcli_ctx *ctx, FILE *f, void *_data)
} break;
}
+ /* In case we reply to a comment, put the comment prefixed with
+ * '> ' into the file first. */
+ if (sctx->reply_comment.body)
+ gcli_print_prefixed(f, sctx->reply_comment.body, "> ");
+
fprintf(
f,
"! Enter your comment above, save and exit.\n"
"! All lines with a leading '!' are discarded and will not\n"
"! appear in your comment.\n"
"! COMMENT IN : %s/%s %s #%"PRIid"\n",
- info->owner, info->repo, target_type, info->target_id);
+ sctx->opts.owner, sctx->opts.repo, target_type, sctx->opts.target_id);
}
static char *
-gcli_comment_get_message(struct gcli_submit_comment_opts *info)
+gcli_comment_get_message(struct submit_ctx *info)
{
return gcli_editor_get_user_message(g_clictx, comment_init, info);
}
static int
-comment_submit(struct gcli_submit_comment_opts opts, int always_yes)
+comment_submit(struct submit_ctx *sctx, int always_yes)
{
int rc = 0;
char *message;
- message = gcli_comment_get_message(&opts);
- opts.message = message;
+ message = gcli_comment_get_message(sctx);
+ sctx->opts.message = message;
if (message == NULL)
errx(1, "gcli: empty message. aborting.");
@@ -114,17 +143,17 @@ comment_submit(struct gcli_submit_comment_opts opts, int always_yes)
fprintf(
stdout,
"You will be commenting the following in %s/%s #%"PRIid":\n%s\n",
- opts.owner, opts.repo, opts.target_id, opts.message);
+ sctx->opts.owner, sctx->opts.repo, sctx->opts.target_id, sctx->opts.message);
if (!always_yes) {
if (!sn_yesno("Is this okay?"))
errx(1, "Aborted by user");
}
- rc = gcli_comment_submit(g_clictx, &opts);
+ rc = gcli_comment_submit(g_clictx, &sctx->opts);
free(message);
- opts.message = NULL;
+ sctx->opts.message = NULL;
return rc;
}
@@ -179,10 +208,10 @@ gcli_print_comment_list(struct gcli_comment_list const *const list)
int
subcommand_comment(int argc, char *argv[])
{
- int ch, target_id = -1, rc = 0;
- char const *repo = NULL, *owner = NULL;
+ int ch, rc = 0;
+ struct submit_ctx sctx = {0};
bool always_yes = false;
- enum comment_target_type target_type;
+ gcli_id reply_to_id = 0;
struct option const options[] = {
{ .name = "yes",
@@ -205,31 +234,41 @@ subcommand_comment(int argc, char *argv[])
.has_arg = required_argument,
.flag = NULL,
.val = 'p' },
+ { .name = "in-reply-to",
+ .has_arg = required_argument,
+ .flag = NULL,
+ .val = 'R' },
{0},
};
- while ((ch = getopt_long(argc, argv, "yr:o:i:p:", options, NULL)) != -1) {
+ while ((ch = getopt_long(argc, argv, "yr:o:i:p:R:", options, NULL)) != -1) {
switch (ch) {
case 'r':
- repo = optarg;
+ sctx.opts.repo = optarg;
break;
case 'o':
- owner = optarg;
+ sctx.opts.owner = optarg;
break;
case 'p':
- target_type = PR_COMMENT;
+ sctx.opts.target_type = PR_COMMENT;
goto parse_target_id;
case 'i':
- target_type = ISSUE_COMMENT;
+ sctx.opts.target_type = ISSUE_COMMENT;
parse_target_id: {
char *endptr;
- target_id = strtoul(optarg, &endptr, 10);
+ sctx.opts.target_id = strtoul(optarg, &endptr, 10);
if (endptr != optarg + strlen(optarg))
err(1, "gcli: error: Cannot parse issue/PR number");
} break;
case 'y':
always_yes = true;
break;
+ case 'R': {
+ char *endptr = NULL;
+ reply_to_id = strtoul(optarg, &endptr, 10);
+ if (endptr != optarg + strlen(optarg))
+ err(1, "gcli: error: cannot parse comment id");
+ } break;
default:
usage();
return EXIT_FAILURE;
@@ -239,20 +278,28 @@ subcommand_comment(int argc, char *argv[])
argc -= optind;
argv += optind;
- check_owner_and_repo(&owner, &repo);
+ check_owner_and_repo(&sctx.opts.owner, &sctx.opts.repo);
- if (target_id < 0) {
+ if (!sctx.opts.target_id) {
fprintf(stderr, "gcli: error: missing issue/PR number (use -i/-p)\n");
usage();
return EXIT_FAILURE;
}
- rc = comment_submit((struct gcli_submit_comment_opts) {
- .owner = owner,
- .repo = repo,
- .target_type = target_type,
- .target_id = target_id },
- always_yes);
+ if (reply_to_id) {
+ rc = gcli_get_comment(g_clictx, sctx.opts.owner, sctx.opts.repo,
+ sctx.opts.target_type, sctx.opts.target_id,
+ reply_to_id, &sctx.reply_comment);
+
+ if (rc < 0) {
+ errx(1, "gcli: error: failed to fetch comment for reply: %s",
+ gcli_get_error(g_clictx));
+ }
+ }
+
+ rc = comment_submit(&sctx, always_yes);
+
+ gcli_comment_free(&sctx.reply_comment);
if (rc < 0)
errx(1, "gcli: error: failed to submit comment: %s", gcli_get_error(g_clictx));
diff --git a/src/comments.c b/src/comments.c
index 54c1337b..10206055 100644
--- a/src/comments.c
+++ b/src/comments.c
@@ -56,11 +56,12 @@ gcli_comments_free(struct gcli_comment_list *const list)
}
int
-gcli_get_issue_comment(struct gcli_ctx *ctx, char const *const owner,
- char const *repo, gcli_id const issue_id,
- gcli_id const comment_id, struct gcli_comment *const out)
+gcli_get_comment(struct gcli_ctx *ctx, char const *owner, char const *repo,
+ enum comment_target_type target_type, gcli_id target_id,
+ gcli_id comment_id, struct gcli_comment *out)
{
- gcli_null_check_call(get_issue_comment, ctx, owner, repo, issue_id, comment_id, out);
+ gcli_null_check_call(get_comment, ctx, owner, repo, target_type, target_id,
+ comment_id, out);
}
int
diff --git a/src/forges.c b/src/forges.c
index b1194ba6..8685aca5 100644
--- a/src/forges.c
+++ b/src/forges.c
@@ -178,7 +178,7 @@ static struct gcli_forge_descriptor const
gitlab_forge_descriptor =
{
/* Comments */
- .get_issue_comment = gitlab_get_issue_comment,
+ .get_comment = gitlab_get_comment,
.get_issue_comments = gitlab_get_issue_comments,
.get_pull_comments = gitlab_get_mr_comments,
.perform_submit_comment = gitlab_perform_submit_comment,
diff --git a/src/gitlab/comments.c b/src/gitlab/comments.c
index 403d4dee..612980e6 100644
--- a/src/gitlab/comments.c
+++ b/src/gitlab/comments.c
@@ -172,20 +172,28 @@ gitlab_fetch_comment(struct gcli_ctx *ctx, char const *const url,
}
int
-gitlab_get_issue_comment(struct gcli_ctx *ctx, char const *const owner,
- char const *const repo, gcli_id const issue_id,
- gcli_id const comment_id,
- struct gcli_comment *const out)
+gitlab_get_comment(struct gcli_ctx *ctx, char const *const owner, char const *const repo,
+ enum comment_target_type const target_type, gcli_id const target_id,
+ gcli_id const comment_id, struct gcli_comment *const out)
{
- char *url, *e_owner, *e_repo;
+ char *url, *e_owner, *e_repo, *target_str;
int rc;
e_owner = gcli_urlencode(owner);
e_repo = gcli_urlencode(repo);
- url = sn_asprintf("%s/projects/%s%%2F%s/issues/%"PRIid"/notes/%"PRIid,
- gcli_get_apibase(ctx), e_owner, e_repo, issue_id,
- comment_id);
+ switch (target_type) {
+ case ISSUE_COMMENT:
+ target_str = "issues";
+ break;
+ case PR_COMMENT:
+ target_str = "merge_requests";
+ break;
+ }
+
+ url = sn_asprintf("%s/projects/%s%%2F%s/%s/%"PRIid"/notes/%"PRIid,
+ gcli_get_apibase(ctx), e_owner, e_repo, target_str,
+ target_id, comment_id);
free(e_owner);
free(e_repo);
From 9033182419725c53d2a617eb3cd5ab6eac27bffc Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:08 +0200
Subject: [PATCH 07/50] github: implement fetching a single comment
This allows the -R option in the subcommand to work for GitHub too.
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
include/gcli/github/comments.h | 4 +++
src/forges.c | 1 +
src/github/comments.c | 49 ++++++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+)
diff --git a/include/gcli/github/comments.h b/include/gcli/github/comments.h
index 2325b663..0ce2c50e 100644
--- a/include/gcli/github/comments.h
+++ b/include/gcli/github/comments.h
@@ -46,4 +46,8 @@ int github_get_comments(struct gcli_ctx *ctx, char const *owner, char const *rep
int github_fetch_comments(struct gcli_ctx *ctx, char *url,
struct gcli_comment_list *const out);
+int github_get_comment(struct gcli_ctx *ctx, char const *repo, char const *owner,
+ enum comment_target_type target_type, gcli_id target_id,
+ gcli_id comment_id, struct gcli_comment *out);
+
#endif /* GITHUB_COMMENTS_H */
diff --git a/src/forges.c b/src/forges.c
index 8685aca5..c3d40f59 100644
--- a/src/forges.c
+++ b/src/forges.c
@@ -79,6 +79,7 @@ static struct gcli_forge_descriptor const
github_forge_descriptor =
{
/* Comments */
+ .get_comment = github_get_comment,
.get_issue_comments = github_get_comments,
.get_pull_comments = github_get_comments,
.perform_submit_comment = github_perform_submit_comment,
diff --git a/src/github/comments.c b/src/github/comments.c
index a17865bb..a2d04899 100644
--- a/src/github/comments.c
+++ b/src/github/comments.c
@@ -103,3 +103,52 @@ github_get_comments(struct gcli_ctx *ctx, char const *owner, char const *repo,
return github_fetch_comments(ctx, url, out);
}
+
+static int
+github_fetch_comment(struct gcli_ctx *ctx, char const *const url,
+ struct gcli_comment *const out)
+{
+ struct gcli_fetch_buffer buffer = {0};
+ struct json_stream stream = {0};
+ int rc = 0;
+
+ rc = gcli_fetch(ctx, url, NULL, &buffer);
+ if (rc < 0)
+ return rc;
+
+ json_open_buffer(&stream, buffer.data, buffer.length);
+ rc = parse_github_comment(ctx, &stream, out);
+ json_close(&stream);
+
+ gcli_fetch_buffer_free(&buffer);
+
+ return rc;
+}
+
+int
+github_get_comment(struct gcli_ctx *ctx, char const *owner, char const *repo,
+ enum comment_target_type target_type, gcli_id target_id,
+ gcli_id comment_id, struct gcli_comment *out)
+{
+ char *e_owner = NULL, *e_repo = NULL, *url = NULL;
+ int rc = 0;
+
+ (void) target_type; /* target type and id ignored as pull requests are issues on GitHub */
+ (void) target_id;
+
+ e_owner = gcli_urlencode(owner);
+ e_repo = gcli_urlencode(repo);
+
+ url = sn_asprintf("%s/repos/%s/%s/issues/comments/%"PRIid,
+ gcli_get_apibase(ctx), e_owner, e_repo,
+ comment_id);
+
+ free(e_owner);
+ free(e_repo);
+
+ rc = github_fetch_comment(ctx, url, out);
+
+ free(url);
+
+ return rc;
+}
From 105ba046142ae704c3ab330ddcc9755bbd83bce3 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:09 +0200
Subject: [PATCH 08/50] gitea: implement fetching a single comment
With this we can reply easily to comments on Gitea (comment -R
option).
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
include/gcli/gitea/comments.h | 5 +++++
src/forges.c | 1 +
src/gitea/comments.c | 10 ++++++++++
3 files changed, 16 insertions(+)
diff --git a/include/gcli/gitea/comments.h b/include/gcli/gitea/comments.h
index 56ec3367..fa64c5ee 100644
--- a/include/gcli/gitea/comments.h
+++ b/include/gcli/gitea/comments.h
@@ -37,6 +37,11 @@
#include
#include
+int gitea_get_comment(struct gcli_ctx *ctx, char const *owner,
+ char const *repo, enum comment_target_type target_type,
+ gcli_id target_id, gcli_id comment_id,
+ struct gcli_comment *out);
+
int gitea_get_comments(struct gcli_ctx *ctx, char const *owner, char const *repo,
gcli_id issue, struct gcli_comment_list *out);
diff --git a/src/forges.c b/src/forges.c
index c3d40f59..2b113b99 100644
--- a/src/forges.c
+++ b/src/forges.c
@@ -275,6 +275,7 @@ static struct gcli_forge_descriptor const
gitea_forge_descriptor =
{
/* Comments */
+ .get_comment = gitea_get_comment,
.get_issue_comments = gitea_get_comments,
.get_pull_comments = gitea_get_comments,
.perform_submit_comment = gitea_perform_submit_comment,
diff --git a/src/gitea/comments.c b/src/gitea/comments.c
index ecd02287..0bf8393d 100644
--- a/src/gitea/comments.c
+++ b/src/gitea/comments.c
@@ -43,3 +43,13 @@ gitea_perform_submit_comment(struct gcli_ctx *ctx,
{
return github_perform_submit_comment(ctx, opts);
}
+
+int
+gitea_get_comment(struct gcli_ctx *ctx, char const *const owner,
+ char const *const repo, enum comment_target_type target_type,
+ gcli_id const target_id, gcli_id const comment_id,
+ struct gcli_comment *out)
+{
+ return github_get_comment(ctx, owner, repo, target_type, target_id,
+ comment_id, out);
+}
From e63ec1ea86c80cd24860340bd1189d04e4e1a41f Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:10 +0200
Subject: [PATCH 09/50] bugzilla: implement fetching a single bug comment
This allows comment responses for Bugzilla with the newly added -R
flag.
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
include/gcli/bugzilla/bugs-parser.h | 4 ++++
include/gcli/bugzilla/bugs.h | 4 ++++
src/bugzilla/bugs-parser.c | 23 ++++++++++++++++++
src/bugzilla/bugs.c | 37 +++++++++++++++++++++++++++++
src/forges.c | 1 +
templates/bugzilla/bugs.t | 4 ++++
6 files changed, 73 insertions(+)
diff --git a/include/gcli/bugzilla/bugs-parser.h b/include/gcli/bugzilla/bugs-parser.h
index 1da4bbef..baabd64c 100644
--- a/include/gcli/bugzilla/bugs-parser.h
+++ b/include/gcli/bugzilla/bugs-parser.h
@@ -65,4 +65,8 @@ int parse_bugzilla_attachment_content_only_first(struct gcli_ctx *ctx,
struct json_stream *stream,
struct gcli_attachment *out);
+int parse_bugzilla_single_comments_array_only_first(struct gcli_ctx *ctx,
+ struct json_stream *stream,
+ struct gcli_comment *out);
+
#endif /* GCLI_BUGZILLA_BUGS_PARSER_H */
diff --git a/include/gcli/bugzilla/bugs.h b/include/gcli/bugzilla/bugs.h
index 879e3660..5ddf531f 100644
--- a/include/gcli/bugzilla/bugs.h
+++ b/include/gcli/bugzilla/bugs.h
@@ -51,6 +51,10 @@ int bugzilla_bug_get_comments(struct gcli_ctx *const ctx,
char const *const component, gcli_id const bug_id,
struct gcli_comment_list *out);
+int bugzilla_bug_get_comment(struct gcli_ctx *ctx, char const *product, char const *component,
+ enum comment_target_type target_type, gcli_id target_id,
+ gcli_id comment_id, struct gcli_comment *out);
+
int bugzilla_bug_get_attachments(struct gcli_ctx *ctx, char const *const product,
char const *const component,
gcli_id const bug_id,
diff --git a/src/bugzilla/bugs-parser.c b/src/bugzilla/bugs-parser.c
index 4391202e..833180df 100644
--- a/src/bugzilla/bugs-parser.c
+++ b/src/bugzilla/bugs-parser.c
@@ -188,3 +188,26 @@ parse_bugzilla_attachment_content_only_first(struct gcli_ctx *ctx,
return rc;
}
+
+int
+parse_bugzilla_single_comments_array_only_first(struct gcli_ctx *ctx,
+ struct json_stream *stream,
+ struct gcli_comment *out)
+{
+ enum json_type next = JSON_NULL;
+ int rc = 0;
+
+ if ((next = json_next(stream)) != JSON_OBJECT)
+ return gcli_error(ctx, "expected bugzilla comments dictionary");
+
+ while ((next = json_next(stream)) == JSON_STRING) {
+ rc = parse_bugzilla_comment(ctx, stream, out);
+ if (rc < 0)
+ return rc;
+ }
+
+ if (next != JSON_OBJECT_END)
+ return gcli_error(ctx, "unclosed bugzilla comments dictionary");
+
+ return rc;
+}
diff --git a/src/bugzilla/bugs.c b/src/bugzilla/bugs.c
index d354c737..43f3d77e 100644
--- a/src/bugzilla/bugs.c
+++ b/src/bugzilla/bugs.c
@@ -140,6 +140,43 @@ bugzilla_bug_get_comments(struct gcli_ctx *const ctx, char const *const product,
return rc;
}
+int
+bugzilla_bug_get_comment(struct gcli_ctx *const ctx, char const *const product,
+ char const *const component,
+ enum comment_target_type const target_type,
+ gcli_id const bug_id, gcli_id const comment_id,
+ struct gcli_comment *const out)
+{
+ char *url = NULL;
+ int rc = 0;
+ struct gcli_fetch_buffer buffer = {0};
+ struct json_stream stream = {0};
+
+ (void) product;
+ (void) component;
+ (void) target_type;
+ (void) bug_id;
+
+ url = sn_asprintf("%s/rest/bug/comment/%"PRIid"?include_fields=_all",
+ gcli_get_apibase(ctx), comment_id);
+
+ rc = gcli_fetch(ctx, url, NULL, &buffer);
+ if (rc < 0)
+ goto error_fetch;
+
+ json_open_buffer(&stream, buffer.data, buffer.length);
+ rc = parse_bugzilla_single_comment(ctx, &stream, out);
+ json_close(&stream);
+
+ gcli_fetch_buffer_free(&buffer);
+
+error_fetch:
+ free(url);
+
+ return rc;
+
+}
+
static int
bugzilla_bug_get_op(struct gcli_ctx *ctx, gcli_id const bug_id, char **out)
{
diff --git a/src/forges.c b/src/forges.c
index 2b113b99..31ffd110 100644
--- a/src/forges.c
+++ b/src/forges.c
@@ -374,6 +374,7 @@ bugzilla_forge_descriptor =
.search_issues = bugzilla_get_bugs,
.get_issue_summary = bugzilla_get_bug,
.get_issue_comments = bugzilla_bug_get_comments,
+ .get_comment = bugzilla_bug_get_comment,
.get_issue_attachments = bugzilla_bug_get_attachments,
.perform_submit_issue = bugzilla_bug_submit,
.issue_quirks = GCLI_ISSUE_QUIRKS_COMMENTS
diff --git a/templates/bugzilla/bugs.t b/templates/bugzilla/bugs.t
index d10891d7..8983c0d1 100644
--- a/templates/bugzilla/bugs.t
+++ b/templates/bugzilla/bugs.t
@@ -80,3 +80,7 @@ object of struct gcli_attachment with
parser bugzilla_bug_creation_result is
object of gcli_id select "id" as id;
+
+parser bugzilla_single_comment is
+object of struct gcli_comment with
+ ("comments" => use parse_bugzilla_single_comments_array_only_first);
From ee4cfdabc5be6aca11ec2c6fbbd1e88474deab8a Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:11 +0200
Subject: [PATCH 10/50] gcli-comment(1): update for new -R option
This adds the new -R option to the manual page documentation added in:
5da1e5a (comments: add routine for fetching a specific issue comment, 2024-06-30)
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
docs/gcli-comment.1.in | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/gcli-comment.1.in b/docs/gcli-comment.1.in
index a724a583..a670a59f 100644
--- a/docs/gcli-comment.1.in
+++ b/docs/gcli-comment.1.in
@@ -10,6 +10,7 @@
.Op Fl y
.Op Fl o Ar owner Fl r Ar repo
.Op Fl i Ar issue | Fl p Ar PR
+.Op Fl R Ar comment
.Sh DESCRIPTION
.Nm
can be used to add comments in the discussion under issues and pull
@@ -45,6 +46,12 @@ Create the comment under issue
.It Fl p , -pull Ar pr
Create the comment under PR
.Ar #pr .
+.It Fl R , -in-reply-to Ar comment
+Create a reply to the comment with ID
+.Ar comment .
+This will put the refenced comment prefixed with
+.Dq "> "
+into the response file for you to edit.
.El
.Sh EXAMPLES
Comment under PR #11 in the upstream repository:
From 58c1eb2bb0c938b796c187b36b6519895035d02d Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 2 Jul 2024 22:53:12 +0200
Subject: [PATCH 11/50] changelog: add entry for new -R option in comments
subcommand
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
Changelog.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Changelog.md b/Changelog.md
index 6c8f306a..15db4ac7 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -6,6 +6,9 @@ This changelog does not follow semantic versioning.
### Added
+- Added a `-R` flag to the comment subcommand that allows you to
+ reply to a comment with the given ID.
+
### Fixed
### Changed
From 7c2132d1aaa8a7d4d918e24644bc305699b35ddd Mon Sep 17 00:00:00 2001
From: Gavin-John Noonan
Date: Sat, 6 Jul 2024 21:10:28 +0100
Subject: [PATCH 12/50] ci: teach sr.ht to use our new make build sytem
de67a099 ("Fix the CI for the new build system") updated the gitlab ci
code, however forgot to update sr.ht runners.
Signed-off-by: Gavin-John Noonan
---
.builds/alpine.yml | 18 ++++--------------
.builds/debian-stable.yml | 16 +++++-----------
.builds/freebsd.yml | 14 +++-----------
3 files changed, 12 insertions(+), 36 deletions(-)
diff --git a/.builds/alpine.yml b/.builds/alpine.yml
index d67fa09b..93df95b3 100644
--- a/.builds/alpine.yml
+++ b/.builds/alpine.yml
@@ -2,33 +2,23 @@ image: alpine/edge
packages:
- libcurl
- gcc
- - autoconf
- - automake
- - libtool
- make
- pkgconf
- musl-dev
- curl-dev
- flex
- bison
- - xz
- - gzip
- - bzip2
- libbsd-dev
- kyua
- atf-dev
+ - libedit-dev
sources:
- https://git.sr.ht/~herrhotzenplotz/gcli
tasks:
- build: |
cd gcli
- ./autogen.sh
- {
- CFLAGS='-std=c99 -pedantic -Wall -Wextra -Werror' \
- CPPFLAGS='-D_XOPEN_SOURCE=600' \
- ./configure --disable-silent-rules || (cat config.log && exit 42)
- }
- make -j
+ ./configure --debug
+ make -j all
- check: |
cd gcli
- make -j distcheck
+ make -j check
diff --git a/.builds/debian-stable.yml b/.builds/debian-stable.yml
index e3baf612..9f9fd3ef 100644
--- a/.builds/debian-stable.yml
+++ b/.builds/debian-stable.yml
@@ -1,14 +1,12 @@
image: debian/stable
packages:
- build-essential
+ - libssl-dev
- libcurl4-openssl-dev
- pkgconf
- - autotools-dev
- bison
- flex
- make
- - autoconf
- - automake
- libtool
- libbsd-dev
- libatf-dev kyua
@@ -17,13 +15,9 @@ sources:
tasks:
- build: |
cd gcli
- ./autogen.sh
- {
- CFLAGS='-std=c99 -pedantic -Wall -Wextra -Werror' \
- CPPFLAGS='-D_XOPEN_SOURCE=600' \
- ./configure --disable-silent-rules || (cat config.log && exit 42)
- }
- make
+ ./configure --debug
+ make -j 4 all
- check: |
cd gcli
- make distcheck
+ ./configure --debug
+ make -j 4 all
diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml
index e85d65cf..74e801e7 100644
--- a/.builds/freebsd.yml
+++ b/.builds/freebsd.yml
@@ -1,8 +1,6 @@
image: freebsd/14.x
packages:
- atf
- - autoconf
- - automake
- ca_root_nss
- curl
- kyua
@@ -10,7 +8,6 @@ packages:
- libssh2
- libtool
- libunistring
- - m4
- pkg
- pkgconf
- readline
@@ -19,15 +16,10 @@ sources:
tasks:
- build: |
cd gcli
- ./autogen.sh
- {
- CFLAGS='-std=c99 -pedantic -Wall -Wextra -Wno-misleading-indentation -Werror' \
- CPPFLAGS='-D_XOPEN_SOURCE=600' \
- LEX=flex YACC=byacc \
- ./configure --disable-silent-rules || (cat config.log && exit 42)
- }
- make -j 4
+ ./configure --debug
+ make -j 4 all
- check: |
cd gcli
+ ./configure --debug
make -j 4 distcheck
From d741223b8f0032d5ca429cd369ef3a5a10e38689 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Mon, 15 Jul 2024 21:41:17 +0000
Subject: [PATCH 13/50] configure: fix tr(1) calls
tr takes two lists of characters, not two regular expressions as I
mistakenly wrote.
This might fix a bug encountered on macOS.
Signed-off-by: Nico Sonack
Signed-off-by: Gavin-John Noonan
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 7faaf71d..fa912131 100755
--- a/configure
+++ b/configure
@@ -35,7 +35,7 @@ rel_srcdir="$(dirname ${0})"
srcdir="$(${REALPATH} ${rel_srcdir})"
tolower() {
- tr '[[:upper:]]' '[[:lower:]]'
+ tr '[:upper:]' '[:lower:]'
}
die() {
From fd5b92bbdea6ebe953faec01e632f2bf4170b60e Mon Sep 17 00:00:00 2001
From: Gavin-John Noonan
Date: Thu, 18 Jul 2024 18:25:34 +0100
Subject: [PATCH 14/50] cmdconfig: simplify checkyes
Rather than having to lowercase each character during the check, we now
lowercase the whole string first, then check if it is correct.
We don't have many variations of what we consider to be yes.
Signed-off-by: Gavin-John Noonan
Signed-off-by: Nico Sonack
---
src/cmd/cmdconfig.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/cmd/cmdconfig.c b/src/cmd/cmdconfig.c
index d3b7307c..25e88d42 100644
--- a/src/cmd/cmdconfig.c
+++ b/src/cmd/cmdconfig.c
@@ -435,20 +435,20 @@ ensure_config(struct gcli_ctx *ctx)
static int
checkyes(char const *const tmp)
{
- static char const *const yeses[] = { "1", "y", "Y" };
+ size_t tmplen = strlen(tmp) + 1;
+ char *tmp_lower = malloc(tmplen);
- if (strlen(tmp) == 3) {
- if (tolower(tmp[0]) == 'y' && tolower(tmp[1]) == 'e' &&
- tolower(tmp[2]) == 's')
- return 1;
- }
+ strncpy(tmp_lower, tmp, tmplen);
- for (size_t i = 0; i < ARRAY_SIZE(yeses); ++i) {
- if (strcmp(yeses[i], tmp) == 0)
- return 1;
+ for (size_t i = 0; i < tmplen - 1; ++i) {
+ tmp_lower[i] = tolower(tmp_lower[i]);
}
- return 0;
+ int is_yes = strcmp(tmp_lower, "1") == 0 ||
+ strcmp(tmp_lower, "yes") == 0;
+
+ free(tmp_lower);
+ return is_yes;
}
/* readenv: Read values of environment variables and pre-populate the
From 94faf405f96f6175aa43e0503fbbf72b00a452c6 Mon Sep 17 00:00:00 2001
From: Gavin-John Noonan
Date: Thu, 18 Jul 2024 18:25:35 +0100
Subject: [PATCH 15/50] cmdconfig: teach checkyes that true means yes
Currently when parsing config and checking for a truthy value we only
allow a variation of the word "yes" (e.g: yEs, YeS, etc) or the numeral
1, but not actually the word true.
Here we teach the checkyes function to also check for a variation of the
word true (e.g: true, True, TrUe, etc)
Signed-off-by: Gavin-John Noonan
Signed-off-by: Nico Sonack
---
src/cmd/cmdconfig.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cmd/cmdconfig.c b/src/cmd/cmdconfig.c
index 25e88d42..6e764c89 100644
--- a/src/cmd/cmdconfig.c
+++ b/src/cmd/cmdconfig.c
@@ -445,7 +445,8 @@ checkyes(char const *const tmp)
}
int is_yes = strcmp(tmp_lower, "1") == 0 ||
- strcmp(tmp_lower, "yes") == 0;
+ strcmp(tmp_lower, "yes") == 0 ||
+ strcmp(tmp_lower, "true") == 0;
free(tmp_lower);
return is_yes;
From 0348167ca1d2d06ad918a5f0572e1ba374bc5664 Mon Sep 17 00:00:00 2001
From: Gavin-John Noonan
Date: Thu, 18 Jul 2024 18:25:36 +0100
Subject: [PATCH 16/50] cmdconfig: rename checkyes for consistency
Throughout the codebase we generally use snake_case for functions.
Signed-off-by: Gavin-John Noonan
Signed-off-by: Nico Sonack
---
src/cmd/cmdconfig.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/cmd/cmdconfig.c b/src/cmd/cmdconfig.c
index 6e764c89..a48ec08b 100644
--- a/src/cmd/cmdconfig.c
+++ b/src/cmd/cmdconfig.c
@@ -433,7 +433,7 @@ ensure_config(struct gcli_ctx *ctx)
/** Check input for a value that indicates yes/true */
static int
-checkyes(char const *const tmp)
+check_yes(char const *const tmp)
{
size_t tmplen = strlen(tmp) + 1;
char *tmp_lower = malloc(tmplen);
@@ -474,13 +474,13 @@ readenv(struct gcli_config *cfg)
* violate the definition to get expected and sane behaviour. */
tmp = getenv("NO_COLOR");
if (tmp && tmp[0] != '\0')
- cfg->colours_disabled = checkyes(tmp);
+ cfg->colours_disabled = check_yes(tmp);
if ((tmp = getenv("GCLI_NOSPINNER")))
- cfg->no_spinner = checkyes(tmp);
+ cfg->no_spinner = check_yes(tmp);
if ((tmp = getenv("GCLI_ENABLE_EXPERIMENTAL")))
- cfg->enable_experimental = checkyes(tmp);
+ cfg->enable_experimental = check_yes(tmp);
}
int
@@ -1011,7 +1011,7 @@ gcli_config_display_progress_spinner(struct gcli_ctx *ctx)
if (sn_sv_null(cfg_entry))
return 1;
- if (checkyes(sn_sv_to_cstr(cfg_entry)))
+ if (check_yes(sn_sv_to_cstr(cfg_entry)))
return 0;
return 1;
@@ -1032,5 +1032,5 @@ gcli_config_enable_experimental(struct gcli_ctx *ctx)
if (sn_sv_null(cfg_entry))
return false;
- return checkyes(sn_sv_to_cstr(cfg_entry));
+ return check_yes(sn_sv_to_cstr(cfg_entry));
}
From 4f4796baf5eb9c12801579b4192bcc2947d4aeda Mon Sep 17 00:00:00 2001
From: Alexey Ugnichev
Date: Mon, 29 Jul 2024 13:34:44 +0200
Subject: [PATCH 17/50] configure: fix find_program not causing main process to
exit
Nico: I removed the additional should_fail logic from find_program
that is pretty much unused. Instead we check the returned sub-shell
exit code manually for programs that are required and exit with an
appropriate error message if the program wasn't found.
Issue-tracker: https://github.com/herrhotzenplotz/gcli/issues/131
Fixes: https://github.com/herrhotzenplotz/gcli/issues/131
Signed-off-by: Nico Sonack
---
configure | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index fa912131..13b9be05 100755
--- a/configure
+++ b/configure
@@ -9,28 +9,27 @@ PACKAGE_DATE="UNRELEASED"
PACKAGE_STRING="gcli $PACKAGE_VERSION"
PACKAGE_BUGREPORT="https://lists.sr.ht/~herrhotzenplotz/gcli-discuss"
PACKAGE_URL="https://sr.ht/~herrhotzenplotz/gcli"
-echo "Configuring gcli $PACKAGE_VERSION" >&2
find_program() {
varname=$1
shift
- should_fail=$1
- shift
printf "Checking for $varname ..." >&2
for x in $*; do
if (command -v $x >/dev/null 2>&1) && [ -x $(command -v $x) ]; then
printf " $x\n" >&2
echo $x
- return
+ exit 0
fi
done
printf " not found\n" >&2
- [ $should_fail -eq 1 ] && exit 1
+ exit 1
}
-REALPATH=${REALPATH:-$(find_program realpath 1 realpath grealpath)}
+REALPATH=${REALPATH:-$(find_program realpath realpath grealpath)}
+[ $? -eq 0 ] || die "error: need realpath" # exit code of find_program()
+
rel_srcdir="$(dirname ${0})"
srcdir="$(${REALPATH} ${rel_srcdir})"
@@ -93,11 +92,11 @@ compiler_target() {
find_package() {
printf "Checking for $1 ..." >&2
if ! $PKG_CONFIG --exists $1; then
- if [ $3 -eq 0 ]; then
+ if [ "${3}" = optional ]; then
printf " not found\n"
export ${2}_FOUND=0
return
- else
+ else # $3 = required
die "not found"
fi
fi
@@ -239,14 +238,16 @@ fi
############################################################################
# LIBRARIES
############################################################################
-PKG_CONFIG=${PKG_CONFIG:-$(find_program pkg-config 1 pkg-config pkgconf)}
-find_package libcurl LIBCURL 1
-find_package atf-c LIBATFC 0
-find_package libcrypto LIBCRYPTO 1
+PKG_CONFIG=${PKG_CONFIG:-$(find_program pkg-config pkg-config pkgconf)}
+[ $? -eq 0 ] || die "error: need pkg-config or pkgconf"
+
+find_package libcurl LIBCURL required
+find_package atf-c LIBATFC optional
+find_package libcrypto LIBCRYPTO required
# Look for libedit if not disabled
if [ $ENABLE_LIBEDIT -eq 1 ]; then
- find_package libedit LIBEDIT 0
+ find_package libedit LIBEDIT optional
else
LIBEDIT_FOUND=0
fi
@@ -256,7 +257,7 @@ fi
if [ $LIBEDIT_FOUND -eq 1 ]; then
LIBREADLINE_FOUND=0
elif [ $ENABLE_LIBREADLINE -eq 1 ]; then
- find_package readline LIBREADLINE 0
+ find_package readline LIBREADLINE optional
else
LIBREADLINE_FOUND=0
fi
@@ -267,9 +268,10 @@ fi
AR=${AR:-ar}
RANLIB=${RANLIB:-ranlib}
RM=${RM:-rm}
-KYUA=${KYUA:-$(find_program kyua 0 kyua)}
-CCACHE=${CCACHE:-$(find_program ccache 0 ccache)}
-INSTALL=${INSTALL:-$(find_program install 1 install ginstall)}
+KYUA=${KYUA:-$(find_program kyua kyua)}
+CCACHE=${CCACHE:-$(find_program ccache ccache)}
+INSTALL=${INSTALL:-$(find_program install install ginstall)}
+[ $? -eq 0 ] || die "error: need install program"
###################################################################
# Configure Makefile
@@ -332,7 +334,7 @@ cat > config.h <
Date: Tue, 20 Feb 2024 13:54:23 +0100
Subject: [PATCH 18/50] Change line-height of pre tags for readability
The code snippets used to be crammed together in an ugly fashion.
Increase the line-height such that it becomes more readable and
pleasing to the eye.
Signed-off-by: Nico Sonack
---
docs/website/tutorial/top.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/website/tutorial/top.html b/docs/website/tutorial/top.html
index daec21b4..1a9ac68a 100644
--- a/docs/website/tutorial/top.html
+++ b/docs/website/tutorial/top.html
@@ -18,7 +18,7 @@
text-shadow: 0 1px 0 #ffffff; max-width: 73%;
}
pre {
- line-height: 1.0;
+ line-height: 1.2;
}
a {
border-bottom: 1px solid #444444;
From 8072915a7e07742677c639b5bc953e06f71e5dd8 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 20 Feb 2024 14:43:28 +0100
Subject: [PATCH 19/50] Make repository reference verbatim
Signed-off-by: Nico Sonack
---
docs/website/tutorial/02-First-Steps.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/website/tutorial/02-First-Steps.md b/docs/website/tutorial/02-First-Steps.md
index d7f6d997..cf888bd8 100644
--- a/docs/website/tutorial/02-First-Steps.md
+++ b/docs/website/tutorial/02-First-Steps.md
@@ -3,7 +3,7 @@
## Listing issues
Let's start off by listing some issues - here for the curl project
-which is hosted on GitHub under curl/curl. To list issues for it one
+which is hosted on GitHub under `curl/curl`. To list issues for it one
would run:
$ gcli -t github issues -o curl -r curl
From 2feb08100b9af81f22bb375eeb9da4f290043754 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 20 Feb 2024 15:11:19 +0100
Subject: [PATCH 20/50] Add a new page to the tutorial
This page will eventually contain a few instructionals for Bugzilla,
Gitea and Gitlab.
Signed-off-by: Nico Sonack
---
docs/website/tutorial/toc | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/website/tutorial/toc b/docs/website/tutorial/toc
index 30f89b2f..1764ae4a 100644
--- a/docs/website/tutorial/toc
+++ b/docs/website/tutorial/toc
@@ -4,3 +4,4 @@
04-Account-Setup.html Setting up an account
05-Creating-an-issue.html Creating an issue
06-Commenting.html Interacting and commenting
+07-Other-forges.html Other forges (Gitea, Gitlab, Bugzilla)
From 79cf0039af0c9e9f6f83a502e5f34046a38fc461 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Tue, 20 Feb 2024 15:12:05 +0100
Subject: [PATCH 21/50] Add Bugzilla instructions
Signed-off-by: Nico Sonack
---
docs/website/tutorial/07-Other-forges.md | 92 ++++++++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 docs/website/tutorial/07-Other-forges.md
diff --git a/docs/website/tutorial/07-Other-forges.md b/docs/website/tutorial/07-Other-forges.md
new file mode 100644
index 00000000..28d617f5
--- /dev/null
+++ b/docs/website/tutorial/07-Other-forges.md
@@ -0,0 +1,92 @@
+# Other forges and bugtrackers
+
+gcli is capable of not only interacting with Github. It also currently supports:
+
+- GitLab
+- Gitea
+- Bugzilla
+
+## Bugzilla
+
+### Notes
+
+Bugzilla is commonly used as a bug tracker in various large open-source
+projects such as FreeBSD, the Linux Kernel, Mozilla and Gentoo.
+
+### Searching
+
+Suppose you want to search for bug reports containing `sparc` in
+the Gentoo Bugzilla.
+
+In this case you need to configure an account that points at the
+correct URL in `$HOME/.config/gcli/config` by adding:
+
+ gentoo {
+ forge-type=bugzilla
+ apibase=https://bugs.gentoo.org/
+ }
+
+Now you can search the Gentoo Bugs:
+
+ $ gcli -a gentoo issues sparc
+ NUMBER NOTES STATE TITLE
+ 924443 0 UNCONFIRMED Add keyword ~sparc for app-misc/fastfetch
+ 924430 0 RESOLVED media-libs/assimp-5.3.1 fails tests on sparc
+ 924215 0 CONFIRMED dev-libs/libbson dev-libs/mongo-c-driver: alpha arm ia64 mips ppc ppc64 s390 sparc keyword req
+ 924191 0 CONFIRMED media-libs/exempi: unaligned access causes dev-python/python-xmp-toolkit-2.0.2 to fails tests on sparc (test_file_to_dict (test.test_core_unit.UtilsTestCase.test_file_to_dict) ... Bus error)
+ 924180 0 CONFIRMED dev-python/psycopg-3.1.17[native-extensions] fails tests on sparc: tests/test_copy_async.py::test_read_rows[asyncio-names-1] Fatal Python error: Bus error
+ 924031 0 IN_PROGRESS sys-apps/bfs: ~arm ~arm64 ~ppc ~ppc64 ~sparc keywording
+ 923968 0 CONFIRMED dev-python/pyarrow-15.0.0 fails to configure on sparc: CMake Error at cmake_modules/SetupCxxFlags.cmake:42 (message): Unknown system processor
+ 921245 0 CONFIRMED media-video/rav1e-0.6.6 fails to compile on sparc: Assertion `DT.dominates(RHead, LHead) && "No dominance between recurrences used by one SCEV?"' failed.
+ 920956 0 CONFIRMED dev-python/pygame-2.5.2: pygame.tests.font_test SIGBUS on sparc
+ 920737 0 CONFIRMED sparc64-solaris Prefix no longer supported
+
+
+
+### Issue details
+
+Furthermore we can look at single issues:
+
+ $ gcli -a gentoo issues -i 920737 all comments
+ NUMBER : 920737
+ TITLE : sparc64-solaris Prefix no longer supported
+ CREATED : 2023-12-26T19:20:58Z
+ PRODUCT : Gentoo Linux
+ COMPONENT : Profiles
+ AUTHOR : Tom Williams
+ STATE : CONFIRMED
+ LABELS : none
+ ASSIGNEES : prefix
+
+ ORIGINAL POST
+
+ Resurrecting a Prefix install on Solaris 11.4 SPARC. It was working rather well
+ for me; after a hiatus I had hoped to use it again but my first emerge --sync
+ has removed the profile needed to merge any updates or new packages.
+
+ I note commit 8e006b67e06a19fae10c6059c7fc5ede88834601 in May 2023 removed the
+ profile and keywording for prefixed installs.
+
+ There is no associated comment. There doesn't seem to be a bug report in regards
+ to the change (I'm quite sure almost nobody uses it, so probably fair enough)
+
+ Any easy way to restore the profile for now? Eventually Solaris/SPARC and thus
+ Prefix will be gone anyway, but useful for now.
+
+ Thanks for your continued efforts.
+ AUTHOR : sam
+ DATE : 2023-12-26T19:21:33Z
+ I think at the very least, when removing Prefix support in future, a 'deprecated'
+ file should be added to the relevant profiles asking if anyone is using
+ it to step forward.
+
+ AUTHOR : grobian
+ DATE : 2023-12-26T22:58:12Z
+ Solaris 11.4 itself is a problem. I doubt you ever had it "working".
+
+ AUTHOR : grobian
+ DATE : 2023-12-26T22:59:57Z
+ Linux sparc team is not relevant here
+
+ $
+
From ebd4fa345e3e0f6e7f6c1024041a7416d1713230 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Sat, 29 Jun 2024 17:52:18 +0200
Subject: [PATCH 22/50] website: reorder list of links
- Move the test tarballs to the end
- Make tutorial not WIP anymore
Signed-off-by: Nico Sonack
---
docs/website/index.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/website/index.html b/docs/website/index.html
index d1532141..59c63303 100644
--- a/docs/website/index.html
+++ b/docs/website/index.html
@@ -62,13 +62,13 @@ General
However, you can go look at
From ab104a1e8c7ec7dbb9cd43148e5b4a4f6ef00d86 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Sat, 29 Jun 2024 19:55:18 +0200
Subject: [PATCH 23/50] tutorial: add installation instructions for more OSes
Signed-off-by: Nico Sonack
---
docs/website/tutorial/01-Installation.html | 12 ++++++++++--
docs/website/tutorial/01-Installation.md | 15 +++++++++++++--
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/docs/website/tutorial/01-Installation.html b/docs/website/tutorial/01-Installation.html
index e60433c9..d92c4554 100644
--- a/docs/website/tutorial/01-Installation.html
+++ b/docs/website/tutorial/01-Installation.html
@@ -43,9 +43,17 @@ Through package manager
following command:
# pkg install gcli
+On NetBSD you can run:
+# pkgin install gcli
+
+On Ubuntu, Debian, Devuan and the like you can run:
+# apt install gcli
+
+On ArchLinux you can either use the AUR manually or use your favourite AUR helper:
+# yay -S gcli
+
Compile the source code
-Other operating systems currently require manual compilation and
-installation.
+Other operating systems may currently require manual compilation and installation.
Windows NT Notes
It is entirely possible to build gcli on Windows using
MSYS2 . Please follow their instructions on
diff --git a/docs/website/tutorial/01-Installation.md b/docs/website/tutorial/01-Installation.md
index ed6dcd18..249ecb09 100644
--- a/docs/website/tutorial/01-Installation.md
+++ b/docs/website/tutorial/01-Installation.md
@@ -7,10 +7,21 @@ following command:
# pkg install gcli
+On NetBSD you can run:
+
+ # pkgin install gcli
+
+On Ubuntu, Debian, Devuan and the like you can run:
+
+ # apt install gcli
+
+On ArchLinux you can either use the AUR manually or use your favourite AUR helper:
+
+ # yay -S gcli
+
## Compile the source code
-Other operating systems currently require manual compilation and
-installation.
+Other operating systems may currently require manual compilation and installation.
### Windows NT Notes
From 2031a1cd1dd1211289cbb43ed1c39cec48e37905 Mon Sep 17 00:00:00 2001
From: Nico Sonack
Date: Sat, 29 Jun 2024 20:15:35 +0200
Subject: [PATCH 24/50] tutorial: add new page about creating pull requests
Signed-off-by: Nico Sonack
---
docs/website/tutorial/01-Installation.html | 2 +-
docs/website/tutorial/02-First-Steps.html | 4 +-
.../tutorial/03-Find-Documentation.html | 2 +-
docs/website/tutorial/04-Account-Setup.html | 2 +-
.../tutorial/05-Creating-an-issue.html | 2 +-
docs/website/tutorial/06-Commenting.html | 4 +-
.../tutorial/07-Creating-a-pull-request.html | 91 ++++++++++++
.../tutorial/07-Creating-a-pull-request.md | 56 ++++++++
docs/website/tutorial/08-Other-forges.html | 129 ++++++++++++++++++
...{07-Other-forges.md => 08-Other-forges.md} | 0
docs/website/tutorial/index.html | 4 +-
docs/website/tutorial/toc | 3 +-
12 files changed, 290 insertions(+), 9 deletions(-)
create mode 100644 docs/website/tutorial/07-Creating-a-pull-request.html
create mode 100644 docs/website/tutorial/07-Creating-a-pull-request.md
create mode 100644 docs/website/tutorial/08-Other-forges.html
rename docs/website/tutorial/{07-Other-forges.md => 08-Other-forges.md} (100%)
diff --git a/docs/website/tutorial/01-Installation.html b/docs/website/tutorial/01-Installation.html
index d92c4554..d10c06ba 100644
--- a/docs/website/tutorial/01-Installation.html
+++ b/docs/website/tutorial/01-Installation.html
@@ -18,7 +18,7 @@
text-shadow: 0 1px 0 #ffffff; max-width: 73%;
}
pre {
- line-height: 1.0;
+ line-height: 1.2;
}
a {
border-bottom: 1px solid #444444;
diff --git a/docs/website/tutorial/02-First-Steps.html b/docs/website/tutorial/02-First-Steps.html
index 3df2173d..375f9945 100644
--- a/docs/website/tutorial/02-First-Steps.html
+++ b/docs/website/tutorial/02-First-Steps.html
@@ -18,7 +18,7 @@
text-shadow: 0 1px 0 #ffffff; max-width: 73%;
}
pre {
- line-height: 1.0;
+ line-height: 1.2;
}
a {
border-bottom: 1px solid #444444;
@@ -41,7 +41,7 @@
First steps
Listing issues
Let's start off by listing some issues - here for the curl project
-which is hosted on GitHub under curl/curl. To list issues for it one
+which is hosted on GitHub under curl/curl
. To list issues for it one
would run:
$ gcli -t github issues -o curl -r curl
diff --git a/docs/website/tutorial/03-Find-Documentation.html b/docs/website/tutorial/03-Find-Documentation.html
index 34265683..b7662a89 100644
--- a/docs/website/tutorial/03-Find-Documentation.html
+++ b/docs/website/tutorial/03-Find-Documentation.html
@@ -18,7 +18,7 @@
text-shadow: 0 1px 0 #ffffff; max-width: 73%;
}
pre {
- line-height: 1.0;
+ line-height: 1.2;
}
a {
border-bottom: 1px solid #444444;
diff --git a/docs/website/tutorial/04-Account-Setup.html b/docs/website/tutorial/04-Account-Setup.html
index 8b64f627..43b98c4c 100644
--- a/docs/website/tutorial/04-Account-Setup.html
+++ b/docs/website/tutorial/04-Account-Setup.html
@@ -18,7 +18,7 @@
text-shadow: 0 1px 0 #ffffff; max-width: 73%;
}
pre {
- line-height: 1.0;
+ line-height: 1.2;
}
a {
border-bottom: 1px solid #444444;
diff --git a/docs/website/tutorial/05-Creating-an-issue.html b/docs/website/tutorial/05-Creating-an-issue.html
index db7246cc..3e17b005 100644
--- a/docs/website/tutorial/05-Creating-an-issue.html
+++ b/docs/website/tutorial/05-Creating-an-issue.html
@@ -18,7 +18,7 @@
text-shadow: 0 1px 0 #ffffff; max-width: 73%;
}
pre {
- line-height: 1.0;
+ line-height: 1.2;
}
a {
border-bottom: 1px solid #444444;
diff --git a/docs/website/tutorial/06-Commenting.html b/docs/website/tutorial/06-Commenting.html
index ef2a611f..832483da 100644
--- a/docs/website/tutorial/06-Commenting.html
+++ b/docs/website/tutorial/06-Commenting.html
@@ -18,7 +18,7 @@
text-shadow: 0 1px 0 #ffffff; max-width: 73%;
}
pre {
- line-height: 1.0;
+ line-height: 1.2;
}
a {
border-bottom: 1px solid #444444;
@@ -35,6 +35,7 @@
⇐ Previous
Table of contents
+Next ⇒
Commenting
@@ -65,6 +66,7 @@ Commenting on pull requests
⇐ Previous
Table of contents
+Next ⇒