From 970e8578c5326ad236304ecbaba05920c80448bd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 23 Oct 2018 12:34:16 -0400 Subject: License under the AGPL --- cmd_commit.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cmd_commit.go') diff --git a/cmd_commit.go b/cmd_commit.go index 1e2672d..05baac5 100644 --- a/cmd_commit.go +++ b/cmd_commit.go @@ -1,3 +1,18 @@ +// Copyright (C) 2017 Luke Shumaker +// +// 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 . + package libfastimport import ( -- cgit v1.2.3 From 392cc1262df7203a6c8b4f6b692cd69950ccc598 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 23 Oct 2018 13:31:53 -0400 Subject: Add godoc comments --- cmd_commit.go | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'cmd_commit.go') diff --git a/cmd_commit.go b/cmd_commit.go index 05baac5..83b9815 100644 --- a/cmd_commit.go +++ b/cmd_commit.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Luke Shumaker +// Copyright (C) 2017-2018 Luke Shumaker // // 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 @@ -25,6 +25,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 (":") or by a full 40-byte SHA-1. +// +// To specify the full content of the file inline, use +// FileModifyInline instead. type FileModify struct { Mode textproto.Mode Path textproto.Path @@ -79,6 +86,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 (":") +// or with a full 40-byte SHA-1, use FileModify instead. type FileModifyInline struct { Mode textproto.Mode Path textproto.Path @@ -96,6 +110,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 textproto.Path } @@ -115,6 +131,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 textproto.Path Dst textproto.Path @@ -132,6 +151,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 @@ -149,6 +171,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 } @@ -166,6 +191,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 +// (":") 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 @@ -212,6 +245,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 (":") +// or with a full 40-byte SHA-1, use NoteModify instead. type NoteModifyInline struct { CommitIsh string Data string -- cgit v1.2.3