# -*- mode: org -*-
* v4.3.0    2025-04-01

- Use the built-in native JSON support added in Emacs 30.  In Emacs
  29 the built-in support used the jansson library, but only if it
  was built with ~--with-json~.  We already required Emacs 29 before,
  now we require "Emacs 29 with ~--with-json~, or Emacs 30".  Support
  for the old ~json.el~ interface is dropped.

  Decoding should work as before.  When it comes to encoding we
  inherit a backward incompatible change.  Lists, or more accurately
  "JSON arrays", now have to be specified using Lisp vectors, not
  Lisp lists.  #168

- ~ghub-fetch-repository~ now also fetches discussions and discussion
  categories.  26d5da1, a57baff

- Display more debugging information; some of it only if ~ghub-debug~
  is non-nil.

* v4.2.2    2025-03-01

Thoughts and whitespace.

* v4.2.1    2025-02-01

- Added new variable ~ghub-graphql-message-progress~.  magit/forge#633

Bug fix:

- When ~ghub--token~ does not find a token for ~host/path~, it now falls
  back to ~host~.  See https://github.com/magit/forge/issues/720.

* v4.2.0    2024-12-08

- At least Emacs 29.1 is required now.

Bug fix:

- Revert timeout changes from previous two releases.  Url.el is
  such a pain.  See https://github.com/magit/forge/issues/709.

* v4.1.1    2024-10-01

Bug fix:

- Fix the timeout handling from the previous release.

* v4.1.0    2024-09-01

- Updated tooling.

Bug fix:

- Timeouts are now handled properly.  03d7161

* v4.0.0    2024-08-08

- When calling the callback for a REST request, the same buffer which
  was current when the request was made, is now temporarily made
  current.  2061136

- When calling the callback or errorback for a GraphQL request, the
  same buffer which was current when the request was made, is now
  temporarily made current.  2241135

- The default value of ~ghub-graphql-items-per-request~ had to be
  halved.  We use deeply nested requests and Github's default (and
  suggested) limit of 100, often leads to timeouts on the server side.
  b3dd176

- It is now possible to specify how many items to fetch for a specific
  GraphQL edge using ~:edges INTEGER~.  e6af790

- Added new ~paginate~ argument to ~ghub--graphql-vacuum~ and all its public
  callers (such as ~ghub-fetch-repository~).  337b884, b9c1600

- Taught ~ghub--graphql-vacuum~ to respects ~forge.graphqlItemLimit~.
  11c31d1

- Added support for synchronous GraphQL queries, using the new
  ~ghub--graphql-synchronous~ function.  a61da16

- Since there are now multiple ways to paginate results, make sure
  that the smallest value is used.  ce7adcd

- Setting the new ~ghub--graphql-debug~ variable causes debug information
  to be inserted into the ~*gsexp-encode*~ buffer.  87321cd

- ~ghub-fetch-repository~ now also fetches the ~id~ of ~comments~, the
  ~stateReason~ of ~issues~, and ~isReadByViewer~ of ~issues~ and ~pullRequests~
  78a370f, 636a463, 13f3627, c59de91

Bug fixes:

- 0d7c81e ghub-response-link-relations: Fix for GitLab
- 2dc1cee ghub-graphql-error: Define missing error type
- 3647748 ghub--retrieve: Better error if buffer is nil

* v3.6.0    2023-05-13

- Queries can now be passed to ~ghub-graphql~ in the gsexp format.
  f3a2654

- ~ghub-fetch-repository~ fetches more information about Issues and
  PullRequests.  fb9d33b 2c6671e

- Gsexp now supports naming queries.  2c5ba23

- Added support for GitLab's GraphQL API.  0e61c0b

- ~ghub--graphql-vacuum~ can now make synchronous requests.  142b0db

- Added variable ~ghub-graphql-items-per-request~. 6a5de97

Bug fixes:

- 8c4d0ba ghub--encode-payload: Drop invalid arguments to json-serialize
- 0946102 ghub--url-encode-params: Handle lisp booleans
- 5eed205 Add kludge for debbugs#54989 and rework kludge for debbugs#34341
- 7beed8c ghub--graphql-vacuum: Fall back to pretty-printing response

Also contains various documentation updates, code clean-ups and
build improvements.

* v3.5.6    2022-03-25

- When encoding payloads, explicitly specify how to encode certain
  Lisp values in JSON.

* v3.5.5    2022-02-16

- Define ~ghub--auth~ as a generic function.

- Also included are several other improvements, updated documentation
  and bugfixes.

- The experimental and unfinished support for the native json backend
  must not be used.  It was merged prematurely.

* v3.5.4    2021-10-02

- Add new ~sparse~ argument to ~ghub-fetch-repository~, making it possible
  to fetch only information about the repository itself, excluding data
  such as issues and pull-requests.

* v3.5.3    2021-05-26

- If the username isn't set and the user decides to set it locally,
  then that resulted in an error.  #124

* v3.5.2    2021-04-27

- Add new function ~ghub-fetch-review-threads~ and make
  ~ghub-fetch-respository~ fetch ~baseRefOid~ and ~headRefOid~.  #110

- Add new ~headers~ argument to ~ghub-fetch-repository~, ~ghub-fetch-issue~
  and ~ghub-fetch-pullreq~.  #110

* v3.5.1    2020-12-27

- Add new ~headers~ keyword argument to ~ghub-graphql~.

* v3.5.0    2020-11-21

- Add a kludge to work around a bug in Emacs that causes it to not
  respond correctly to http codes 401 and 409, causing the user to
  be asked for their username, which makes it very hard to debug
  the actual issue that caused to reject the provided information.
  [[https://github.com/magit/forge/issues/293][forge/293]]

- Limit the kludge from v3.3.0 to Emacs releases that are affected.
  It was fixed in Emacs 27.1.

* v3.4.2    2020-10-25

- Make sure base64 encoded credentials do not contain any newline
  characters.  #118

* v3.4.1    2020-08-01

- Fix a regression introduced in v3.4.0.

* v3.4.0    2020-07-20

- Remove the token setup wizard because (a) it only ever supported
  Github, (b) Github is about to remove support for that on their
  end, (c) it did not always work, and (d) when it couldn't be used,
  or failed, then it made things /more/ complicated.  #113

- Various minor fixes and improvements.

* v3.3.0    2020-01-19

- Add a kludge to work around a bug in Emacs versions before 26.3 that
  often but not always causes network connections to fail when using
  TLS1.3.  On macOS use the workaround regardless of the Emacs version
  because the supposed bug fix does not appear to work there.  Add a
  variable ~ghub-use-workaround-for-emacs-bug~ to allow users to opt in
  or out of using the kludge.  #81

- Add a new library ~gsexp.el~ to encode S-expressions as GraphQl
  documents.  Previously we used the third-party library ~graphql.el~
  but using our own library gives us more flexibility.  Currently it
  is rather incomplete and only intended for use by ~ghub-graphql~ but
  I might fill the gaps and add documentation eventually.  I am not
  in a hurry though.  #90

- No longer depend on ~dash~.

- Handle some undocumented Bitbucket behavior. #97

- Add new option ~ghub-insecure-hosts~ to allow users to connect to
  insecure forges.  #9

- Support Github instances that use an undocumented url-schema, which
  users report to have sighted in the wild.

- ~ghub-fetch-repository~ now also fetches ~reviewRequests~.

- Various bug fixes and improvements.

* v3.2.0    2018-12-27

- Work around bug in Emacs versions before 26.1 that prevented newly
  created tokens from being used without the user invalidating
  ~auth-source~'s cache first.

- Teach ~glab-repository-id~ about subgroups.

* v3.1.0    2018-12-20

- Support GraphQL aliases.

- Show number of GraphQL page currently being fetched in mode-line.

- Add a default errorback for asynchronous REST requests, which shows
  the same information as would be shown for a failed synchronous
  request.

- Signal an error if ~ghub-repository-id~ fails.

- ~ghub-fetch-repository~ fetches a few more fields.

* v3.0.0    2018-10-31

- Add support for Gitea, Gogs and Bitbucket.  ~ghub.el~ supports these
  forges directly, but also add new libraries ~gtea.el~, ~gogs.el~ and
  ~buck.el~, which provide convenience wrappers just like the existing
  ~glab.el~.  [[https://github.com/tarsius/ghub/issues/67][#67]]

- No longer split the repository into multiple Melpa packages.
  I.e. the ~glab.el~ library is now part of the ~ghub~ package.

- Add support for automatic GraphQL unpagination.  [[https://github.com/tarsius/ghub/issues/68][#68]]

  GraphQL was designed around the idea that you should be able to "ask
  for what you need and get exactly that".  Unfortunately this does not
  cover the "look, if I persist, then you are going to hand me over all
  the data anyway, so just cough it up already", which is what Forge
  needs.

  ~ghub--graphql-vacuum~ provides a way to unpaginate all cursors in the
  returned data without having to write a lot of boilerplate.  Callers
  have to provide the query as an s-expression that corresponds to the
  root request.  The queries needed to follow cursors in arbitrary
  locations within the returned data, are automatically derived from
  that query.

  ~ghub-fetch-repository~ fetches information about a repository.
  If also serves as an example for how to use ~ghub--graphql-vacuum~.

  The initial queries used by ~ghub-fetch-issue~ and
  ~ghub-fetch-pullreq~ are pre-narrowed variants of the initial query of
  ~ghub-fetch-repository~.  Pre-narrowing is somewhat similar to the use
  of fragments, but unlike that, it doesn't result in lots of duplicated
  boilerplate and/or lots of variables.

  There is very little documentation and everything is still very much
  subject to change.

- Bind ~url-show-message~ to ~nil~ so that the more useful messages
  displayed by the callers of this package are visible to the user
  instead of the less useful "Contacting host: api.github.com:443".

- Sometimes Github returns an HTML document instead of the promised
  JSON when an error occurs.  Try harder to extract some meaningful
  information from that document.

- Work around a bug in older Emacsen that prevented ~auth-source~ from
  retrieving saved secrets.  [[https://github.com/tarsius/ghub/issues/64][#64]]

- Deal with a chicken and egg problem concerning 2fa.  [[https://github.com/tarsius/ghub/issues/65][#65]]

- Add new ~ghub-clear-caches~ command because if things go wonky it is
  nice to know it isn't the cache.

- Add new ~ghub-repository-id~ function.  This function works for all
  supported forges and always returns a string, even for less
  successful forges that can still get away with using integers as ids.

- Add new ~ghub-graphql-rate-limit~ function.

* v2.0.1    2018-04-19

(For this an earlier releases only the most important changes are
mentioned.)

- Various bug fixes.

* v2.0.0    2018-03-20

- Support two-factor authentication.

- Support asynchronous requests.

- Support GraphQL.

- Support Gitlab.

* v1.3.0    2017-11-30

- Support basic authentication.

- Fix various encoding issues.

* v1.2.0    2017-04-26

- Support unauthenticated requests.

- Support Github Enterprise instances.

* v1.1.0    2016-08-07

- Bind ~json-false~ to ~nil~ instead of ~:json-false~.

* v1.0.0    2016-04-20

- First release.
