From 0b11c71740d6d5a48ae8f6a9bb63e34b49992079 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Jun 2013 16:41:02 -0400 Subject: [PATCH] Android: Add .thumbnails to .gitignore when setting up a camera repository. --- Assistant/WebApp/Configurators/Local.hs | 19 ++++++++++++++----- debian/changelog | 2 ++ ...d_ignore_.thumbnails__47___on_android.mdwn | 5 +++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs index 3da22c3351..5462704c88 100644 --- a/Assistant/WebApp/Configurators/Local.hs +++ b/Assistant/WebApp/Configurators/Local.hs @@ -151,11 +151,18 @@ postFirstRepositoryR = page "Getting started" (Just Configuration) $ do ((res, form), enctype) <- liftH $ runFormPost $ newRepositoryForm path case res of FormSuccess (RepositoryPath p) -> liftH $ - startFullAssistant (T.unpack p) ClientGroup + startFullAssistant (T.unpack p) ClientGroup Nothing _ -> $(widgetFile "configurators/newrepository/first") getAndroidCameraRepositoryR :: Handler () -getAndroidCameraRepositoryR = startFullAssistant "/sdcard/DCIM" SourceGroup +getAndroidCameraRepositoryR = + startFullAssistant "/sdcard/DCIM" SourceGroup $ Just addignore + where + addignore = do + liftIO $ unlessM (doesFileExist ".gitignore") $ + writeFile ".gitignore" ".thumbnails/*" + void $ inRepo $ + Git.Command.runBool [Param "add", File ".gitignore"] {- Adding a new local repository, which may be entirely separate, or may - be connected to the current repository. -} @@ -315,13 +322,15 @@ driveList = return [] {- Bootstraps from first run mode to a fully running assistant in a - repository, by running the postFirstRun callback, which returns the - url to the new webapp. -} -startFullAssistant :: FilePath -> StandardGroup -> Handler () -startFullAssistant path repogroup = do +startFullAssistant :: FilePath -> StandardGroup -> Maybe (Annex ())-> Handler () +startFullAssistant path repogroup setup = do webapp <- getYesod url <- liftIO $ do isnew <- makeRepo path False u <- initRepo isnew True path Nothing - inDir path $ setStandardGroup u repogroup + inDir path $ do + setStandardGroup u repogroup + maybe noop id setup addAutoStartFile path setCurrentDirectory path fromJust $ postFirstRun webapp diff --git a/debian/changelog b/debian/changelog index f5a8f51287..72526499e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ git-annex (4.20130602) UNRELEASED; urgency=low * Supports indirect mode on encfs in paranoia mode, and other filesystems that do not support hard links, but do support symlinks and other POSIX filesystem features. + * Android: Add .thumbnails to .gitignore when setting up a camera + repository. -- Joey Hess Mon, 10 Jun 2013 12:52:44 -0400 diff --git a/doc/bugs/Should_ignore_.thumbnails__47___on_android.mdwn b/doc/bugs/Should_ignore_.thumbnails__47___on_android.mdwn index b24eb7b45d..30dc5caeec 100644 --- a/doc/bugs/Should_ignore_.thumbnails__47___on_android.mdwn +++ b/doc/bugs/Should_ignore_.thumbnails__47___on_android.mdwn @@ -21,3 +21,8 @@ Install git-annex on Android and choose the defaults for a camera repository. # End of transcript or log. """]] + +> I've [[done]] this, however the .gitignore file it writes will +> not actually be used by the assistant until it gets support +> for querying gitignore settings from git. There is already a +> bug tracking that, and it's in process. --[[Joey]]