diff options
-rw-r--r-- | Command/Commit.hs | 23 | ||||
-rw-r--r-- | doc/git-annex-shell.mdwn | 4 | ||||
-rw-r--r-- | git-annex-shell.hs | 2 |
3 files changed, 29 insertions, 0 deletions
diff --git a/Command/Commit.hs b/Command/Commit.hs new file mode 100644 index 000000000..2bb016ea0 --- /dev/null +++ b/Command/Commit.hs @@ -0,0 +1,23 @@ +{- git-annex command + - + - Copyright 2012 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Command.Commit where + +import Command +import qualified Annex.Branch + +def :: [Command] +def = [command "commit" paramNothing seek + "commits any staged changes to the git-annex branch"] + +seek :: [CommandSeek] +seek = [withNothing start] + +start :: CommandStart +start = next $ next $ do + Annex.Branch.commit "update" + return True diff --git a/doc/git-annex-shell.mdwn b/doc/git-annex-shell.mdwn index 7a65f1077..0fd77a811 100644 --- a/doc/git-annex-shell.mdwn +++ b/doc/git-annex-shell.mdwn @@ -46,6 +46,10 @@ first "/~/" or "/~user/" is expanded to the specified home directory. This runs rsync in server mode to transfer out the content of a key. +* commit + + This commits any staged changes to the git-annex branch. + # OPTIONS Most options are the same as in git-annex. The ones specific diff --git a/git-annex-shell.hs b/git-annex-shell.hs index 4fdeae1a8..396b7b790 100644 --- a/git-annex-shell.hs +++ b/git-annex-shell.hs @@ -20,6 +20,7 @@ import qualified Command.InAnnex import qualified Command.DropKey import qualified Command.RecvKey import qualified Command.SendKey +import qualified Command.Commit cmds_readonly :: [Command] cmds_readonly = concat @@ -32,6 +33,7 @@ cmds_notreadonly :: [Command] cmds_notreadonly = concat [ Command.RecvKey.def , Command.DropKey.def + , Command.Commit.def ] cmds :: [Command] |