Merge branch 'master' into v3

Conflicts:
	debian/changelog
This commit is contained in:
Joey Hess 2011-06-29 11:42:35 -04:00
commit af45d42224
6 changed files with 29 additions and 9 deletions

View file

@ -142,7 +142,8 @@ withFilesMissing a params = do
withFilesNotInGit :: CommandSeekBackendFiles withFilesNotInGit :: CommandSeekBackendFiles
withFilesNotInGit a params = do withFilesNotInGit a params = do
repo <- Annex.gitRepo repo <- Annex.gitRepo
newfiles <- liftIO $ runPreserveOrder (Git.notInRepo repo) params force <- Annex.getState Annex.force
newfiles <- liftIO $ runPreserveOrder (Git.notInRepo repo force) params
newfiles' <- filterFiles newfiles newfiles' <- filterFiles newfiles
backendPairs a newfiles' backendPairs a newfiles'
withWords :: CommandSeekWords withWords :: CommandSeekWords

View file

@ -11,6 +11,7 @@ import Control.Monad.State (liftIO)
import System.Posix.Files import System.Posix.Files
import Command import Command
import qualified Annex
import qualified AnnexQueue import qualified AnnexQueue
import qualified Backend import qualified Backend
import LocationLog import LocationLog
@ -60,5 +61,8 @@ cleanup file key = do
let mtime = modificationTime s let mtime = modificationTime s
liftIO $ touch file (TimeSpec mtime) False liftIO $ touch file (TimeSpec mtime) False
AnnexQueue.add "add" [Param "--"] file force <- Annex.getState Annex.force
if force
then AnnexQueue.add "add" [Param "-f", Param "--"] file
else AnnexQueue.add "add" [Param "--"] file
return True return True

View file

@ -435,13 +435,15 @@ shaSize = 40
{- Scans for files that are checked into git at the specified locations. -} {- Scans for files that are checked into git at the specified locations. -}
inRepo :: Repo -> [FilePath] -> IO [FilePath] inRepo :: Repo -> [FilePath] -> IO [FilePath]
inRepo repo l = pipeNullSplit repo $ inRepo repo l = pipeNullSplit repo $
[Params "ls-files --cached --exclude-standard -z --"] ++ map File l [Params "ls-files --cached -z --"] ++ map File l
{- Scans for files at the specified locations that are not checked into git, {- Scans for files at the specified locations that are not checked into
- and not gitignored. -} - git. -}
notInRepo :: Repo -> [FilePath] -> IO [FilePath] notInRepo :: Repo -> Bool -> [FilePath] -> IO [FilePath]
notInRepo repo l = pipeNullSplit repo $ notInRepo repo include_ignored l =
[Params "ls-files --others --exclude-standard -z --"] ++ map File l pipeNullSplit repo $ [Params "ls-files --others"]++exclude++[Params "-z --"] ++ map File l
where
exclude = if include_ignored then [] else [Param "--exclude-standard"]
{- Returns a list of all files that are staged for commit. -} {- Returns a list of all files that are staged for commit. -}
stagedFiles :: Repo -> [FilePath] -> IO [FilePath] stagedFiles :: Repo -> [FilePath] -> IO [FilePath]

1
debian/changelog vendored
View file

@ -2,6 +2,7 @@ git-annex (3.20110625) UNRELEASED; urgency=low
* Always ensure git-annex branch exists. * Always ensure git-annex branch exists.
* Modify location log parser to allow future expansion. * Modify location log parser to allow future expansion.
* --force will cause add, etc, to operate on ignored files.
-- Joey Hess <joeyh@debian.org> Sun, 26 Jun 2011 21:01:06 -0400 -- Joey Hess <joeyh@debian.org> Sun, 26 Jun 2011 21:01:06 -0400

View file

@ -0,0 +1,11 @@
I have this line in the .gitignore file of one of my repos:
*log
So the command 'git annex init name' fails to add the file ".git-annex/uuid.log", and the same problem happens when git-annex-add'ing files.
> This is avoided on the v3 branch, which does not store these files in the
> same branch as your repository.
Also, when a file is git-ignored, it should be possible to 'git annex add' it with a -f/--force option, the same way git does it.
> Reasonable, [[done]] --[[Joey]]

View file

@ -319,7 +319,8 @@ Many git-annex commands will stage changes for later `git commit` by you.
* --force * --force
Force unsafe actions, such as dropping a file's content when no other Force unsafe actions, such as dropping a file's content when no other
source of it can be verified to still exist. Use with care. source of it can be verified to still exist, or adding ignored files.
Use with care.
* --fast * --fast