diff options
-rw-r--r-- | AnnexQueue.hs | 6 | ||||
-rw-r--r-- | Command/Add.hs | 4 | ||||
-rw-r--r-- | Command/Fix.hs | 2 | ||||
-rw-r--r-- | Command/FromKey.hs | 2 | ||||
-rw-r--r-- | Command/Lock.hs | 2 | ||||
-rw-r--r-- | Command/Unannex.hs | 2 | ||||
-rw-r--r-- | Git/Queue.hs | 17 | ||||
-rw-r--r-- | Upgrade/V1.hs | 8 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/bugs/git_command_line_constructed_by_unannex_command_has_tons_of_redundant_-a_paramters.mdwn | 2 |
10 files changed, 26 insertions, 20 deletions
diff --git a/AnnexQueue.hs b/AnnexQueue.hs index 4c35adfb8..b1678df07 100644 --- a/AnnexQueue.hs +++ b/AnnexQueue.hs @@ -21,10 +21,10 @@ import Utility {- Adds a git command to the queue, possibly running previously queued - actions if enough have accumulated. -} -add :: String -> [CommandParam] -> FilePath -> Annex () -add command params file = do +add :: String -> [CommandParam] -> [FilePath] -> Annex () +add command params files = do q <- getState repoqueue - store $ Git.Queue.add q command params file + store $ Git.Queue.add q command params files {- Runs the queue if it is full. Should be called periodically. -} flushWhenFull :: Annex () diff --git a/Command/Add.hs b/Command/Add.hs index 5c7cad044..51b95b9b5 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -87,6 +87,6 @@ cleanup file key = do force <- Annex.getState Annex.force if force - then AnnexQueue.add "add" [Param "-f", Param "--"] file - else AnnexQueue.add "add" [Param "--"] file + then AnnexQueue.add "add" [Param "-f", Param "--"] [file] + else AnnexQueue.add "add" [Param "--"] [file] return True diff --git a/Command/Fix.hs b/Command/Fix.hs index 60627e9df..47b0c4c9a 100644 --- a/Command/Fix.hs +++ b/Command/Fix.hs @@ -44,5 +44,5 @@ perform file link = do cleanup :: FilePath -> CommandCleanup cleanup file = do - AnnexQueue.add "add" [Param "--"] file + AnnexQueue.add "add" [Param "--"] [file] return True diff --git a/Command/FromKey.hs b/Command/FromKey.hs index fb9ab0775..d59f1de39 100644 --- a/Command/FromKey.hs +++ b/Command/FromKey.hs @@ -45,5 +45,5 @@ perform file = do cleanup :: FilePath -> CommandCleanup cleanup file = do - AnnexQueue.add "add" [Param "--"] file + AnnexQueue.add "add" [Param "--"] [file] return True diff --git a/Command/Lock.hs b/Command/Lock.hs index e55cd9e79..d39df5f33 100644 --- a/Command/Lock.hs +++ b/Command/Lock.hs @@ -33,5 +33,5 @@ perform file = do -- Checkout from HEAD to get rid of any changes that might be -- staged in the index, and get back to the previous symlink to -- the content. - AnnexQueue.add "checkout" [Param "HEAD", Param "--"] file + AnnexQueue.add "checkout" [Param "HEAD", Param "--"] [file] next $ return True -- no cleanup needed diff --git a/Command/Unannex.hs b/Command/Unannex.hs index f22503ee0..d3623ed99 100644 --- a/Command/Unannex.hs +++ b/Command/Unannex.hs @@ -78,6 +78,6 @@ cleanup file key = do -- Commit staged changes at end to avoid confusing the -- pre-commit hook if this file is later added back to -- git as a normal, non-annexed file. - AnnexQueue.add "commit" [Params "-a -m", Param "content removed from git annex"] "-a" + AnnexQueue.add "commit" [Params "-a -m", Param "content removed from git annex"] [] return True diff --git a/Git/Queue.hs b/Git/Queue.hs index e1ec0cd31..e080476b7 100644 --- a/Git/Queue.hs +++ b/Git/Queue.hs @@ -53,15 +53,15 @@ empty :: Queue empty = Queue 0 M.empty {- Adds an action to a queue. -} -add :: Queue -> String -> [CommandParam] -> FilePath -> Queue -add (Queue n m) subcommand params file = Queue (n + 1) m' +add :: Queue -> String -> [CommandParam] -> [FilePath] -> Queue +add (Queue n m) subcommand params files = Queue (n + 1) m' where action = Action subcommand params -- There are probably few items in the map, but there -- can be a lot of files per item. So, optimise adding -- files. - m' = M.insertWith' const action files m - files = file:(M.findWithDefault [] action m) + m' = M.insertWith' const action fs m + fs = files ++ (M.findWithDefault [] action m) {- Number of items in a queue. -} size :: Queue -> Int @@ -79,11 +79,14 @@ flush repo (Queue _ m) = do {- Runs an Action on a list of files in a git repository. - - - Complicated by commandline length limits. -} + - Complicated by commandline length limits. + - + - Intentionally runs the command even if the list of files is empty; + - this allows queueing commands that do not need a list of files. -} runAction :: Repo -> Action -> [FilePath] -> IO () -runAction repo action files = unless (null files) runxargs +runAction repo action files = + pOpen WriteToPipe "xargs" ("-0":"git":params) feedxargs where - runxargs = pOpen WriteToPipe "xargs" ("-0":"git":params) feedxargs params = toCommand $ gitCommandLine repo (Param (getSubcommand action):getParams action) feedxargs h = hPutStr h $ join "\0" files diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs index c0bbeebaf..165a48262 100644 --- a/Upgrade/V1.hs +++ b/Upgrade/V1.hs @@ -104,7 +104,7 @@ updateSymlinks = do link <- calcGitLink f k liftIO $ removeFile f liftIO $ createSymbolicLink link f - AnnexQueue.add "add" [Param "--"] f + AnnexQueue.add "add" [Param "--"] [f] moveLocationLogs :: Annex () moveLocationLogs = do @@ -134,9 +134,9 @@ moveLocationLogs = do old <- readLog f new <- readLog dest writeLog dest (old++new) - AnnexQueue.add "add" [Param "--"] dest - AnnexQueue.add "add" [Param "--"] f - AnnexQueue.add "rm" [Param "--quiet", Param "-f", Param "--"] f + AnnexQueue.add "add" [Param "--"] [dest] + AnnexQueue.add "add" [Param "--"] [f] + AnnexQueue.add "rm" [Param "--quiet", Param "-f", Param "--"] [f] oldlog2key :: FilePath -> Maybe (FilePath, Key) oldlog2key l = diff --git a/debian/changelog b/debian/changelog index 673084d2d..9a7c3e7b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ git-annex (3.20110708) UNRELEASED; urgency=low * add: Be even more robust to avoid ever leaving the file seemingly deleted. * Bugfix: Make add ../ work. * Support the standard git -c name=value + * unannex: Clean up use of git commit -a. -- Joey Hess <joeyh@debian.org> Thu, 07 Jul 2011 21:28:49 -0400 diff --git a/doc/bugs/git_command_line_constructed_by_unannex_command_has_tons_of_redundant_-a_paramters.mdwn b/doc/bugs/git_command_line_constructed_by_unannex_command_has_tons_of_redundant_-a_paramters.mdwn index 80bf562ec..181b02b5c 100644 --- a/doc/bugs/git_command_line_constructed_by_unannex_command_has_tons_of_redundant_-a_paramters.mdwn +++ b/doc/bugs/git_command_line_constructed_by_unannex_command_has_tons_of_redundant_-a_paramters.mdwn @@ -11,3 +11,5 @@ This doesn't look right: simons 16543 0.3 0.0 15644 1744 pts/1 SN+ 04:14 2:13 | | \_ git --git-dir=/home/simons/annex/.git --work-tree=/home/simons/annex cat-file --batch simons 14224 0.0 0.0 100744 796 pts/1 SN+ 14:10 0:00 | | \_ xargs -0 git --git-dir=/home/simons/annex/.git --work-tree=/home/simons/annex commit -a -m content removed from git annex simons 14225 0.4 0.1 32684 18652 pts/1 DN+ 14:10 0:00 | | \_ git --git-dir=/home/simons/annex/.git --work-tree=/home/simons/annex commit -a -m content removed from git annex -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a + +> [[Fixed|done]] --[[Joey]] |