Next: , Up: Getting Started   [Contents][Index]

2.1 Basic Concepts, Arguments and Variables

Originally Ghub supported only Github but now it also supports Gitlab, Gitea, Gogs and Bitbucket. For the historic reason just given, the function ghub-request defaults to acting on a github forge, but can be told to act on another forge using the FORGE argument.

The FORGE argument only specifies what kind of forge to act on, not which instance. The HOST argument can be used to select the instance. For some forges a default instance is defined:

Together the FORGE and HOST arguments specify the forge type and instance. In addition to that, it is also necessary to specify on whose behalf the request is being made, which can be done using the USERNAME and AUTH arguments. For example:

(ghub-request "GET" "/user" nil
              :forge 'github
              :host ""
              :username "tarsius"
              :auth 'forge)

Having to specify these arguments for every request is inconvenient. Additional variables and convenience functions can be used to make that unnecessary in most cases.

(But for debugging purposes the above explicit form is very useful. You will obviously have to change the value of USERNAME and you should use ghub as AUTH when first trying this at home.)

These variables can be set globally and/or for a specific repository.

These github specific variables are discussed in more detail in Github Configuration Variables.

For gitlab and bitbucket forges similar variables are available:

For the gitea and gogs forges some similar variables are available, however for some of the ghub.* variables no equivalent variable exist for these two forges:

Next: Setting the Username, Up: Getting Started   [Contents][Index]