git-annex assist
assist: New command, which is the same as git-annex sync but with
new files added and content transferred by default.
(Also this fixes another reversion in git-annex sync,
--commit --no-commit, and --message were not enabled, oops.)
See added comment for why git-annex assist does commit staged
changes elsewhere in the work tree, but only adds files under
the cwd.
Note that it does not support --no-commit, --no-push, --no-pull
like sync does. My thinking is, why should it? If you want that
level of control, use git commit, git annex push, git annex pull.
Sync only got those options because pull and push were not split
out.
Sponsored-by: k0ld on Patreon
2023-05-18 18:37:29 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
|
|
|
- Copyright 2023 Joey Hess <id@joeyh.name>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Assist (cmd) where
|
|
|
|
|
|
|
|
import Command
|
|
|
|
import qualified Command.Sync
|
|
|
|
import qualified Command.Add
|
|
|
|
import Annex.CheckIgnore
|
2023-05-18 18:56:13 +00:00
|
|
|
import qualified Annex.Queue
|
git-annex assist
assist: New command, which is the same as git-annex sync but with
new files added and content transferred by default.
(Also this fixes another reversion in git-annex sync,
--commit --no-commit, and --message were not enabled, oops.)
See added comment for why git-annex assist does commit staged
changes elsewhere in the work tree, but only adds files under
the cwd.
Note that it does not support --no-commit, --no-push, --no-pull
like sync does. My thinking is, why should it? If you want that
level of control, use git commit, git annex push, git annex pull.
Sync only got those options because pull and push were not split
out.
Sponsored-by: k0ld on Patreon
2023-05-18 18:37:29 +00:00
|
|
|
|
|
|
|
cmd :: Command
|
|
|
|
cmd = withAnnexOptions [jobsOption, backendOption] $
|
|
|
|
command "assist" SectionCommon
|
|
|
|
"add files and sync changes with remotes"
|
|
|
|
(paramRepeating paramRemote)
|
|
|
|
(myseek <--< Command.Sync.optParser Command.Sync.AssistMode)
|
|
|
|
|
|
|
|
myseek :: Command.Sync.SyncOptions -> CommandSeek
|
2023-07-05 16:24:04 +00:00
|
|
|
myseek o = do
|
2023-05-19 18:47:05 +00:00
|
|
|
-- Changes to top of repository, so when this is run in a
|
|
|
|
-- subdirectory, it will still default to adding files anywhere in
|
|
|
|
-- the working tree.
|
|
|
|
Command.Sync.prepMerge
|
|
|
|
|
git-annex assist
assist: New command, which is the same as git-annex sync but with
new files added and content transferred by default.
(Also this fixes another reversion in git-annex sync,
--commit --no-commit, and --message were not enabled, oops.)
See added comment for why git-annex assist does commit staged
changes elsewhere in the work tree, but only adds files under
the cwd.
Note that it does not support --no-commit, --no-push, --no-pull
like sync does. My thinking is, why should it? If you want that
level of control, use git commit, git annex push, git annex pull.
Sync only got those options because pull and push were not split
out.
Sponsored-by: k0ld on Patreon
2023-05-18 18:37:29 +00:00
|
|
|
Command.Add.seek Command.Add.AddOptions
|
2023-05-19 18:47:05 +00:00
|
|
|
{ Command.Add.addThese = Command.Sync.contentOfOption o
|
git-annex assist
assist: New command, which is the same as git-annex sync but with
new files added and content transferred by default.
(Also this fixes another reversion in git-annex sync,
--commit --no-commit, and --message were not enabled, oops.)
See added comment for why git-annex assist does commit staged
changes elsewhere in the work tree, but only adds files under
the cwd.
Note that it does not support --no-commit, --no-push, --no-pull
like sync does. My thinking is, why should it? If you want that
level of control, use git commit, git annex push, git annex pull.
Sync only got those options because pull and push were not split
out.
Sponsored-by: k0ld on Patreon
2023-05-18 18:37:29 +00:00
|
|
|
, Command.Add.batchOption = NoBatch
|
|
|
|
, Command.Add.updateOnly = False
|
|
|
|
, Command.Add.largeFilesOverride = Nothing
|
2023-05-24 18:04:09 +00:00
|
|
|
, Command.Add.checkGitIgnoreOption = CheckGitIgnore True
|
git-annex assist
assist: New command, which is the same as git-annex sync but with
new files added and content transferred by default.
(Also this fixes another reversion in git-annex sync,
--commit --no-commit, and --message were not enabled, oops.)
See added comment for why git-annex assist does commit staged
changes elsewhere in the work tree, but only adds files under
the cwd.
Note that it does not support --no-commit, --no-push, --no-pull
like sync does. My thinking is, why should it? If you want that
level of control, use git commit, git annex push, git annex pull.
Sync only got those options because pull and push were not split
out.
Sponsored-by: k0ld on Patreon
2023-05-18 18:37:29 +00:00
|
|
|
, Command.Add.dryRunOption = DryRun False
|
|
|
|
}
|
2023-07-05 16:24:04 +00:00
|
|
|
finishCommandActions
|
2023-05-18 18:56:13 +00:00
|
|
|
-- Flush added files to index so they will be committed.
|
|
|
|
Annex.Queue.flush
|
|
|
|
|
2023-05-18 18:50:05 +00:00
|
|
|
Command.Sync.seek' o
|