add git-annex-shell commit

Eventually, git-annex might try running this after making changes to
a remote. I have not yet thought of a good way for it to tell which
remotes it needs to run it on though. It can't just do it when
shutting down a cached ssh connection, because ssh connection caching
is optional, and that would not handle local remotes not accessed over ssh
either.
This commit is contained in:
Joey Hess 2012-02-25 16:31:38 -04:00
parent 1f73db3469
commit a3c9d06a26
3 changed files with 29 additions and 0 deletions

23
Command/Commit.hs Normal file
View file

@ -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

View file

@ -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

View file

@ -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]