gitwrap/commit/options.rs
1// Warning!! Code generated automatically: this file must not be edited by hand
2use crate::option_arg;
3use crate::wrap_command::FnOptionArg;
4
5pub const MESSAGE: &str = "--message";
6pub const ALL: &str = "--all";
7pub const PATCH: &str = "--patch";
8pub const REUSE_MESSAGE: &str = "--reuse-message";
9pub const REEDIT_MESSAGE: &str = "--reedit-message";
10pub const FIXUP: &str = "--fixup";
11pub const SQUASH: &str = "--squash";
12pub const RESET_AUTHOR: &str = "--reset-author";
13pub const SHORT: &str = "--short";
14pub const BRANCH: &str = "--branch";
15pub const PORCELAIN: &str = "--porcelain";
16pub const LONG: &str = "--long";
17pub const NULL: &str = "--null";
18pub const FILE: &str = "--file";
19pub const AUTHOR: &str = "--author";
20pub const DATE: &str = "--date";
21pub const TEMPLATE: &str = "--template";
22pub const SIGNOFF: &str = "--signoff";
23pub const NO_VERIFY: &str = "--no-verify";
24pub const ALLOW_EMPTY: &str = "--allow-empty";
25pub const ALLOW_EMPTY_MESSAGE: &str = "--allow-empty-message";
26pub const CLEANUP: &str = "--cleanup";
27pub const EDIT: &str = "--edit";
28pub const NO_EDIT: &str = "--no-edit";
29pub const AMEND: &str = "--amend";
30pub const NO_POST_REWRITE: &str = "--no-post-rewrite";
31pub const INCLUDE: &str = "--include";
32pub const ONLY: &str = "--only";
33pub const UNTRACKED_FILES: &str = "--untracked-files";
34pub const VERBOSE: &str = "--verbose";
35pub const QUIET: &str = "--quiet";
36pub const DRY_RUN: &str = "--dry-run";
37pub const STATUS: &str = "--status";
38pub const NO_STATUS: &str = "--no-status";
39pub const GPG_SIGN: &str = "--gpg-sign";
40pub const NO_GPG_SIGN: &str = "--no-gpg-sign";
41pub const HYPHEN_HYPHEN: &str = "--";
42
43/// Use the given <msg> as the commit message.
44/// If multiple -m options are given, their values are concatenated as separate paragraphs.
45/// -m <msg>, --message=<msg>
46pub fn message(msg_arg: &str) -> FnOptionArg {
47 option_arg::equal_no_optional(MESSAGE, msg_arg)
48}
49
50/// Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.
51/// -a, --all
52pub fn all() -> FnOptionArg {
53 option_arg::simple(ALL)
54}
55
56/// Use the interactive patch selection interface to chose which changes to commit.
57/// See git-add(1) for details.
58/// -p, --patch
59pub fn patch() -> FnOptionArg {
60 option_arg::simple(PATCH)
61}
62
63/// Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit.
64/// -C <commit>, --reuse-message=<commit>
65pub fn reuse_message(commit_arg: &str) -> FnOptionArg {
66 option_arg::equal_no_optional(REUSE_MESSAGE, commit_arg)
67}
68
69/// Like -C, but with -c the editor is invoked, so that the user can further edit the commit message.
70/// -c <commit>, --reedit-message=<commit>
71pub fn reedit_message(commit_arg: &str) -> FnOptionArg {
72 option_arg::equal_no_optional(REEDIT_MESSAGE, commit_arg)
73}
74
75/// Construct a commit message for use with rebase --autosquash.
76/// The commit message will be the subject line from the specified commit with a prefix of 'fixup! '.
77/// See git-rebase(1) for details.
78/// --fixup=<commit>
79pub fn fixup(commit_arg: &str) -> FnOptionArg {
80 option_arg::equal_no_optional(FIXUP, commit_arg)
81}
82
83/// Construct a commit message for use with rebase --autosquash.
84/// The commit message subject line is taken from the specified commit with a prefix of 'squash! '.
85/// Can be used with additional commit message options (-m/-c/-C/-F).
86/// See git-rebase(1) for details.
87/// --squash=<commit>
88pub fn squash(commit_arg: &str) -> FnOptionArg {
89 option_arg::equal_no_optional(SQUASH, commit_arg)
90}
91
92/// When used with -C/-c/--amend options, or when committing after a conflicting cherry-pick, declare that the authorship of the resulting commit now belongs to the committer.
93/// This also renews the author timestamp.
94/// --reset-author
95pub fn reset_author() -> FnOptionArg {
96 option_arg::simple(RESET_AUTHOR)
97}
98
99/// When doing a dry-run, give the output in the short-format.
100/// See git-status(1) for details.
101/// Implies --dry-run.
102/// --short
103pub fn short() -> FnOptionArg {
104 option_arg::simple(SHORT)
105}
106
107/// Show the branch and tracking info even in short-format.
108/// --branch
109pub fn branch() -> FnOptionArg {
110 option_arg::simple(BRANCH)
111}
112
113/// When doing a dry-run, give the output in a porcelain-ready format.
114/// See git-status(1) for details.
115/// Implies --dry-run.
116/// --porcelain
117pub fn porcelain() -> FnOptionArg {
118 option_arg::simple(PORCELAIN)
119}
120
121/// When doing a dry-run, give the output in the long-format.
122/// Implies --dry-run.
123/// --long
124pub fn long() -> FnOptionArg {
125 option_arg::simple(LONG)
126}
127
128/// When showing short or porcelain status output, print the filename verbatim and terminate the entries with NUL, instead of LF.
129/// If no format is given, implies the --porcelain output format.
130/// Without the -z option, filenames with 'unusual' characters are quoted as explained for the configuration variable core.quotePath (see git-config(1)).
131/// -z, --null
132pub fn null() -> FnOptionArg {
133 option_arg::simple(NULL)
134}
135
136/// Take the commit message from the given file.
137/// Use - to read the message from the standard input.
138/// -F <file>, --file=<file>
139pub fn file(file_arg: &str) -> FnOptionArg {
140 option_arg::equal_no_optional(FILE, file_arg)
141}
142
143/// Override the commit author.
144/// Specify an explicit author using the standard A U Thor <author@example.com> format.
145/// Otherwise <author> is assumed to be a pattern and is used to search for an existing commit by that author (i.e.
146/// rev-list --all -i --author=<author>); the commit author is then copied from the first such commit found.
147/// --author=<author>
148pub fn author(author_arg: &str) -> FnOptionArg {
149 option_arg::equal_no_optional(AUTHOR, author_arg)
150}
151
152/// Override the author date used in the commit.
153/// --date=<date>
154pub fn date(date_arg: &str) -> FnOptionArg {
155 option_arg::equal_no_optional(DATE, date_arg)
156}
157
158/// When editing the commit message, start the editor with the contents in the given file.
159/// The commit.template configuration variable is often used to give this option implicitly to the command.
160/// This mechanism can be used by projects that want to guide participants with some hints on what to write in the message in what order.
161/// If the user exits the editor without editing the message, the commit is aborted.
162/// This has no effect when a message is given by other means, e.g.
163/// with the -m or -F options.
164/// -t <file>, --template=<file>
165pub fn template(file_arg: &str) -> FnOptionArg {
166 option_arg::equal_no_optional(TEMPLATE, file_arg)
167}
168
169/// Add Signed-off-by line by the committer at the end of the commit log message.
170/// The meaning of a signoff depends on the project, but it typically certifies that committer has the rights to submit this work under the same license and agrees to a Developer Certificate of Origin (see https://developercertificate.org/ for more information).
171/// -s, --signoff
172pub fn signoff() -> FnOptionArg {
173 option_arg::simple(SIGNOFF)
174}
175
176/// This option bypasses the pre-commit and commit-msg hooks.
177/// See also githooks(5).
178/// -n, --no-verify
179pub fn no_verify() -> FnOptionArg {
180 option_arg::simple(NO_VERIFY)
181}
182
183/// Usually recording a commit that has the exact same tree as its sole parent commit is a mistake, and the command prevents you from making such a commit.
184/// This option bypasses the safety, and is primarily for use by foreign SCM interface scripts.
185/// --allow-empty
186pub fn allow_empty() -> FnOptionArg {
187 option_arg::simple(ALLOW_EMPTY)
188}
189
190/// Like --allow-empty this command is primarily for use by foreign SCM interface scripts.
191/// It allows you to create a commit with an empty commit message without using plumbing commands like git-commit-tree(1).
192/// --allow-empty-message
193pub fn allow_empty_message() -> FnOptionArg {
194 option_arg::simple(ALLOW_EMPTY_MESSAGE)
195}
196
197/// This option determines how the supplied commit message should be cleaned up before committing.
198/// The <mode> can be strip, whitespace, verbatim, scissors or default.
199/// --cleanup=<mode>
200pub fn cleanup(mode_arg: &str) -> FnOptionArg {
201 option_arg::equal_no_optional(CLEANUP, mode_arg)
202}
203
204/// The message taken from file with -F, command line with -m, and from commit object with -C are usually used as the commit log message unmodified.
205/// This option lets you further edit the message taken from these sources.
206/// -e, --edit
207pub fn edit() -> FnOptionArg {
208 option_arg::simple(EDIT)
209}
210
211/// Use the selected commit message without launching an editor.
212/// For example, git commit --amend --no-edit amends a commit without changing its commit message.
213/// --no-edit
214pub fn no_edit() -> FnOptionArg {
215 option_arg::simple(NO_EDIT)
216}
217
218/// Replace the tip of the current branch by creating a new commit.
219/// The recorded tree is prepared as usual (including the effect of the -i and -o options and explicit pathspec), and the message from the original commit is used as the starting point, instead of an empty message, when no other message is specified from the command line via options such as -m, -F, -c, etc.
220/// The new commit has the same parents and author as the current one (the --reset-author option can countermand this).
221/// --amend
222pub fn amend() -> FnOptionArg {
223 option_arg::simple(AMEND)
224}
225
226/// Bypass the post-rewrite hook.
227/// --no-post-rewrite
228pub fn no_post_rewrite() -> FnOptionArg {
229 option_arg::simple(NO_POST_REWRITE)
230}
231
232/// Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well.
233/// This is usually not what you want unless you are concluding a conflicted merge.
234/// -i, --include
235pub fn include() -> FnOptionArg {
236 option_arg::simple(INCLUDE)
237}
238
239/// Make a commit by taking the updated working tree contents of the paths specified on the command line, disregarding any contents that have been staged for other paths.
240/// This is the default mode of operation of git commit if any paths are given on the command line, in which case this option can be omitted.
241/// If this option is specified together with --amend, then no paths need to be specified, which can be used to amend the last commit without committing changes that have already been staged.
242/// If used together with --allow-empty paths are also not required, and an empty commit will be created.
243/// -o, --only
244pub fn only() -> FnOptionArg {
245 option_arg::simple(ONLY)
246}
247
248/// Show untracked files.
249/// The mode parameter is optional (defaults to all), and is used to specify the handling of untracked files; when -u is not used, the default is normal, i.e.
250/// show untracked files and directories.
251/// -u[<mode>], --untracked-files[=<mode>]
252pub fn untracked_files(mode_arg: &str) -> FnOptionArg {
253 option_arg::equal_no_optional(UNTRACKED_FILES, mode_arg)
254}
255
256/// Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has.
257/// Note that this diff output doesn’t have its lines prefixed with #.
258/// This diff will not be a part of the commit message.
259/// See the commit.verbose configuration variable in git-config(1).
260/// If specified twice, show in addition the unified diff between what would be committed and the worktree files, i.e.
261/// the unstaged changes to tracked files.
262/// -v, --verbose
263pub fn verbose() -> FnOptionArg {
264 option_arg::simple(VERBOSE)
265}
266
267/// Suppress commit summary message.
268/// -q, --quiet
269pub fn quiet() -> FnOptionArg {
270 option_arg::simple(QUIET)
271}
272
273/// Do not create a commit, but show a list of paths that are to be committed,
274/// paths with local changes that will be left uncommitted and paths that are untracked.
275/// --dry-run
276pub fn dry_run() -> FnOptionArg {
277 option_arg::simple(DRY_RUN)
278}
279
280/// Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message.
281/// Defaults to on, but can be used to override configuration variable commit.status.
282/// --status
283pub fn status() -> FnOptionArg {
284 option_arg::simple(STATUS)
285}
286
287/// Do not include the output of git-status(1) in the commit message template when using an editor to prepare the default commit message.
288/// --no-status
289pub fn no_status() -> FnOptionArg {
290 option_arg::simple(NO_STATUS)
291}
292
293/// GPG-sign commits.
294/// The keyid argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space.
295/// -S[<keyid>], --gpg-sign[=<keyid>]
296pub fn gpg_sign(keyid_arg: &str) -> FnOptionArg {
297 option_arg::equal_no_optional(GPG_SIGN, keyid_arg)
298}
299
300/// Countermand commit.gpgSign configuration variable that is set to force each and every commit to be signed.
301/// --no-gpg-sign
302pub fn no_gpg_sign() -> FnOptionArg {
303 option_arg::simple(NO_GPG_SIGN)
304}
305
306/// Do not interpret any more arguments as options
307/// --
308pub fn hyphen_hyphen() -> FnOptionArg {
309 option_arg::simple(HYPHEN_HYPHEN)
310}
311
312/// When pathspec is given on the command line, commit the contents of the files that match the pathspec without recording the changes already added to the index.
313/// The contents of these files are also staged for the next commit on top of what have been staged before.
314/// <pathspec>
315pub fn pathspec(pathspec: &str) -> FnOptionArg {
316 option_arg::value_parameter(pathspec)
317}