diff options
-rw-r--r-- | CmdLine/Seek.hs | 19 | ||||
-rw-r--r-- | Command/Add.hs | 11 | ||||
-rw-r--r-- | Command/Uninit.hs | 2 | ||||
-rw-r--r-- | Types/MetaData.hs | 4 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/bugs/Assistant_lost_dbus_connection_spamming_log.mdwn | 10 | ||||
-rw-r--r-- | doc/bugs/Feature_request:_Flag_to_make_git_annex_add_not_ignore_dotfiles.mdwn | 7 | ||||
-rw-r--r-- | doc/bugs/git_annex_test_under_windows_8.1.mdwn | 3 | ||||
-rw-r--r-- | doc/bugs/set_metadata_on_wrong_files.mdwn | 2 | ||||
-rw-r--r-- | doc/git-annex.mdwn | 17 | ||||
-rw-r--r-- | doc/metadata.mdwn | 8 | ||||
-rw-r--r-- | git-annex.cabal | 5 |
12 files changed, 63 insertions, 26 deletions
diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs index e95b9f005..abbe52af8 100644 --- a/CmdLine/Seek.hs +++ b/CmdLine/Seek.hs @@ -30,14 +30,15 @@ withFilesInGit :: (FilePath -> CommandStart) -> CommandSeek withFilesInGit a params = seekActions $ prepFiltered a $ seekHelper LsFiles.inRepo params -withFilesNotInGit :: (FilePath -> CommandStart) -> CommandSeek -withFilesNotInGit a params = do - {- dotfiles are not acted on unless explicitly listed -} - files <- filter (not . dotfile) <$> - seekunless (null ps && not (null params)) ps - dotfiles <- seekunless (null dotps) dotps - seekActions $ prepFiltered a $ - return $ concat $ segmentPaths params (files++dotfiles) +withFilesNotInGit :: Bool -> (FilePath -> CommandStart) -> CommandSeek +withFilesNotInGit skipdotfiles a params + | skipdotfiles = do + {- dotfiles are not acted on unless explicitly listed -} + files <- filter (not . dotfile) <$> + seekunless (null ps && not (null params)) ps + dotfiles <- seekunless (null dotps) dotps + go (files++dotfiles) + | otherwise = go =<< seekunless False params where (dotps, ps) = partition dotfile params seekunless True _ = return [] @@ -45,6 +46,8 @@ withFilesNotInGit a params = do force <- Annex.getState Annex.force g <- gitRepo liftIO $ Git.Command.leaveZombie <$> LsFiles.notInRepo force l g + go l = seekActions $ prepFiltered a $ + return $ concat $ segmentPaths params l withPathContents :: ((FilePath, FilePath) -> CommandStart) -> CommandSeek withPathContents a params = seekActions $ diff --git a/Command/Add.hs b/Command/Add.hs index 0c8e2a48d..f9e2b3342 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -34,8 +34,12 @@ import Annex.ReplaceFile import Utility.Tmp def :: [Command] -def = [notBareRepo $ command "add" paramPaths seek SectionCommon - "add files to annex"] +def = [notBareRepo $ withOptions [includeDotFilesOption] $ + command "add" paramPaths seek SectionCommon + "add files to annex"] + +includeDotFilesOption :: Option +includeDotFilesOption = flagOption [] "include-dotfiles" "don't skip dotfiles" {- Add acts on both files not checked into git yet, and unlocked files. - @@ -47,7 +51,8 @@ seek ps = do ( start file , stop ) - go withFilesNotInGit + skipdotfiles <- not <$> Annex.getFlag (optionName includeDotFilesOption) + go $ withFilesNotInGit skipdotfiles ifM isDirect ( go withFilesMaybeModified , go withFilesUnlocked diff --git a/Command/Uninit.hs b/Command/Uninit.hs index 2a9e3e687..5b2adf0bd 100644 --- a/Command/Uninit.hs +++ b/Command/Uninit.hs @@ -36,7 +36,7 @@ check = do seek :: CommandSeek seek ps = do - withFilesNotInGit (whenAnnexed startCheckIncomplete) ps + withFilesNotInGit False (whenAnnexed startCheckIncomplete) ps withFilesInGit (whenAnnexed Command.Unannex.start) ps finish diff --git a/Types/MetaData.hs b/Types/MetaData.hs index 706d037bc..8df56734d 100644 --- a/Types/MetaData.hs +++ b/Types/MetaData.hs @@ -264,7 +264,9 @@ parseMetaData p = (,) instance Arbitrary MetaData where arbitrary = do size <- arbitrarySizedBoundedIntegral `suchThat` (< 500) - MetaData . M.fromList <$> vector size + MetaData . M.filterWithKey legal . M.fromList <$> vector size + where + legal k _v = legalField $ fromMetaField k instance Arbitrary MetaValue where arbitrary = MetaValue <$> arbitrary <*> arbitrary diff --git a/debian/changelog b/debian/changelog index eee5509ba..f237f019d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ git-annex (5.20140321) UNRELEASED; urgency=medium a remote git repository, as long as a git-annex branch has been pushed to it, to simplify setup of remote git repositories, including via gitolite. + * add --include-dotfiles: New option, perhaps useful for backups. -- Joey Hess <joeyh@debian.org> Fri, 21 Mar 2014 14:08:41 -0400 diff --git a/doc/bugs/Assistant_lost_dbus_connection_spamming_log.mdwn b/doc/bugs/Assistant_lost_dbus_connection_spamming_log.mdwn index 3b50742fd..a4a0b0221 100644 --- a/doc/bugs/Assistant_lost_dbus_connection_spamming_log.mdwn +++ b/doc/bugs/Assistant_lost_dbus_connection_spamming_log.mdwn @@ -76,3 +76,13 @@ accept: unsupported operation (Function not implemented) lost dbus connection; falling back to polling (SocketError {socketErrorMessage = "connect: does not exist (No such file or directory)", socketErrorFatal = True, socketErrorAddress = Just (Address "unix:path=/var/run/dbus/system_bus_socket")}) """]] + +> [[done]]; This turned out to not be dbus related, but the http server failing, +> and I fixed that bug. +> +> AFAICS the user running git-annex did not have their own dbus daemon +> running, and that's why the low-volume dbus messages come up. +> Probably because this is an embedded device, and so no desktop +> environment. git-annex only uses dbus for detecting network connection +> changes and removable media mounts. None of which probably matter in an +> embedded environment. --[[Joey]] diff --git a/doc/bugs/Feature_request:_Flag_to_make_git_annex_add_not_ignore_dotfiles.mdwn b/doc/bugs/Feature_request:_Flag_to_make_git_annex_add_not_ignore_dotfiles.mdwn index f82d8835f..686bf1887 100644 --- a/doc/bugs/Feature_request:_Flag_to_make_git_annex_add_not_ignore_dotfiles.mdwn +++ b/doc/bugs/Feature_request:_Flag_to_make_git_annex_add_not_ignore_dotfiles.mdwn @@ -5,3 +5,10 @@ AFAICT there's no way to tell git annex add to add all dotfiles in a given direc This can be worked around with find and xargs, but this is more work than it should be, I think. It might also be nice if git annex add displayed a warning when adding a directory with dotfiles; something like "Warning, N files ignored; pass --whatever to add them." + +> [[!commit 34abd7bca80a8cc012f92d64116014449b1b2392]] explains +> the rationalle for dotfiles to be skipped. Such as it was. +> +> I don't think it makes sense for --force to be the flag to override +> this, because you may want to add dotfiles, but not .gitignored +> files. So, made a new --include-dotfiles option. [[done]] --[[Joey]] diff --git a/doc/bugs/git_annex_test_under_windows_8.1.mdwn b/doc/bugs/git_annex_test_under_windows_8.1.mdwn index efdd8f2cf..2ca64eb61 100644 --- a/doc/bugs/git_annex_test_under_windows_8.1.mdwn +++ b/doc/bugs/git_annex_test_under_windows_8.1.mdwn @@ -62,3 +62,6 @@ e s tDse.t # End of transcript or log. """]] + +> A sort of windows-specific bug in the test suite. I've fixed it. [[done]] +> --[[Joey]] diff --git a/doc/bugs/set_metadata_on_wrong_files.mdwn b/doc/bugs/set_metadata_on_wrong_files.mdwn index add68bae5..e31714784 100644 --- a/doc/bugs/set_metadata_on_wrong_files.mdwn +++ b/doc/bugs/set_metadata_on_wrong_files.mdwn @@ -86,3 +86,5 @@ metadata c.txt num=3 ok """]] + +> [[fixed|done]]; documentation improved --[[Joey]] diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index a1005cbc8..51f618d0a 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -62,10 +62,14 @@ subdirectories). * `add [path ...]` - Adds files in the path to the annex. Files that are already checked into - git, or that git has been configured to ignore will be silently skipped. - (Use `--force` to add ignored files.) Dotfiles are skipped unless explicitly - listed. + Adds files in the path to the annex. If no path is specified, adds + files from the current directory and below. + + Files that are already checked into git, or that git has been configured + to ignore will be silently skipped. (Use `--force` to add ignored files.) + + Dotfiles are skipped unless explicitly listed, or the --include-dotfiles + option is used. * `get [path ...]` @@ -707,8 +711,9 @@ subdirectories). * `metadata [path ...] [-s field=value -s field+=value -s field-=value ...] [-g field]` - Each file can have any number of metadata fields attached to it, - which each in turn have any number of values. + The content of a file can have any number of metadata fields + attached to it to describe it. Each metadata field can in turn + have any number of values. This command can be used to set metadata, or show the currently set metadata. diff --git a/doc/metadata.mdwn b/doc/metadata.mdwn index 9f3c314fa..684820cb9 100644 --- a/doc/metadata.mdwn +++ b/doc/metadata.mdwn @@ -1,7 +1,7 @@ -git-annex allows you to store arbitrary metadata about files stored in the -git-annex repository. The metadata is stored in the `git-annex` branch, and -so is automatically kept in sync with the rest of git-annex's state, such -as [[location_tracking]] information. +git-annex allows you to store arbitrary metadata about the content of files +stored in the git-annex repository. The metadata is stored in the +`git-annex` branch, and so is automatically kept in sync with the rest of +git-annex's state, such as [[location_tracking]] information. Some of the things you can do with metadata include: diff --git a/git-annex.cabal b/git-annex.cabal index 0f8987915..a1fcdd24c 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -190,11 +190,10 @@ Executable git-annex yesod, yesod-default, yesod-static, yesod-form, yesod-core, http-types, transformers, wai, wai-logger, warp, warp-tls, blaze-builder, crypto-api, hamlet, clientsession, - template-haskell, data-default, aeson, network-conduit, - byteable + template-haskell, data-default, aeson, network-conduit CPP-Options: -DWITH_WEBAPP if flag(Webapp) && flag (Webapp-secure) - Build-Depends: warp-tls (>= 1.4), securemem + Build-Depends: warp-tls (>= 1.4), securemem, byteable CPP-Options: -DWITH_WEBAPP_SECURE if flag(Pairing) |