github.com/1800alex/go-git-cmd-wrapper@v1.1.0/commit/commit_gen.go (about) 1 package commit 2 3 // CODE GENERATED AUTOMATICALLY 4 // THIS FILE MUST NOT BE EDITED BY HAND 5 6 import ( 7 "fmt" 8 9 "github.com/ldez/go-git-cmd-wrapper/types" 10 ) 11 12 // All 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. 13 // -a, --all 14 func All(g *types.Cmd) { 15 g.AddOptions("--all") 16 } 17 18 // AllowEmpty 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. 19 // This option bypasses the safety, and is primarily for use by foreign SCM interface scripts. 20 // --allow-empty 21 func AllowEmpty(g *types.Cmd) { 22 g.AddOptions("--allow-empty") 23 } 24 25 // AllowEmptyMessage Like --allow-empty this command is primarily for use by foreign SCM interface scripts. 26 // It allows you to create a commit with an empty commit message without using plumbing commands like git-commit-tree(1). 27 // --allow-empty-message 28 func AllowEmptyMessage(g *types.Cmd) { 29 g.AddOptions("--allow-empty-message") 30 } 31 32 // Amend Replace the tip of the current branch by creating a new commit. 33 // 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. 34 // The new commit has the same parents and author as the current one (the --reset-author option can countermand this). 35 // --amend 36 func Amend(g *types.Cmd) { 37 g.AddOptions("--amend") 38 } 39 40 // Author Override the commit author. 41 // Specify an explicit author using the standard A U Thor <author@example.com> format. 42 // Otherwise <author> is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=<author>); the commit author is then copied from the first such commit found. 43 // --author=<author> 44 func Author(value string) func(*types.Cmd) { 45 return func(g *types.Cmd) { 46 g.AddOptions(fmt.Sprintf("--author=%s", value)) 47 } 48 } 49 50 // Branch Show the branch and tracking info even in short-format. 51 // --branch 52 func Branch(g *types.Cmd) { 53 g.AddOptions("--branch") 54 } 55 56 // Cleanup This option determines how the supplied commit message should be cleaned up before committing. 57 // The <mode> can be strip, whitespace, verbatim, scissors or default. 58 // --cleanup=<mode> 59 func Cleanup(mode string) func(*types.Cmd) { 60 return func(g *types.Cmd) { 61 g.AddOptions(fmt.Sprintf("--cleanup=%s", mode)) 62 } 63 } 64 65 // Date Override the author date used in the commit. 66 // --date=<date> 67 func Date(value string) func(*types.Cmd) { 68 return func(g *types.Cmd) { 69 g.AddOptions(fmt.Sprintf("--date=%s", value)) 70 } 71 } 72 73 // DryRun Do not create a commit, but show a list of paths that are to be committed, paths with local changes that will be left uncommitted and paths that are untracked. 74 // --dry-run 75 func DryRun(g *types.Cmd) { 76 g.AddOptions("--dry-run") 77 } 78 79 // Edit 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. 80 // This option lets you further edit the message taken from these sources. 81 // -e, --edit 82 func Edit(g *types.Cmd) { 83 g.AddOptions("--edit") 84 } 85 86 // File Take the commit message from the given file. 87 // Use - to read the message from the standard input. 88 // -F <file>, --file=<file> 89 func File(value string) func(*types.Cmd) { 90 return func(g *types.Cmd) { 91 g.AddOptions(fmt.Sprintf("--file=%s", value)) 92 } 93 } 94 95 // Fixup Construct a commit message for use with rebase --autosquash. 96 // The commit message will be the subject line from the specified commit with a prefix of 'fixup! '. 97 // See git-rebase(1) for details. 98 // --fixup=<commit> 99 func Fixup(commit string) func(*types.Cmd) { 100 return func(g *types.Cmd) { 101 g.AddOptions(fmt.Sprintf("--fixup=%s", commit)) 102 } 103 } 104 105 // GpgSign GPG-sign commits. 106 // The keyid argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space. 107 // -S[<keyid>], --gpg-sign[=<keyid>] 108 func GpgSign(keyid string) func(*types.Cmd) { 109 return func(g *types.Cmd) { 110 if len(keyid) == 0 { 111 g.AddOptions("--gpg-sign") 112 } else { 113 g.AddOptions(fmt.Sprintf("--gpg-sign=%s", keyid)) 114 } 115 } 116 } 117 118 // Include Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well. 119 // This is usually not what you want unless you are concluding a conflicted merge. 120 // -i, --include 121 func Include(g *types.Cmd) { 122 g.AddOptions("--include") 123 } 124 125 // Long When doing a dry-run, give the output in the long-format. 126 // Implies --dry-run. 127 // --long 128 func Long(g *types.Cmd) { 129 g.AddOptions("--long") 130 } 131 132 // NoEdit Use the selected commit message without launching an editor. 133 // For example, git commit --amend --no-edit amends a commit without changing its commit message. 134 // --no-edit 135 func NoEdit(g *types.Cmd) { 136 g.AddOptions("--no-edit") 137 } 138 139 // NoGpgSign Countermand commit.gpgSign configuration variable that is set to force each and every commit to be signed. 140 // --no-gpg-sign 141 func NoGpgSign(g *types.Cmd) { 142 g.AddOptions("--no-gpg-sign") 143 } 144 145 // NoPostRewrite Bypass the post-rewrite hook. 146 // --no-post-rewrite 147 func NoPostRewrite(g *types.Cmd) { 148 g.AddOptions("--no-post-rewrite") 149 } 150 151 // NoStatus Do not include the output of git-status(1) in the commit message template when using an editor to prepare the default commit message. 152 // --no-status 153 func NoStatus(g *types.Cmd) { 154 g.AddOptions("--no-status") 155 } 156 157 // NoVerify This option bypasses the pre-commit and commit-msg hooks. 158 // See also githooks(5). 159 // -n, --no-verify 160 func NoVerify(g *types.Cmd) { 161 g.AddOptions("--no-verify") 162 } 163 164 // Null When showing short or porcelain status output, print the filename verbatim and terminate the entries with NUL, instead of LF. 165 // If no format is given, implies the --porcelain output format. 166 // Without the -z option, filenames with 'unusual' characters are quoted as explained for the configuration variable core.quotePath (see git-config(1)). 167 // -z, --null 168 func Null(g *types.Cmd) { 169 g.AddOptions("--null") 170 } 171 172 // Only 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. 173 // 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. 174 // 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. 175 // If used together with --allow-empty paths are also not required, and an empty commit will be created. 176 // -o, --only 177 func Only(g *types.Cmd) { 178 g.AddOptions("--only") 179 } 180 181 // Patch Use the interactive patch selection interface to chose which changes to commit. 182 // See git-add(1) for details. 183 // -p, --patch 184 func Patch(g *types.Cmd) { 185 g.AddOptions("--patch") 186 } 187 188 // Porcelain When doing a dry-run, give the output in a porcelain-ready format. 189 // See git-status(1) for details. 190 // Implies --dry-run. 191 // --porcelain 192 func Porcelain(g *types.Cmd) { 193 g.AddOptions("--porcelain") 194 } 195 196 // Quiet Suppress commit summary message. 197 // -q, --quiet 198 func Quiet(g *types.Cmd) { 199 g.AddOptions("--quiet") 200 } 201 202 // ReeditMessage Like -C, but with -c the editor is invoked, so that the user can further edit the commit message. 203 // -c <commit>, --reedit-message=<commit> 204 func ReeditMessage(commit string) func(*types.Cmd) { 205 return func(g *types.Cmd) { 206 g.AddOptions(fmt.Sprintf("--reedit-message=%s", commit)) 207 } 208 } 209 210 // ResetAuthor 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. 211 // This also renews the author timestamp. 212 // --reset-author 213 func ResetAuthor(g *types.Cmd) { 214 g.AddOptions("--reset-author") 215 } 216 217 // ReuseMessage Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit. 218 // -C <commit>, --reuse-message=<commit> 219 func ReuseMessage(commit string) func(*types.Cmd) { 220 return func(g *types.Cmd) { 221 g.AddOptions(fmt.Sprintf("--reuse-message=%s", commit)) 222 } 223 } 224 225 // Short When doing a dry-run, give the output in the short-format. 226 // See git-status(1) for details. 227 // Implies --dry-run. 228 // --short 229 func Short(g *types.Cmd) { 230 g.AddOptions("--short") 231 } 232 233 // Signoff Add Signed-off-by line by the committer at the end of the commit log message. 234 // 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 http://developercertificate.org/ for more information). 235 // -s, --signoff 236 func Signoff(g *types.Cmd) { 237 g.AddOptions("--signoff") 238 } 239 240 // Squash Construct a commit message for use with rebase --autosquash. 241 // The commit message subject line is taken from the specified commit with a prefix of 'squash! '. 242 // Can be used with additional commit message options (-m/-c/-C/-F). 243 // See git-rebase(1) for details. 244 // --squash=<commit> 245 func Squash(commit string) func(*types.Cmd) { 246 return func(g *types.Cmd) { 247 g.AddOptions(fmt.Sprintf("--squash=%s", commit)) 248 } 249 } 250 251 // Status Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message. 252 // Defaults to on, but can be used to override configuration variable commit.status. 253 // --status 254 func Status(g *types.Cmd) { 255 g.AddOptions("--status") 256 } 257 258 // Template When editing the commit message, start the editor with the contents in the given file. 259 // The commit.template configuration variable is often used to give this option implicitly to the command. 260 // 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. 261 // If the user exits the editor without editing the message, the commit is aborted. 262 // This has no effect when a message is given by other means, e.g. with the -m or -F options. 263 // -t <file>, --template=<file> 264 func Template(file string) func(*types.Cmd) { 265 return func(g *types.Cmd) { 266 g.AddOptions(fmt.Sprintf("--template=%s", file)) 267 } 268 } 269 270 // UntrackedFiles Show untracked files. 271 // 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. show untracked files and directories. 272 // -u[<mode>], --untracked-files[=<mode>] 273 func UntrackedFiles(mode string) func(*types.Cmd) { 274 return func(g *types.Cmd) { 275 if len(mode) == 0 { 276 g.AddOptions("--untracked-files") 277 } else { 278 g.AddOptions(fmt.Sprintf("--untracked-files=%s", mode)) 279 } 280 } 281 } 282 283 // Verbose 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. 284 // Note that this diff output doesn’t have its lines prefixed with #. 285 // This diff will not be a part of the commit message. 286 // See the commit.verbose configuration variable in git-config(1). 287 // If specified twice, show in addition the unified diff between what would be committed and the worktree files, i.e. the unstaged changes to tracked files. 288 // -v, --verbose 289 func Verbose(g *types.Cmd) { 290 g.AddOptions("--verbose") 291 }