libfossil
fsl_repo_create_opt Struct Reference

Configuration parameters for fsl_repo_create(). More...

#include "repo.h"

Collaboration diagram for fsl_repo_create_opt:

Data Fields

bool allowOverwrite
 If false, fsl_repo_create() will fail if this->filename already exists.
char const * commitMessage
 The comment text used for the initial commit.
char const * commitMessageMimetype
 Mime type for the commit message (manifest N-card).
char const * configRepo
 If not NULL and not empty, fsl_repo_create() will use this repository database to copy the configuration, copying over the following settings:
bool elideProjectCode
 If true, the new repo will not have a "project-code" config entry.
char const * filename
 The file name for the new repository.
char const * username
 Fossil user name for the admin user in the new repo.

Detailed Description

Configuration parameters for fsl_repo_create().

Always copy-construct these from fsl_repo_create_opt_empty resp. fsl_repo_create_opt_empty_m in order to ensure proper behaviour vis-a-vis default values.

TODOs:

  • Add project name/description, and possibly other configuration bits.
  • Allow client to set password for default user (currently set randomly, as fossil(1) does).

Definition at line 4167 of file repo.h.

Field Documentation

◆ allowOverwrite

bool fsl_repo_create_opt::allowOverwrite

If false, fsl_repo_create() will fail if this->filename already exists.

Definition at line 4224 of file repo.h.

◆ commitMessage

char const* fsl_repo_create_opt::commitMessage

The comment text used for the initial commit.

If NULL or empty (starts with a NUL byte) then no initial check is created. fossil(1) is largely untested with that scenario (but it seems to work), so for compatibility it is not recommended that this be set to NULL.

The default value (when copy-initialized) is "egg". There's a story behind the use of "egg" as the initial checkin comment, and it all started with a typo: "initial chicken"

Definition at line 4191 of file repo.h.

◆ commitMessageMimetype

char const* fsl_repo_create_opt::commitMessageMimetype

Mime type for the commit message (manifest N-card).

Manifests support this but fossil(1) has never (as of 2025-07) made use of it. It is provided for completeness but should, for compatibility's sake, probably not be set, as the fossil UI may not honor it. The implied default is text/x-fossil-wiki. Other ostensibly legal values include text/plain and text/x-markdown. This API will accept any value, but results are technically undefined with any values other than those listed above.

Definition at line 4203 of file repo.h.

◆ configRepo

char const* fsl_repo_create_opt::configRepo

If not NULL and not empty, fsl_repo_create() will use this repository database to copy the configuration, copying over the following settings:

  • The reportfmt table, overwriting any existing entries.
  • The user table fields (cap, info, mtime, photo) are copied for the "system users": anonymous, nobody, developer, reader.
  • The vast majority of the config table is copied, arguably more than it should (e.g. the 'manifest' setting).

Definition at line 4218 of file repo.h.

◆ elideProjectCode

bool fsl_repo_create_opt::elideProjectCode

If true, the new repo will not have a "project-code" config entry.

Only set this to true when the next operation on this repo will be an inbound clone.

Definition at line 4231 of file repo.h.

◆ filename

char const* fsl_repo_create_opt::filename

The file name for the new repository.

Definition at line 4171 of file repo.h.

◆ username

char const* fsl_repo_create_opt::username

Fossil user name for the admin user in the new repo.

If NULL, defaults to the Fossil context's user (see fsl_cx_user_get()). If that is NULL, it defaults to "root" for historical reasons.

Definition at line 4178 of file repo.h.


The documentation for this struct was generated from the following file: