diff options
Diffstat (limited to 'cmd_commit.go')
-rw-r--r-- | cmd_commit.go | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/cmd_commit.go b/cmd_commit.go index db22642..170c511 100644 --- a/cmd_commit.go +++ b/cmd_commit.go @@ -1,3 +1,18 @@ +// Copyright (C) 2017-2018 Luke Shumaker <lukeshu@lukeshu.com> +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <https://www.gnu.org/licenses/>. + package libfastimport import ( @@ -9,6 +24,13 @@ import ( // M /////////////////////////////////////////////////////////////////////////// +// FileModify appears after a CmdCommit (and before a CmdCommitEnd), +// and causes the CmdCommit to add a new file or change the content of +// an existing file. The content of the file is specified by giving +// either a mark reference (":<idnum>") or by a full 40-byte SHA-1. +// +// To specify the full content of the file inline, use +// FileModifyInline instead. type FileModify struct { Mode Mode Path Path @@ -63,6 +85,13 @@ func (FileModify) fiCmdRead(fir fiReader) (cmd Cmd, err error) { } } +// FileModifyInline appears after a CmdCommit (and before a +// CmdCommitEnd), and causes the CmdCommit to add a new file or change +// the content of an existing file. The full content of the file are +// specified directly +// +// To instead specify the content with a mark reference (":<idnum>") +// or with a full 40-byte SHA-1, use FileModify instead. type FileModifyInline struct { Mode Mode Path Path @@ -80,6 +109,8 @@ func (FileModifyInline) fiCmdRead(fiReader) (Cmd, error) { panic("not reached") // D /////////////////////////////////////////////////////////////////////////// +// FileDelete appears after a CmdCommit (and before a CmdCommitEnd), +// and causes the CmdCommit to recursively remove a file or directory. type FileDelete struct { Path Path } @@ -99,6 +130,9 @@ func (FileDelete) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // C /////////////////////////////////////////////////////////////////////////// +// FileCopy appears after a CmdCommit (and before a CmdCommitEnd), +// and causes the CmdCommit to recursively copy an existing file or +// subdirectory to a different location. type FileCopy struct { Src Path Dst Path @@ -116,6 +150,9 @@ func (FileCopy) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // R /////////////////////////////////////////////////////////////////////////// +// FileRename appears after a CmdCommit (and before a CmdCommitEnd), +// and causes the CmdCommit to rename an existing file or subdirectory +// to a different location. type FileRename struct { Src string Dst string @@ -133,6 +170,9 @@ func (FileRename) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // deleteall /////////////////////////////////////////////////////////////////// +// FileDeleteAll appears after a CmdCommit (and before a +// CmdCommitEnd), and removes all files and directories from the +// CmdCommit. type FileDeleteAll struct{} func (o FileDeleteAll) fiCmdClass() cmdClass { return cmdClassCommit } @@ -150,6 +190,14 @@ func (FileDeleteAll) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // N /////////////////////////////////////////////////////////////////////////// +// NoteModify appears after a CmdCommit (and before a CmdCommitEnd), +// and causes the CmdCommit to add a new note describing CommitIsh or +// change the content of an existing note describing CommitIsh. The +// content of the note is specified by giving either a mark reference +// (":<idnum>") or by a full 40-byte SHA-1. +// +// To specify the full content of the note inline, use +// NoteModifyInline instead. type NoteModify struct { CommitIsh string DataRef string @@ -196,6 +244,14 @@ func (NoteModify) fiCmdRead(fir fiReader) (cmd Cmd, err error) { } } +// NoteModifyInline appears after a CmdCommit (and before a +// CmdCommitEnd), and causes the CmdCommit to add a new note +// describing CommitIsh or change the content of an existing note +// describing CommitIsh. The full content of the note is specified +// directly. +// +// To instead specify the content with a mark reference (":<idnum>") +// or with a full 40-byte SHA-1, use NoteModify instead. type NoteModifyInline struct { CommitIsh string Data string |