Skip to content

Commit

Permalink
Merge branch 'trunk' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
herrhotzenplotz committed Feb 5, 2024
2 parents 7bea9c4 + 7bb4743 commit a1077d9
Show file tree
Hide file tree
Showing 232 changed files with 6,580 additions and 3,346 deletions.
34 changes: 34 additions & 0 deletions .builds/alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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
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
- check: |
cd gcli
make -j distcheck
29 changes: 29 additions & 0 deletions .builds/debian-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
image: debian/stable
packages:
- build-essential
- libcurl4-openssl-dev
- pkgconf
- autotools-dev
- bison
- flex
- make
- autoconf
- automake
- libtool
- libbsd-dev
- libatf-dev kyua
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
- check: |
cd gcli
make distcheck
33 changes: 33 additions & 0 deletions .builds/freebsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
image: freebsd/14.x
packages:
- atf
- autoconf
- automake
- ca_root_nss
- curl
- kyua
- libedit
- libssh2
- libtool
- libunistring
- m4
- pkg
- pkgconf
- readline
sources:
- https://git.sr.ht/~herrhotzenplotz/gcli
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
- check: |
cd gcli
make -j 4 distcheck
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
/configure
/configure~
/depcomp
/gcli-0.9.9.tar.gz
# build artifacts
/gcli-*.tar.bz2
/gcli-*.tar.gz
/gcli-*.tar.xz
/install-sh
/libtool
/ltmain.sh
Expand Down Expand Up @@ -47,3 +50,4 @@
/m4/ltversion.m4
/m4/lt~obsolete.m4
/libgcli.pc
/build
26 changes: 0 additions & 26 deletions .hgignore

This file was deleted.

79 changes: 79 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,85 @@

This changelog does not follow semantic versioning.

## 2.2.0 (2024-Feb-05)

### Added

- Preliminary (and thus experimental) support for Bugzilla has been
added. For this a new yet undocumented `attachments` subcommand
has been introduced.
Currently if no account has been specified it will default to the
FreeBSD Bugzilla - this may however change in the future.

- A search feature has been added to the issues subcommand. You can
now optionally provide trailing text to the issues subcommand
which will be used as a search term:

```console
$ gcli issues -A herrhotzenplotz Segfault
```

This will search for tickets authored by herrhotzenplotz containing
"Segfault".

- Added partial support for auto-merge. When creating a pull request
on Gitlab and Github you can set an automerge flag. Whenever this
automerge flag is set a pull request will be merged once all the
pipelines/checks on the pull request pass.

This feature is not fully documented yet as there are bugs in it,
especially on Gitlab there are flaws. Please consider this feature
unstable and experimental.

### Fixed

- Fixed a segmentation fault when getting a 404 on Gitlab. This bug
occured on Debian Linux when querying pipelines at the KiCad project.
The returned 404 contained unparsable data which then lead to the
error message to be improperly initialised.
Reported by: Simon Richter

- Fixed missing URL-encode calls in Gitlab Pipelines causing 404 errors
when using subprojects on Gitlab. You're now not forced anymore
to manually urlencode slashes as %2F in the repos.
Reported by: Simon Richter

- Fixed the patch generator for Gitlab Merge Requests to produce
patches that can be applied with `git am`.
Previously the patches were invalid when new files were created
or deleted.

- Fixed Segmentation fault when the editor was opened and closed
without changing the file. Several subcommands have been updated
to also account for empty user messages.

- Fixed incorrect colour when creating labels. In any forge the
provided colour code was converted incorrectly and always producing
the wrong colour.

- Fixed a segmentation fault when listing Github gists

- Fixed possible JSON escape bug when creating a Github Gist

- Fixed gcli reporting incorrect libcurl version in the User-Agent
header when performing HTTP requests.

- Fixed possible segmentation fault when no token was configured in
gcli configuration file.

### Changed

- Internally a lot of code was using string views. Maintaining this
was a bit cumbersome and required frequent reallocations.
A lot of these uses have been refactored to use plain C-Strings
now. This also involved changing some code to use the new
`gcli_jsongen` set of routines.
Due to these changes there may be regressions that are only visible
during use. If you encounter such regressions where previously
working commands suddenly fail due to malformed requests please
report immediately.

### Removed

## 2.1.0 (2023-Dec-08)

Expand Down
9 changes: 6 additions & 3 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,18 @@ Please use the BSD Style conventions for formatting your code. This means:
This allows to search for the implementation of a function through a
simple `grep -rn '^foo' .`.

- typedef structs separately from their definitions

typedef struct foo foo;
- Use struct tags for structs, do not typedef them

struct foo {
int bar;
char const *baz;
};

static void
foodoo(struct foo const *const bar)
{
}

- Indent with tabs, align with spaces

`»` denotes a TAB character, `.` indicates a whitespace:
Expand Down
32 changes: 30 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dist_man_MANS = \
docs/gcli.5

gcli_SOURCES = \
include/gcli/cmd/attachments.h src/cmd/attachments.c \
include/gcli/cmd/ci.h src/cmd/ci.c \
include/gcli/cmd/cmdconfig.h src/cmd/cmdconfig.c \
include/gcli/cmd/cmd.h src/cmd/cmd.c \
Expand Down Expand Up @@ -119,7 +120,9 @@ TEMPLATES = \
templates/gitlab/status.t \
templates/gitlab/snippets.t \
templates/gitea/milestones.t \
templates/gitea/status.t
templates/gitea/status.t \
templates/bugzilla/api.t \
templates/bugzilla/bugs.t

headerdir = $(prefix)
nobase_header_HEADERS = include/gcli/gcli.h include/gcli/comments.h \
Expand All @@ -136,6 +139,8 @@ libgcli_la_SOURCES = \
include/gcli/ctx.h src/ctx.c \
include/gcli/gcli.h src/gcli.c \
include/gcli/date_time.h src/date_time.c \
src/attachments.c include/gcli/attachments.h \
src/base64.c include/gcli/base64.h \
src/comments.c include/gcli/comments.h \
src/curl.c include/gcli/curl.h \
src/forges.c include/gcli/forges.h \
Expand All @@ -145,6 +150,7 @@ libgcli_la_SOURCES = \
src/json_util.c include/gcli/json_util.h \
src/labels.c include/gcli/labels.h \
src/milestones.c include/gcli/milestones.h \
src/nvlist.c include/gcli/nvlist.h \
src/pulls.c include/gcli/pulls.h \
src/releases.c include/gcli/releases.h \
src/repos.c include/gcli/repos.h \
Expand Down Expand Up @@ -189,6 +195,11 @@ libgcli_la_SOURCES = \
src/gitea/sshkeys.c include/gcli/gitea/sshkeys.h \
src/gitea/status.c include/gcli/gitea/status.h \
src/gitea/milestones.c include/gcli/gitea/milestones.h \
src/bugzilla/api.c include/gcli/bugzilla/api.h \
src/bugzilla/attachments.c include/gcli/bugzilla/attachments.h \
src/bugzilla/bugs.c include/gcli/bugzilla/bugs.h \
src/bugzilla/bugs-parser.c include/gcli/bugzilla/bugs-parser.h \
src/bugzilla/config.c include/gcli/bugzilla/config.h \
$(TEMPLATES)

libgcli_la_CPPFLAGS = \
Expand Down Expand Up @@ -218,6 +229,8 @@ check_PROGRAMS = \
tests/github-parse-tests$(EXEEXT) \
tests/gitlab-parse-tests$(EXEEXT) \
tests/gitea-parse-tests$(EXEEXT) \
tests/bugzilla-parse-tests$(EXEEXT) \
tests/base64-tests$(EXEEXT) \
tests/url-encode$(EXEEXT) \
tests/pretty_print_test$(EXEEXT) \
tests/test-jsongen$(EXEEXT)
Expand Down Expand Up @@ -254,6 +267,18 @@ tests_gitea_parse_tests_LDADD = \
libgcli.la libpdjson.la libsn.la \
$(LIBATFC_LDFLAGS)

tests_bugzilla_parse_tests_SOURCES = \
tests/bugzilla-parse-tests.c
tests_bugzilla_parse_tests_LDADD = \
libgcli.la libpdjson.la libsn.la \
$(LIBATFC_LDFLAGS)

tests_base64_tests_SOURCES = \
tests/base64-tests.c
tests_base64_tests_LDADD = \
libgcli.la libpdjson.la libsn.la \
$(LIBATFC_LDFLAGS)

tests_url_encode_SOURCES = \
tests/url-encode.c
tests_url_encode_LDADD = \
Expand Down Expand Up @@ -291,6 +316,9 @@ EXTRA_DIST += tests/samples/github_simple_comment.json \
tests/samples/gitlab_simple_repo.json \
tests/samples/gitlab_simple_snippet.json \
tests/samples/github_simple_check.json \
tests/samples/gitea_simple_notification.json
tests/samples/gitea_simple_notification.json \
tests/samples/bugzilla_attachments.json \
tests/samples/bugzilla_comments.json \
tests/samples/bugzilla_simple_bug.json

endif
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# GCLI

Simple and portable CLI tool for interacting with GitHub, GitLab and
Gitea from the command line.
Portable CLI tool for interacting with Git(Hub|Lab|Tea) from the command line.

![](docs/screenshot-04.png)
![](docs/screenshot.png)

## Why?

Expand All @@ -12,9 +11,8 @@ unified tool for various git forges such as GitHub and GitLab because
every forge does things differently yet all build on Git and
purposefully break with its philosophy.

Also, the official tool from Github is written in Go, which does
manual [DNS
resolution](https://github.com/golang/go/blob/master/src/net/dnsclient_unix.go#L49)
Also, the official tool from Github is written in Go, which does manual
[DNS resolution](https://github.com/golang/go/blob/master/src/net/dnsclient_unix.go#L49)
which is a massive security vulnerability for people using Tor as it
leaks your IP to the DNS server. This program builds upon libcurl,
which obeys the operating system's DNS resolution mechanisms and thus
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

AC_PREREQ([2.69])
AC_INIT([gcli],
[2.1.0],
[2.2.0],
[~herrhotzenplotz/[email protected]],
[gcli],
[https://herrhotzenplotz.de/gcli])
AM_INIT_AUTOMAKE([1.0 foreign subdir-objects dist-bzip2 dist-xz -Wall])

dnl Release Date.
PACKAGE_DATE="2023-Dec-08"
PACKAGE_DATE="2024-Feb-05"
AC_SUBST([PACKAGE_DATE])

dnl Silent by default.
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
/gcli-snippets.1
/gcli-status.1
/gcli.1
/gcli.5
Loading

0 comments on commit a1077d9

Please sign in to comment.