packages feed

git-annex 5.20141231 → 5.20150113

raw patch · 73 files changed

+784/−304 lines, 73 files

Files

Annex.hs view
@@ -31,6 +31,7 @@ 	changeGitRepo, 	getRemoteGitConfig, 	withCurrentState,+	changeDirectory, ) where  import Common@@ -187,7 +188,7 @@  - Ensures the config is read, if it was not already. -} new :: Git.Repo -> IO AnnexState new r = do-	r' <- Git.Config.read r+	r' <- Git.Config.read =<< Git.relPath r 	let c = extractGitConfig r' 	newState c <$> if annexDirect c then fixupDirect r' else return r' @@ -300,3 +301,14 @@ withCurrentState a = do 	s <- getState id 	return $ eval s a++{- It's not safe to use setCurrentDirectory in the Annex monad,+ - because the git repo paths are stored relative.+ - Instead, use this.+ -}+changeDirectory :: FilePath -> Annex ()+changeDirectory d = do+	r <- liftIO . Git.adjustPath absPath =<< gitRepo+	liftIO $ setCurrentDirectory d+	r' <- liftIO $ Git.relPath r+	changeState $ \s -> s { repo = r' }
Annex/Branch.hs view
@@ -334,7 +334,7 @@ withIndex = withIndex' False withIndex' :: Bool -> Annex a -> Annex a withIndex' bootstrapping a = do-	f <- fromRepo gitAnnexIndex+	f <- liftIO . absPath =<< fromRepo gitAnnexIndex 	withIndexFile f $ do 		checkIndexOnce $ unlessM (liftIO $ doesFileExist f) $ do 			unless bootstrapping create
Annex/Content/Direct.hs view
@@ -114,7 +114,7 @@ normaliseAssociatedFile :: FilePath -> Annex FilePath normaliseAssociatedFile file = do 	top <- fromRepo Git.repoPath-	liftIO $ relPathDirToFile top <$> absPath file+	liftIO $ relPathDirToFile top file  {- Checks if a file in the tree, associated with a key, has not been modified.  -
Annex/Direct.hs view
@@ -160,8 +160,8 @@  -} mergeDirect :: Maybe Git.Ref -> Maybe Git.Ref -> Git.Branch -> Annex Bool -> Git.Branch.CommitMode -> Annex Bool mergeDirect startbranch oldref branch resolvemerge commitmode = exclusively $ do-	reali <- fromRepo indexFile-	tmpi <- fromRepo indexFileLock+	reali <- liftIO . absPath =<< fromRepo indexFile+	tmpi <- liftIO . absPath =<< fromRepo indexFileLock 	liftIO $ copyFile reali tmpi  	d <- fromRepo gitAnnexMergeDir@@ -198,9 +198,12 @@ 	merger <- ifM (coreSymlinks <$> Annex.getGitConfig) 		( return Git.Merge.stageMerge 		, return $ \ref -> Git.Merge.mergeNonInteractive ref commitmode-		) -	inRepo $ \g -> merger branch $ -		g { location = Local { gitdir = Git.localGitDir g, worktree = Just d } }+		)+	inRepo $ \g -> do+		wd <- liftIO $ absPath d+		gd <- liftIO $ absPath $ Git.localGitDir g+		merger branch $ +			g { location = Local { gitdir = gd, worktree = Just (addTrailingPathSeparator wd) } }  {- Commits after a direct mode merge is complete, and after the work  - tree has been updated by mergeDirectCleanup.@@ -305,10 +308,10 @@ 		liftIO $ findnewname absf 0 	checkdirs (DiffTree.file item)   where-	checkdirs from = do-		let p = parentDir (getTopFilePath from)-		let d = asTopFilePath p-		unless (null p) $ do+	checkdirs from = case upFrom (getTopFilePath from) of+		Nothing -> noop+		Just p -> do+			let d = asTopFilePath p 			let absd = makeabs d 			whenM (liftIO (colliding_nondir absd) <&&> unannexed absd) $ 				liftIO $ findnewname absd 0
Annex/View.hs view
@@ -340,8 +340,9 @@ 	genViewBranch view $ do 		uh <- inRepo Git.UpdateIndex.startUpdateIndex 		hasher <- inRepo hashObjectStart-		forM_ l $ \f ->-			go uh hasher f =<< Backend.lookupFile f+		forM_ l $ \f -> do+			relf <- getTopFilePath <$> inRepo (toTopFilePath f)+			go uh hasher relf =<< Backend.lookupFile f 		liftIO $ do 			hashObjectStop hasher 			void $ stopUpdateIndex uh@@ -352,7 +353,8 @@ 		metadata <- getCurrentMetaData k 		let metadata' = getfilemetadata f `unionMetaData` metadata 		forM_ (genviewedfiles f metadata') $ \fv -> do-			stagesymlink uh hasher fv =<< inRepo (gitAnnexLink fv k)+			f' <- fromRepo $ fromTopFilePath $ asTopFilePath fv+			stagesymlink uh hasher f' =<< inRepo (gitAnnexLink f' k) 	go uh hasher f Nothing 		| "." `isPrefixOf` f = do 			s <- liftIO $ getSymbolicLinkStatus f
Assistant/XMPP/Git.hs view
@@ -38,6 +38,7 @@ import Network.Protocol.XMPP import qualified Data.Text as T import System.Posix.Types+import qualified System.Posix.IO import Control.Concurrent import System.Timeout import qualified Data.ByteString as B@@ -104,9 +105,9 @@ 	u <- liftAnnex getUUID 	sendNetMessage $ Pushing cid (StartingPush u) -	(Fd inf, writepush) <- liftIO createPipe-	(readpush, Fd outf) <- liftIO createPipe-	(Fd controlf, writecontrol) <- liftIO createPipe+	(Fd inf, writepush) <- liftIO System.Posix.IO.createPipe+	(readpush, Fd outf) <- liftIO System.Posix.IO.createPipe+	(Fd controlf, writecontrol) <- liftIO System.Posix.IO.createPipe  	tmpdir <- gettmpdir 	installwrapper tmpdir
Backend/Hash.hs view
@@ -1,4 +1,4 @@-{- git-annex hashing backends+{- git-tnnex hashing backends  -  - Copyright 2011-2013 Joey Hess <joey@kitenet.net>  -@@ -132,13 +132,20 @@ needsUpgrade key = "\\" `isPrefixOf` keyHash key || 	any (not . validExtension) (takeExtensions $ keyName key) -{- Fast migration from hashE to hash backend. (Optimisation) -}-trivialMigrate :: Key -> Backend -> Maybe Key-trivialMigrate oldkey newbackend+trivialMigrate :: Key -> Backend -> AssociatedFile -> Maybe Key+trivialMigrate oldkey newbackend afile+	{- Fast migration from hashE to hash backend. -} 	| keyBackendName oldkey == name newbackend ++ "E" = Just $ oldkey 		{ keyName = keyHash oldkey 		, keyBackendName = name newbackend 		}+	{- Fast migration from hash to hashE backend. -}+	| keyBackendName oldkey ++"E" == name newbackend = case afile of+		Nothing -> Nothing+		Just file -> Just $ oldkey+			{ keyName = keyHash oldkey ++ selectExtension file+			, keyBackendName = name newbackend+			} 	| otherwise = Nothing  hashFile :: Hash -> FilePath -> Integer -> Annex String
Backend/URL.hs view
@@ -32,10 +32,8 @@  {- Every unique url has a corresponding key. -} fromUrl :: String -> Maybe Integer -> Annex Key-fromUrl url size = do-	n <- genKeyName url-	return $ stubKey-		{ keyName = n-		, keyBackendName = "URL"-		, keySize = size-		}+fromUrl url size = return $ stubKey+	{ keyName = genKeyName url+	, keyBackendName = "URL"+	, keySize = size+	}
Backend/Utilities.hs view
@@ -13,13 +13,18 @@  {- Generates a keyName from an input string. Takes care of sanitizing it.  - If it's not too long, the full string is used as the keyName.- - Otherwise, it's truncated at half the filename length limit, and its- - md5 is prepended to ensure a unique key. -}-genKeyName :: String -> Annex String-genKeyName s = do-	limit <- liftIO . fileNameLengthLimit =<< fromRepo gitAnnexDir-	let s' = preSanitizeKeyName s-	let truncs = truncateFilePath (limit `div` 2) s'-	return $ if s' == truncs-		then s'-		else truncs ++ "-" ++ md5s (Str s)+ - Otherwise, it's truncated, and its md5 is prepended to ensure a unique+ - key. -}+genKeyName :: String -> String+genKeyName s+	-- Avoid making keys longer than the length of a SHA256 checksum.+	| bytelen > sha256len =+		truncateFilePath (sha256len - md5len - 1) s' ++ "-" ++ md5s (Str s)+	| otherwise = s'+  where+	s' = preSanitizeKeyName s+	bytelen = length (decodeW8 s')++	sha256len = 64+	md5len = 32+
Backend/WORM.hs view
@@ -34,9 +34,8 @@ keyValue source = do 	stat <- liftIO $ getFileStatus $ contentLocation source 	relf <- getTopFilePath <$> inRepo (toTopFilePath $ keyFilename source)-	n <- genKeyName relf 	return $ Just $ stubKey-		{ keyName = n+		{ keyName = genKeyName relf 		, keyBackendName = name backend 		, keySize = Just $ fromIntegral $ fileSize stat 		, keyMtime = Just $ modificationTime stat
Build/DistributionUpdate.hs view
@@ -32,7 +32,7 @@ autobuilds :: [(URLString, FilePath)] autobuilds =  	(map linuxarch ["i386", "amd64", "armel"]) ++-	(map androidversion ["4.0", "4.3"]) +++	(map androidversion ["4.0", "4.3", "5.0"]) ++ 	[ (autobuild "x86_64-apple-yosemite/git-annex.dmg", "git-annex/OSX/current/10.10_Yosemite/git-annex.dmg") 	, (autobuild "windows/git-annex-installer.exe", "git-annex/windows/current/git-annex-installer.exe") 	]
CHANGELOG view
@@ -1,3 +1,31 @@+git-annex (5.20150113) unstable; urgency=medium++  * unlock: Don't allow unlocking files that have never been committed to git+    before, to avoid an intractable problem that prevents the pre-commit+    hook from telling if such a file is intended to be an annexed file or not.+  * Avoid re-checksumming when migrating from hash to hashE backend.+    Closes: #774494+  * Fix build with process 1.2.1.0.+  * Android: Provide a version built with -fPIE -pie to support Android 5.0.+  * sync: Fix an edge case where syncing in a bare repository would try to+    merge and so fail.+  * Check git version at runtime, rather than assuming it will be the same+    as the git version used at build time when running git-checkattr and+    git-branch remove.+  * Switch to using relative paths to the git repository.+    - This allows the git repository to be moved while git-annex is running in+      it, with fewer problems.+    - On Windows, this avoids some of the problems with the absurdly small+      MAX_PATH of 260 bytes. In particular, git-annex repositories should+      work in deeper/longer directory structures than before.+  * Generate shorter keys for WORM and URL, avoiding keys that are longer+    than used for SHA256, so as to not break on systems like Windows that+    have very small maximum path length limits.+  * Bugfix: A file named HEAD in the work tree could confuse some git commands+    run by git-annex.++ -- Joey Hess <id@joeyh.name>  Tue, 13 Jan 2015 12:10:08 -0400+ git-annex (5.20141231) unstable; urgency=medium    * vicfg: Avoid crashing on badly encoded config data.
Command/Migrate.hs view
@@ -72,7 +72,7 @@ 	checkcontent = Command.Fsck.checkBackend oldbackend oldkey $ Just file 	finish newkey = stopUnless (Command.ReKey.linkKey oldkey newkey) $ 		next $ Command.ReKey.cleanup file oldkey newkey-	genkey = case maybe Nothing (\fm -> fm oldkey newbackend) (fastMigrate oldbackend) of+	genkey = case maybe Nothing (\fm -> fm oldkey newbackend (Just file)) (fastMigrate oldbackend) of 		Just newkey -> return $ Just (newkey, True) 		Nothing -> do 			content <- calcRepo $ gitAnnexLocation oldkey
Command/Status.hs view
@@ -28,9 +28,9 @@ start [] = do 	-- Like git status, when run without a directory, behave as if 	-- given the path to the top of the repository.-	currdir <- liftIO getCurrentDirectory 	top <- fromRepo Git.repoPath-	start' [relPathDirToFile currdir top]+	d <- liftIO $ relPathCwdToFile top+	start' [d] start locs = start' locs 	 start' :: [FilePath] -> CommandStart
Command/Sync.hs view
@@ -29,6 +29,7 @@ import qualified Git.Command import qualified Git.LsFiles as LsFiles import qualified Git.Branch+import qualified Git.Types as Git import qualified Git.Ref import qualified Git import qualified Remote.Git@@ -107,7 +108,7 @@  - of the repo. This also means that sync always acts on all files in the  - repository, not just on a subdirectory. -} prepMerge :: Annex ()-prepMerge = liftIO . setCurrentDirectory =<< fromRepo Git.repoPath+prepMerge = Annex.changeDirectory =<< fromRepo Git.repoPath  syncBranch :: Git.Ref -> Git.Ref syncBranch = Git.Ref.under "refs/heads/synced" . fromDirectBranch@@ -227,12 +228,15 @@  - while the synced/master may have changes that some  - other remote synced to this remote. So, merge them both. -} mergeRemote :: Remote -> Maybe Git.Ref -> CommandCleanup-mergeRemote remote b = case b of-	Nothing -> do-		branch <- inRepo Git.Branch.currentUnsafe-		and <$> mapM (merge Nothing) (branchlist branch)-	Just thisbranch ->-		and <$> (mapM (merge (Just thisbranch)) =<< tomerge (branchlist b))+mergeRemote remote b = ifM isBareRepo+	( return True+	, case b of+		Nothing -> do+			branch <- inRepo Git.Branch.currentUnsafe+			and <$> mapM (merge Nothing) (branchlist branch)+		Just thisbranch ->+			and <$> (mapM (merge (Just thisbranch)) =<< tomerge (branchlist b))+	)   where 	merge thisbranch br = autoMergeFrom (remoteBranch remote br) thisbranch Git.Branch.ManualCommit 	tomerge = filterM (changed remote)
Command/Unlock.hs view
@@ -10,6 +10,7 @@ import Common.Annex import Command import Annex.Content+import Annex.CatFile import Utility.CopyFile  cmd :: [Command]@@ -29,10 +30,10 @@ start file key = do 	showStart "unlock" file 	ifM (inAnnex key)-		( ifM (checkDiskSpace Nothing key 0)+		( ifM (isJust <$> catKeyFileHEAD file) 			( next $ perform file key 			, do-				warning "not enough disk space to copy file"+				warning "this has not yet been committed to git; cannot unlock it" 				next $ next $ return False 			) 		, do@@ -41,19 +42,24 @@ 		)  perform :: FilePath -> Key -> CommandPerform-perform dest key = do-	src <- calcRepo $ gitAnnexLocation key-	tmpdest <- fromRepo $ gitAnnexTmpObjectLocation key-	liftIO $ createDirectoryIfMissing True (parentDir tmpdest)-	showAction "copying"-	ifM (liftIO $ copyFileExternal CopyAllMetaData src tmpdest)-		( do-			liftIO $ do-				removeFile dest-				moveFile tmpdest dest-			thawContent dest-			next $ return True-		, do-			warning "copy failed!"-			next $ return False-		)+perform dest key = ifM (checkDiskSpace Nothing key 0)+	( do+		src <- calcRepo $ gitAnnexLocation key+		tmpdest <- fromRepo $ gitAnnexTmpObjectLocation key+		liftIO $ createDirectoryIfMissing True (parentDir tmpdest)+		showAction "copying"+		ifM (liftIO $ copyFileExternal CopyAllMetaData src tmpdest)+			( do+				liftIO $ do+					removeFile dest+					moveFile tmpdest dest+				thawContent dest+				next $ return True+			, do+				warning "copy failed!"+				next $ return False+			)+	, do+		warning "not enough disk space to copy file"+		next $ return False+	)
Command/View.hs view
@@ -53,10 +53,8 @@  checkoutViewBranch :: View -> (View -> Annex Git.Branch) -> CommandCleanup checkoutViewBranch view mkbranch = do-	oldcwd <- liftIO getCurrentDirectory+	here <- liftIO getCurrentDirectory -	{- Change to top of repository before creating view branch. -}-	liftIO . setCurrentDirectory =<< fromRepo Git.repoPath 	branch <- mkbranch view 	 	showOutput@@ -68,9 +66,9 @@ 		setView view 		{- A git repo can easily have empty directories in it, 		 - and this pollutes the view, so remove them. -}-		liftIO $ removeemptydirs "."-		unlessM (liftIO $ doesDirectoryExist oldcwd) $ do-			top <- fromRepo Git.repoPath+		top <- fromRepo Git.repoPath+		liftIO $ removeemptydirs top+		unlessM (liftIO $ doesDirectoryExist here) $ do 			showLongNote (cwdmissing top) 	return ok   where
Common.hs view
@@ -16,7 +16,7 @@ import System.Directory as X import System.IO as X hiding (FilePath) #ifndef mingw32_HOST_OS-import System.Posix.IO as X+import System.Posix.IO as X hiding (createPipe) #endif import System.Exit as X 
Git.hs view
@@ -30,6 +30,8 @@ 	attributes, 	hookPath, 	assertLocal,+	adjustPath,+	relPath, ) where  import Network.URI (uriPath, uriScheme, unEscapeString)@@ -139,3 +141,29 @@ #else 	isexecutable f = isExecutable . fileMode <$> getFileStatus f #endif++{- Makes the path to a local Repo be relative to the cwd. -}+relPath :: Repo -> IO Repo+relPath = adjustPath torel+  where+	torel p = do+		p' <- relPathCwdToFile p+		if null p'+			then return "."+			else return p'++{- Adusts the path to a local Repo using the provided function. -}+adjustPath :: (FilePath -> IO FilePath) -> Repo -> IO Repo+adjustPath f r@(Repo { location = l@(Local { gitdir = d, worktree = w }) }) = do+	d' <- f d+	w' <- maybe (pure Nothing) (Just <$$> f) w+	return $ r +		{ location = l +			{ gitdir = d'+			, worktree = w'+			}+		}+adjustPath f r@(Repo { location = LocalUnknown d }) = do+	d' <- f d+	return $ r { location = LocalUnknown d' }+adjustPath _ r = pure r
Git/CheckAttr.hs view
@@ -10,12 +10,12 @@ import Common import Git import Git.Command-import qualified Git.BuildVersion+import qualified Git.Version import qualified Utility.CoProcess as CoProcess  import System.IO.Error -type CheckAttrHandle = (CoProcess.CoProcessHandle, [Attr], String)+type CheckAttrHandle = (CoProcess.CoProcessHandle, [Attr], Bool, String)  type Attr = String @@ -25,7 +25,8 @@ checkAttrStart attrs repo = do 	currdir <- getCurrentDirectory 	h <- CoProcess.rawMode =<< gitCoProcessStart True params repo-	return (h, attrs, currdir)+	oldgit <- Git.Version.older "1.7.7"+	return (h, attrs, oldgit, currdir)   where 	params = 		[ Param "check-attr" @@ -34,11 +35,11 @@ 		[ Param "--" ]  checkAttrStop :: CheckAttrHandle -> IO ()-checkAttrStop (h, _, _) = CoProcess.stop h+checkAttrStop (h, _, _, _) = CoProcess.stop h  {- Gets an attribute of a file. -} checkAttr :: CheckAttrHandle -> Attr -> FilePath -> IO String-checkAttr (h, attrs, currdir) want file = do+checkAttr (h, attrs, oldgit, currdir) want file = do 	pairs <- CoProcess.query h send (receive "") 	let vals = map snd $ filter (\(attr, _) -> attr == want) pairs 	case vals of@@ -81,10 +82,9 @@ 	 - With newer git, git check-attr chokes on some absolute 	 - filenames, and the bugs that necessitated them were fixed, 	 - so use relative filenames. -}-	oldgit = Git.BuildVersion.older "1.7.7" 	file' 		| oldgit = absPathFrom currdir file-		| otherwise = relPathDirToFile currdir $ absPathFrom currdir file+		| otherwise = relPathDirToFileAbs currdir $ absPathFrom currdir file 	oldattrvalue attr l = end bits !! 0 	  where 		bits = split sep l
Git/Command.hs view
@@ -16,7 +16,7 @@  {- Constructs a git command line operating on the specified repo. -} gitCommandLine :: [CommandParam] -> Repo -> [CommandParam]-gitCommandLine params r@(Repo { location = l@(Local _ _ ) }) =+gitCommandLine params r@(Repo { location = l@(Local { } ) }) = 	setdir : settree ++ gitGlobalOpts r ++ params   where 	setdir = Param $ "--git-dir=" ++ gitdir l
Git/Construct.hs view
@@ -45,9 +45,9 @@ 	seekUp dir = do 		r <- checkForRepo dir 		case r of-			Nothing -> case parentDir dir of-				"" -> return Nothing-				d -> seekUp d+			Nothing -> case upFrom dir of+				Nothing -> return Nothing+				Just d -> seekUp d 			Just loc -> Just <$> newFrom loc  {- Local Repo constructor, accepts a relative or absolute path. -}@@ -153,7 +153,7 @@ fromRemotePath :: FilePath -> Repo -> IO Repo fromRemotePath dir repo = do 	dir' <- expandTilde dir-	fromAbsPath $ repoPath repo </> dir'+	fromPath $ repoPath repo </> dir'  {- Git remotes can have a directory that is specified relative  - to the user's home directory, or that contains tilde expansions.
Git/DiffTree.hs view
@@ -61,7 +61,7 @@ diffIndex' ref params repo = 	ifM (Git.Ref.headExists repo) 		( getdiff (Param "diff-index")-			( params ++ [Param $ fromRef ref] )+			( params ++ [Param $ fromRef ref] ++ [Param "--"] ) 			repo 		, return ([], return True) 		)
Git/FilePath.hs view
@@ -39,8 +39,7 @@  {- The input FilePath can be absolute, or relative to the CWD. -} toTopFilePath :: FilePath -> Git.Repo -> IO TopFilePath-toTopFilePath file repo = TopFilePath <$>-	relPathDirToFile (repoPath repo) <$> absPath file+toTopFilePath file repo = TopFilePath <$> relPathDirToFile (repoPath repo) file  {- The input FilePath must already be relative to the top of the git  - repository -}
Git/HashObject.hs view
@@ -32,7 +32,7 @@ hashFile :: HashObjectHandle -> FilePath -> IO Sha hashFile h file = CoProcess.query h send receive   where-	send to = hPutStrLn to file+	send to = hPutStrLn to =<< absPath file 	receive from = getSha "hash-object" $ hGetLine from  {- Injects a blob into git. Unfortunately, the current git-hash-object
Git/LsFiles.hs view
@@ -131,9 +131,9 @@ 	(fs, cleanup) <- pipeNullSplit (prefix ++ ps ++ suffix) repo 	-- git diff returns filenames relative to the top of the git repo; 	-- convert to filenames relative to the cwd, like git ls-files.-	let top = repoPath repo+	top <- absPath (repoPath repo) 	currdir <- getCurrentDirectory-	return (map (\f -> relPathDirToFile currdir $ top </> f) fs, cleanup)+	return (map (\f -> relPathDirToFileAbs currdir $ top </> f) fs, cleanup)   where 	prefix = [Params "diff --name-only --diff-filter=T -z"] 	suffix = Param "--" : (if null l then [File "."] else map File l)
Git/Remote/Remove.hs view
@@ -13,15 +13,17 @@ import Git import Git.Types import qualified Git.Command-import qualified Git.BuildVersion+import qualified Git.Version  remove :: RemoteName -> Repo -> IO ()-remove remotename = Git.Command.run-	[ Param "remote"-	-- name of this subcommand changed-	, Param $-		if Git.BuildVersion.older "1.8.0"-			then "rm"-			else "remove"-	, Param remotename-	]+remove remotename r = do+	old <- Git.Version.older "1.8.0"+	Git.Command.run+		[ Param "remote"+		-- name of this subcommand changed+		, Param $+			if old+				then "rm"+				else "remove"+		, Param remotename+		] r
Git/Repair.hs view
@@ -225,10 +225,13 @@  - Relies on packed refs being exploded before it's called.  -} getAllRefs :: Repo -> IO [Ref]-getAllRefs r = map toref <$> dirContentsRecursive refdir-  where-	refdir = localGitDir r </> "refs"-	toref = Ref . relPathDirToFile (localGitDir r)+getAllRefs r = getAllRefs' (localGitDir r </> "refs")++getAllRefs' :: FilePath -> IO [Ref]+getAllRefs' refdir = do+	let topsegs = length (splitPath refdir) - 1+	let toref = Ref . joinPath . drop topsegs . splitPath+	map toref <$> dirContentsRecursive refdir  explodePackedRefsFile :: Repo -> IO () explodePackedRefsFile r = do
Git/Version.hs view
@@ -7,6 +7,7 @@  module Git.Version ( 	installed,+	older, 	normalize, 	GitVersion, ) where@@ -22,3 +23,8 @@ 	extract s = case lines s of 		[] -> "" 		(l:_) -> unwords $ drop 2 $ words l++older :: String -> IO Bool+older n = do+	v <- installed+	return $ v < normalize n 
Locations.hs view
@@ -87,8 +87,8 @@  - Everything else should not end in a trailing path sepatator.   -  - Only functions (with names starting with "git") that build a path- - based on a git repository should return an absolute path.- - Everything else should use relative paths.+ - based on a git repository should return full path relative to the git+ - repository. Everything else returns path segments.  -}  {- The directory git annex uses for local state, relative to the .git@@ -108,7 +108,7 @@ annexLocation :: Key -> Hasher -> FilePath annexLocation key hasher = objectDir </> keyPath key hasher -{- Annexed object's absolute location in a repository.+{- Annexed object's location in a repository.  -  - When there are multiple possible locations, returns the one where the  - file is actually present.@@ -146,7 +146,7 @@ 	currdir <- getCurrentDirectory 	let absfile = fromMaybe whoops $ absNormPathUnix currdir file 	loc <- gitAnnexLocation' key r False-	return $ relPathDirToFile (parentDir absfile) loc+	relPathDirToFile (parentDir absfile) loc   where 	whoops = error $ "unable to normalize " ++ file 
Makefile view
@@ -221,8 +221,8 @@ 	sed -i 's/Extensions: /Extensions: MagicHash /i' tmp/androidtree/git-annex.cabal # Cabal cannot cross compile with custom build type, so workaround. 	sed -i 's/Build-type: Custom/Build-type: Simple/' tmp/androidtree/git-annex.cabal-# Build just once, but link twice, for 2 different versions of Android.-	mkdir -p tmp/androidtree/dist/build/git-annex/4.0 tmp/androidtree/dist/build/git-annex/4.3+# Build just once, but link repeatedly, for different versions of Android.+	mkdir -p tmp/androidtree/dist/build/git-annex/4.0 tmp/androidtree/dist/build/git-annex/4.3 tmp/androidtree/dist/build/git-annex/5.0 	if [ ! -e tmp/androidtree/dist/setup-config ]; then \ 		cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal configure -fAndroid $(ANDROID_FLAGS); \ 	fi@@ -231,6 +231,9 @@ 	cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \ 		--ghc-options=-optl-z --ghc-options=-optlnocopyreloc \ 		&& mv dist/build/git-annex/git-annex dist/build/git-annex/4.3/git-annex+	cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \+		--ghc-options=-optl-z --ghc-options=-optlnocopyreloc --ghc-options=-optl-fPIE --ghc-options=-optl-pie --ghc-options=-optc-fPIE --ghc-options=-optc-pie \+		&& mv dist/build/git-annex/git-annex dist/build/git-annex/5.0/git-annex  androidapp: 	$(MAKE) android
Messages.hs view
@@ -111,7 +111,7 @@ 	p = handle q $ putStrLn $ "(" ++ m ++ "...)" 			 showStoringStateAction :: Annex ()-showStoringStateAction = showSideAction "Recording state in git"+showStoringStateAction = showSideAction "recording state in git"  {- Performs an action, supressing showSideAction messages. -} doQuietSideAction :: Annex a -> Annex a
Test.hs view
@@ -79,9 +79,11 @@ import qualified Types.Crypto import qualified Utility.Gpg #endif+import qualified Messages  main :: [String] -> IO () main ps = do+	Messages.enableDebugOutput 	let tests = testGroup "Tests" 		-- Test both direct and indirect mode. 		-- Windows is only going to use direct mode,@@ -139,7 +141,7 @@ 	, testProperty "prop_logs_sane" Logs.prop_logs_sane 	, testProperty "prop_idempotent_configEscape" Logs.Remote.prop_idempotent_configEscape 	, testProperty "prop_parse_show_Config" Logs.Remote.prop_parse_show_Config-	, testProperty "prop_parentDir_basics" Utility.Path.prop_parentDir_basics+	, testProperty "prop_upFrom_basics" Utility.Path.prop_upFrom_basics 	, testProperty "prop_relPathDirToFile_basics" Utility.Path.prop_relPathDirToFile_basics 	, testProperty "prop_relPathDirToFile_regressionTest" Utility.Path.prop_relPathDirToFile_regressionTest 	, testProperty "prop_cost_sane" Config.Cost.prop_cost_sane@@ -449,6 +451,12 @@ 	annexed_notpresent annexedfile 	not <$> git_annex "unlock" [annexedfile] @? "unlock failed to fail with not present file" 	annexed_notpresent annexedfile++	-- regression test: unlock of newly added, not committed file+	-- should fail+	writeFile "newfile" "foo"+	git_annex "add" ["newfile"] @? "add new file failed"+	not <$> git_annex "unlock" ["newfile"] @? "unlock failed to fail on newly added, never committed file"  	git_annex "get" [annexedfile] @? "get of file failed" 	annexed_present annexedfile
Types/Backend.hs view
@@ -21,7 +21,7 @@ 	, canUpgradeKey :: Maybe (Key -> Bool) 	-- Checks if there is a fast way to migrate a key to a different 	-- backend (ie, without re-hashing).-	, fastMigrate :: Maybe (Key -> BackendA a -> Maybe Key)+	, fastMigrate :: Maybe (Key -> BackendA a -> AssociatedFile -> Maybe Key) 	-- Checks if a key is known (or assumed) to always refer to the 	-- same data. 	, isStableKey :: Key -> Bool
Utility/Gpg.hs view
@@ -19,6 +19,7 @@  #ifndef mingw32_HOST_OS import System.Posix.Types+import qualified System.Posix.IO import System.Path import Utility.Env #else@@ -108,7 +109,7 @@ feedRead params passphrase feeder reader = do #ifndef mingw32_HOST_OS 	-- pipe the passphrase into gpg on a fd-	(frompipe, topipe) <- liftIO createPipe+	(frompipe, topipe) <- liftIO System.Posix.IO.createPipe 	liftIO $ void $ forkIO $ do 		toh <- fdToHandle topipe 		hPutStrLn toh passphrase
Utility/LinuxMkLibs.hs view
@@ -10,6 +10,7 @@ import Control.Applicative import Data.Maybe import System.Directory+import System.FilePath import Data.List.Utils import System.Posix.Files import Data.Char@@ -35,7 +36,7 @@ 	checksymlink f = whenM (isSymbolicLink <$> getSymbolicLinkStatus (inTop top f)) $ do 		l <- readSymbolicLink (inTop top f) 		let absl = absPathFrom (parentDir f) l-		let target = relPathDirToFile (parentDir f) absl+		target <- relPathDirToFile (takeDirectory f) absl 		installfile top absl 		nukeFile (top ++ f) 		createSymbolicLink target (inTop top f)
Utility/Path.hs view
@@ -77,27 +77,29 @@ 	todos = replace "/" "\\" #endif -{- Returns the parent directory of a path.- -- - To allow this to be easily used in loops, which terminate upon reaching the- - top, the parent of / is "" -}+{- takeDirectory "foo/bar/" is "foo/bar". This instead yields "foo" -} parentDir :: FilePath -> FilePath-parentDir dir-	| null dirs = ""-	| otherwise = joinDrive drive (join s $ init dirs)+parentDir = takeDirectory . dropTrailingPathSeparator++{- Just the parent directory of a path, or Nothing if the path has no+- parent (ie for "/" or ".") -}+upFrom :: FilePath -> Maybe FilePath+upFrom dir+	| null dirs = Nothing+	| otherwise = Just $ joinDrive drive (join s $ init dirs)   where 	-- on Unix, the drive will be "/" when the dir is absolute, otherwise "" 	(drive, path) = splitDrive dir 	dirs = filter (not . null) $ split s path 	s = [pathSeparator] -prop_parentDir_basics :: FilePath -> Bool-prop_parentDir_basics dir+prop_upFrom_basics :: FilePath -> Bool+prop_upFrom_basics dir 	| null dir = True-	| dir == "/" = parentDir dir == ""-	| otherwise = p /= dir+	| dir == "/" = p == Nothing+	| otherwise = p /= Just dir   where-	p = parentDir dir+	p = upFrom dir  {- Checks if the first FilePath is, or could be said to contain the second.  - For example, "foo/" contains "foo/bar". Also, "foo", "./foo", "foo/" etc@@ -126,14 +128,19 @@  -    relPathCwdToFile "/tmp/foo/bar" == ""   -} relPathCwdToFile :: FilePath -> IO FilePath-relPathCwdToFile f = relPathDirToFile <$> getCurrentDirectory <*> absPath f+relPathCwdToFile f = do+	c <- getCurrentDirectory+	relPathDirToFile c f -{- Constructs a relative path from a directory to a file.- -- - Both must be absolute, and cannot contain .. etc. (eg use absPath first).+{- Constructs a relative path from a directory to a file. -}+relPathDirToFile :: FilePath -> FilePath -> IO FilePath+relPathDirToFile from to = relPathDirToFileAbs <$> absPath from <*> absPath to++{- This requires the first path to be absolute, and the+ - second path cannot contain ../ or ./  -}-relPathDirToFile :: FilePath -> FilePath -> FilePath-relPathDirToFile from to = join s $ dotdots ++ uncommon+relPathDirToFileAbs :: FilePath -> FilePath -> FilePath+relPathDirToFileAbs from to = join s $ dotdots ++ uncommon   where 	s = [pathSeparator] 	pfrom = split s from@@ -149,7 +156,7 @@ 	| from == to = null r 	| otherwise = not (null r)   where-	r = relPathDirToFile from to +	r = relPathDirToFileAbs from to   prop_relPathDirToFile_regressionTest :: Bool prop_relPathDirToFile_regressionTest = same_dir_shortcurcuits_at_difference@@ -158,7 +165,7 @@ 	 - location, but it's not really the same directory. 	 - Code used to get this wrong. -} 	same_dir_shortcurcuits_at_difference =-		relPathDirToFile (joinPath [pathSeparator : "tmp", "r", "lll", "xxx", "yyy", "18"])+		relPathDirToFileAbs (joinPath [pathSeparator : "tmp", "r", "lll", "xxx", "yyy", "18"]) 			(joinPath [pathSeparator : "tmp", "r", ".git", "annex", "objects", "18", "gk", "SHA256-foo", "SHA256-foo"]) 				== joinPath ["..", "..", "..", "..", ".git", "annex", "objects", "18", "gk", "SHA256-foo", "SHA256-foo"] @@ -187,7 +194,7 @@ relHome path = do 	home <- myHomeDir 	return $ if dirContains home path-		then "~/" ++ relPathDirToFile home path+		then "~/" ++ relPathDirToFileAbs home path 		else path  {- Checks if a command is available in PATH.
Utility/Process.hs view
@@ -1,7 +1,7 @@ {- System.Process enhancements, including additional ways of running  - processes, and logging.  -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name>  -  - License: BSD-2-clause  -}@@ -38,7 +38,7 @@ ) where  import qualified System.Process-import System.Process as X hiding (CreateProcess(..), createProcess, runInteractiveProcess, readProcess, readProcessWithExitCode, system, rawSystem, runInteractiveCommand, runProcess)+import qualified System.Process as X hiding (CreateProcess(..), createProcess, runInteractiveProcess, readProcess, readProcessWithExitCode, system, rawSystem, runInteractiveCommand, runProcess) import System.Process hiding (createProcess, readProcess) import System.Exit import System.IO@@ -47,7 +47,7 @@ import qualified Control.Exception as E import Control.Monad #ifndef mingw32_HOST_OS-import System.Posix.IO+import qualified System.Posix.IO #else import Control.Applicative #endif@@ -175,9 +175,9 @@ #ifndef mingw32_HOST_OS {- This implementation interleves stdout and stderr in exactly the order  - the process writes them. -}-	(readf, writef) <- createPipe-	readh <- fdToHandle readf-	writeh <- fdToHandle writef+	(readf, writef) <- System.Posix.IO.createPipe+	readh <- System.Posix.IO.fdToHandle readf+	writeh <- System.Posix.IO.fdToHandle writef 	p@(_, _, _, pid) <- createProcess $ 		(proc cmd opts) 			{ std_in = if isJust input then CreatePipe else Inherit
debian/changelog view
@@ -1,3 +1,31 @@+git-annex (5.20150113) unstable; urgency=medium++  * unlock: Don't allow unlocking files that have never been committed to git+    before, to avoid an intractable problem that prevents the pre-commit+    hook from telling if such a file is intended to be an annexed file or not.+  * Avoid re-checksumming when migrating from hash to hashE backend.+    Closes: #774494+  * Fix build with process 1.2.1.0.+  * Android: Provide a version built with -fPIE -pie to support Android 5.0.+  * sync: Fix an edge case where syncing in a bare repository would try to+    merge and so fail.+  * Check git version at runtime, rather than assuming it will be the same+    as the git version used at build time when running git-checkattr and+    git-branch remove.+  * Switch to using relative paths to the git repository.+    - This allows the git repository to be moved while git-annex is running in+      it, with fewer problems.+    - On Windows, this avoids some of the problems with the absurdly small+      MAX_PATH of 260 bytes. In particular, git-annex repositories should+      work in deeper/longer directory structures than before.+  * Generate shorter keys for WORM and URL, avoiding keys that are longer+    than used for SHA256, so as to not break on systems like Windows that+    have very small maximum path length limits.+  * Bugfix: A file named HEAD in the work tree could confuse some git commands+    run by git-annex.++ -- Joey Hess <id@joeyh.name>  Tue, 13 Jan 2015 12:10:08 -0400+ git-annex (5.20141231) unstable; urgency=medium    * vicfg: Avoid crashing on badly encoded config data.
doc/backends.mdwn view
@@ -25,6 +25,10 @@   -- [Skein hash](http://en.wikipedia.org/wiki/Skein_hash),   a well-regarded SHA3 hash competition finalist. +Note that the SHA512, SKEIN512 and SHA384 generate long paths,+which are known to not work on Windows. If interoperability on Windows is a+concern, avoid those backends.+ The `annex.backends` git-config setting can be used to list the backends git-annex should use. The first one listed will be used by default when new files are added.
+ doc/backends/comment_10_920cd139dfec8adb1089f5acf26de4d2._comment view
@@ -0,0 +1,8 @@+[[!comment format=mdwn+ username="joey"+ subject="""comment 10"""+ date="2015-01-06T17:58:28Z"+ content="""+@Matthias, that directory structure is not controlled by the backend.+It is explained in [[internals]]+"""]]
+ doc/backends/comment_9_5bef7f76f5e5b73a8e404fe6172b4368._comment view
@@ -0,0 +1,12 @@+[[!comment format=mdwn+ username="https://www.google.com/accounts/o8/id?id=AItOawm_YXzEdPHzbSGVwtmTR7g1BqDtTnIBB5s"+ nickname="Matthias"+ subject="Over-long pathnames?"+ date="2015-01-06T09:41:03Z"+ content="""+the SHA* backends generate too-complicated paths:++lrwxrwxrwx 1 root root 193 Apr 22  2009 test.ogg -> ../../../.git/annex/objects/fX/pz/SHA256-s71983--4a55ff578b4c592c06a1f4d9e0f8a6949ea9961d9717fc22e7b3c412620ac890/SHA256-s71983--4a55ff578b4c592c06a1f4d9e0f8a6949ea9961d9717fc22e7b3c412620ac890++I don't want the additional directory. What is it for?? It contains exactly one file and adds a couple of disk seeks to file lookup.+"""]]
+ doc/bugs/CHECKPRESENT_could_check_file_size_as_well.mdwn view
@@ -0,0 +1,7 @@+The [external special remote protocol](http://git-annex.branchable.com/design/external_special_remote_protocol/) CHECKPRESENT command has no support for checking the file size.++In many cases a special remote is able to fetch the size of an object as it checks its availability with no additional cost (for example when you use the `stat()` function: the size is already included in the response). The remote protocol could be extended so that the backend returns the size with the CHECKPRESENT-SUCCESS command, so that git-annex can provide a primitive but probably useful additional integrity check. This is helpful, for example, to detect bugs that result in the truncation of a file in the special remote; or to detect the case of an aborted upload that resulted in the file being checked into the remote anyway.++When it is not easy to get the file size without incurring in additional costs, the backend can simply return a flag value like `-1` to tell git-annex to ignore it.++There is a delicate point in how git-annex computes the expected object size for an encrypted remote. I do not know if there is a way to compute the size of a file after it has been encrypted with HMAC/GPG without actually performing all the computation. In line of principle it should not be difficult, but I do not know the details.
+ doc/bugs/bencode.mdwn view
@@ -0,0 +1,28 @@+### Please describe the problem.++I have been packaging bencode as a dependency for git-annex on Debian.++I contacted the upstream authors in reference to getting some licensing issues fixed and they pointed me to a package called "AttoBencode" which+might be a more recent and maintained option for bencode parsing in Git Annex.++http://hackage.haskell.org/package/AttoBencode++This isn't actually a bug, I just thought this would be a good place to bring this up. ++For what it's worth, I like the idea that packages can become stable (or old) and still serve their purpose so if bencode works just fine I think that's great.++### What steps will reproduce the problem?+++### What version of git-annex are you using? On what operating system?+++### Please provide any additional information below.++[[!format sh """+# If you can, paste a complete transcript of the problem occurring here.+# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log+++# End of transcript or log.+"""]]
+ doc/bugs/bencode/comment_1_24bc8c996eb32f344b3f091e14171a15._comment view
@@ -0,0 +1,11 @@+[[!comment format=mdwn+ username="joey"+ subject="""comment 1"""+ date="2015-01-05T15:53:32Z"+ content="""+Rewriting the torrent library to use attobencode feels like yak shaving.+It's not like parsing torrents is a performance bottleneck in this+situation, that would need an attoparsec based parser for speed.++I don't see any licensing problems in bencode.+"""]]
doc/design/assistant/polls/prioritizing_special_remotes.mdwn view
@@ -6,7 +6,7 @@ Help me prioritize my work: What special remote would you most like to use with the git-annex assistant? -[[!poll open=yes 16 "Amazon S3 (done)" 12 "Amazon Glacier (done)" 10 "Box.com (done)" 73 "My phone (or MP3 player)" 25 "Tahoe-LAFS" 13 "OpenStack SWIFT" 34 "Google Drive"]]+[[!poll open=yes 16 "Amazon S3 (done)" 12 "Amazon Glacier (done)" 10 "Box.com (done)" 74 "My phone (or MP3 player)" 25 "Tahoe-LAFS" 13 "OpenStack SWIFT" 35 "Google Drive"]]  This poll is ordered with the options I consider easiest to build listed first. Mostly because git-annex already supports them and they
+ doc/devblog/day_243__android_5.mdwn view
@@ -0,0 +1,16 @@+I've finally been clued into why [git-annex isn't working on Android 5](http://git-annex.branchable.com/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/), and+it seems fixing it is as easy as pie.. That is, passing -pie -FPIE to the+linker. I've added a 5.0 build to the Android autobuilder. It is currently+untested, so I hope to get feedback from someone with an Android 5 device;+a [test build](http://downloads.kitenet.net/git-annex/autobuild/android/5.0/git-annex.apk) is now available.++I've been working through the backlog of messages today, and gotten down+from 170 to 128. Mostly answered a lot of interesting questions, +such as "[Where to start reading the source code?](http://git-annex.branchable.com/install/fromsource/#comment-cb68f2aa0a598d0150db852834ea07da)"++Also did some work to make git-annex check git versions at runtime more+often, instead of assuming the git version it was built against. +It turns out this could be done pretty inexpensively in 2 of 4 cases,+and one of the 2 fixed was the git check-attr behavior change, +which could lead to git-annex add hanging if used with an old version of+git.
+ doc/devblog/day_244__relative_paths.mdwn view
@@ -0,0 +1,14 @@+git-annex internally uses all absolute paths all the time.+For a couple of reasons, I'd like it to use relative paths.+The best reason is, it would let a repository be moved while git-annex was+running, without breaking. A lesser reason is that Windows has some+crazy small limit on the length of a path (260 bytes?!), and using relative+paths would avoid hitting it so often.++I tried to do this today, in a `relativepaths` branch. I eventually got the+test suite to pass, but I am very unsure about this change. A lot of random+assumptions broke, and the test suite won't catch them all. In a few+places, git-annex commands do change the current directory, and that+will break with relative paths.++A frustrating day.
+ doc/devblog/day_245__yak_shaving.mdwn view
@@ -0,0 +1,9 @@+Worked more on the `relativepaths` branch last night, and I am actually+fairly happy with it now, and plan to merge it after I've run it for a bit+longer myself.++It seems that I did manage to get a git-annex executable that is built PIE+so it will work on Android 5.0. But all the C programs like busybox+included in the Android app also have to be built that way. Arranging for+everything to get built twice and with the right options took up most of+today.
+ doc/forum/List_annexed_files_in_chronological_order__63__.mdwn view
@@ -0,0 +1,1 @@+How can I get git-annex to list the annexed files in the order they have been added?
+ doc/forum/OSX_Finder_extension.mdwn view
@@ -0,0 +1,5 @@+OSX 10.10 / Yosemite introduces the [Finder Sync extension][] which allows any app / extension to display informational badges in Finder. This could be used to indicate the sync status (there are some stories which claim the extensions got added because Dropbox used an undocumented API previously). I had a quick look and it would not be too difficult to implement a simple extension which reads the metadata from the `.git/annex` directory and shows a sync / transfer status icon.++Just wanted to throw the idea out there, I might even start building it.++[Finder Sync Extension]: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/Finder.html
+ doc/forum/Sync_files_from_remote_to_remote.mdwn view
@@ -0,0 +1,5 @@+Not sure if this use case is supported, but I have the following setup - I use git-annex to store my Lightroom catalog and photos. My local machine does not contain all files, `.mov` files for example are excluded via the preferred content mechanism. The full backup is on a remote server using ssh.++Now I want to create another copy of the data (encrypted) from my local machine to a USB stick or similar. I found that the locally excluded files are not synced. In order to copy all the data I first need to change the preferred content config, execute `git-annex get` to fetch the data, then copy via `git-annex sync myusbremote --content`, then change the local preferred content pattern, then run `git annex drop --auto` to delete the local unwanted content again.++I was wondering if there's a way to sync from one remote to another, without storing any data locallly ? Something like `git-annex sync --from ... --to ...`.
doc/install/Android.mdwn view
@@ -10,6 +10,7 @@ Then download the git-annex.apk for your version of Android, and  open it to install. +* [Android 5.0 git-annex.apk](http://downloads.kitenet.net/git-annex/android/current/5.0/git-annex.apk) * [Android 4.4 and 4.3 git-annex.apk](http://downloads.kitenet.net/git-annex/android/current/4.3/git-annex.apk) * [Android 4.0 to 4.2 git-annex.apk](http://downloads.kitenet.net/git-annex/android/current/4.0/git-annex.apk) @@ -18,6 +19,7 @@ A daily build is also available, thanks to Mesar Hameed and the University of Bath CS department. +* [Android 5.0 git-annex.apk](http://downloads.kitenet.net/git-annex/autobuild/android/5.0/git-annex.apk) * [Android 4.4 and 4.3 git-annex.apk](http://downloads.kitenet.net/git-annex/autobuild/android/4.3/git-annex.apk) * [Android 4.0 to 4.2 git-annex.apk](http://downloads.kitenet.net/git-annex/autobuild/android/4.0/git-annex.apk) * [build logs](http://downloads.kitenet.net/git-annex/autobuild/android/)
doc/install/NixOS.mdwn view
@@ -2,5 +2,9 @@      nix-env -i git-annex +When including it in a NixOS configuration.nix file, the name of the reference to the package is++    haskellPackages.gitAnnex+ The build status of the package within Nix can be seen on the [Hydra Build Farm](http://hydra.nixos.org/job/nixpkgs/trunk/gitAndTools.gitAnnex).
+ doc/install/fromsource/comment_48_9c08300c5d172ba9223042a00c8acb2b._comment view
@@ -0,0 +1,18 @@+[[!comment format=mdwn+ username="joey"+ subject="""where to start reading the source code"""+ date="2015-01-05T20:58:50Z"+ content="""+@thnetos, great question!++Annex.hs is a key starting place, as it defines git-annex's main monad.+If you like learning code bases bottom-up, Types/* has files for+the main data types used in git-annex, such as Key and UUID and Remote and+GitConfig.++Command/* gets you the implementation of any particular git-annex command+you are interested in. Or Remote/* for any particular special remote.++I recommend running "make tags" and then your editor should be able to use+the tags file to bounce around in the source code.+"""]]
+ doc/internals/lockdown/comment_2_7bf74adb5556b7fc74a94e751c5fd3d6._comment view
@@ -0,0 +1,13 @@+[[!comment format=mdwn+ username="https://www.google.com/accounts/o8/id?id=AItOawm_YXzEdPHzbSGVwtmTR7g1BqDtTnIBB5s"+ nickname="Matthias"+ subject="File immutability"+ date="2015-01-07T12:06:15Z"+ content="""+# setcap cap_linux_immutable+ep /usr/bin/git-annex++After doing that, git-annex is able to make files immutable, so the additional directory is not needed any more.+Even on file systems / in environments where that is not possible, in some situations file lookup speed is way more important than not being able to delete the target of a symlink.++I have no idea how to code in Haskell, so if somebody else could add an appropriate always/never/only-when-necessary config option I'd be very happy, and my media server would not have any more hiccups when switching songs …+"""]]
+ doc/news/version_5.20150113.mdwn view
@@ -0,0 +1,25 @@+git-annex 5.20150113 released with [[!toggle text="these changes"]]+[[!toggleable text="""+   * unlock: Don't allow unlocking files that have never been committed to git+     before, to avoid an intractable problem that prevents the pre-commit+     hook from telling if such a file is intended to be an annexed file or not.+   * Avoid re-checksumming when migrating from hash to hashE backend.+     Closes: #[774494](http://bugs.debian.org/774494)+   * Fix build with process 1.2.1.0.+   * Android: Provide a version built with -fPIE -pie to support Android 5.0.+   * sync: Fix an edge case where syncing in a bare repository would try to+     merge and so fail.+   * Check git version at runtime, rather than assuming it will be the same+     as the git version used at build time when running git-checkattr and+     git-branch remove.+   * Switch to using relative paths to the git repository.+     - This allows the git repository to be moved while git-annex is running in+       it, with fewer problems.+     - On Windows, this avoids some of the problems with the absurdly small+       MAX\_PATH of 260 bytes. In particular, git-annex repositories should+       work in deeper/longer directory structures than before.+   * Generate shorter keys for WORM and URL, avoiding keys that are longer+     than used for SHA256, so as to not break on systems like Windows that+     have very small maximum path length limits.+   * Bugfix: A file named HEAD in the work tree could confuse some git commands+     run by git-annex."""]]
doc/publicrepos.mdwn view
@@ -22,5 +22,8 @@   `git clone http://psydata.ovgu.de/forrest_gump/.git studyforrest`     High-resolution, ultra-highfield fMRI dataset on auditory perception. +* [rejuvyesh's papers](https://github.com/rejuvyesh/papers)   +  Quite a few AI papers read by [rejuvyesh](http://rejuvyesh.com)+ This is a wiki -- add your own public repository to the list! See [[tips/centralized_git_repository_tutorial]].
doc/special_remotes/S3.mdwn view
@@ -60,8 +60,6 @@   but can be enabled or changed at any time.   time. -  NOTE: there is a [[bug|/bugs/S3_upload_not_using_multipart/]] which depends on the AWS library. See [[this comment|http://git-annex.branchable.com/bugs/S3_upload_not_using_multipart/#comment-4c45dac68866d3550c0b32ed466e2c6a]] (the latest as of now).- * `fileprefix` - By default, git-annex places files in a tree rooted at the   top of the S3 bucket. When this is set, it's prefixed to the filenames   used. For example, you could set it to "foo/" in one special remote,
+ doc/tips/owncloudannex/comment_8_6579203d726f4a39db02fcdda156e12c._comment view
@@ -0,0 +1,8 @@+[[!comment format=mdwn+ username="https://www.google.com/accounts/o8/id?id=AItOawn97aJ3CN48pBix54RDHRhqtBzeklNEbSA"+ nickname="Manuel"+ subject="advantage of owncloudannex over webdav remote?"+ date="2015-01-08T18:00:48Z"+ content="""+It seems that owncloud can also be accessed using the webdav remote. Does owncloudannex offer any features which aren't implemented in the webdav remote?+"""]]
+ doc/tips/transmission_integration.mdwn view
@@ -0,0 +1,11 @@+[[This simple script|transmission_integration/transmission_integration.sh]] will make sure files downloaded by the+[Transmission BitTorrent client](https://www.transmissionbt.com/) will+be added into git-annex.++To enable it, install it to /usr/local/bin and add the following to+your settings.json:++	"script-torrent-done-enabled": true,+	"script-torrent-done-filename": "/usr/local/bin/transmission-git-annex-add",++-- [[users/anarcat]]
− doc/tips/transmission_integration.sh
@@ -1,48 +0,0 @@-#! /bin/sh--# This simple script will make sure files downloaded by the-# [Transmission BitTorrent client](https://www.transmissionbt.com/) will-# be added into git-annex.-#-# To enable it, install it to /usr/local/bin and add the following to-# your settings.json:-#    "script-torrent-done-enabled": true,-#    "script-torrent-done-filename": "/usr/local/bin/transmission-git-annex-add",-# -- [[anarcat]]--set -e--# environment from transmission:-# TR_APP_VERSION-# TR_TIME_LOCALTIME-# TR_TORRENT_DIR-# TR_TORRENT_HASH-# TR_TORRENT_ID-# TR_TORRENT_NAME-# source: https://trac.transmissionbt.com/wiki/Scripts--if [ -z "$TR_APP_VERSION" ]; then-  echo "missing expected $TR_APP_VERSION from Transmission"-  exit 1-fi--message="transmission adding torrent '$TR_TORRENT_NAME'--TR_APP_VERSION: $TR_APP_VERSION-TR_TIME_LOCALTIME: $TR_TIME_LOCALTIME-TR_TORRENT_DIR: $TR_TORRENT_DIR-TR_TORRENT_HASH: $TR_TORRENT_HASH-TR_TORRENT_ID: $TR_TORRENT_ID-TR_TORRENT_NAME: $TR_TORRENT_NAME-"--# heredocs preserve newlines-cat <<EOF-$message-EOF-# add the actual torrent and commit whatever's left to commit-cd "$TR_TORRENT_DIR"-git annex add "$TR_TORRENT_NAME" && \-git commit -F- <<EOF-$message-EOF
+ doc/tips/transmission_integration/transmission_integration.sh view
@@ -0,0 +1,38 @@+#! /bin/sh++set -e++# environment from transmission:+# TR_APP_VERSION+# TR_TIME_LOCALTIME+# TR_TORRENT_DIR+# TR_TORRENT_HASH+# TR_TORRENT_ID+# TR_TORRENT_NAME+# source: https://trac.transmissionbt.com/wiki/Scripts++if [ -z "$TR_APP_VERSION" ]; then+  echo "missing expected $TR_APP_VERSION from Transmission"+  exit 1+fi++message="transmission adding torrent '$TR_TORRENT_NAME'++TR_APP_VERSION: $TR_APP_VERSION+TR_TIME_LOCALTIME: $TR_TIME_LOCALTIME+TR_TORRENT_DIR: $TR_TORRENT_DIR+TR_TORRENT_HASH: $TR_TORRENT_HASH+TR_TORRENT_ID: $TR_TORRENT_ID+TR_TORRENT_NAME: $TR_TORRENT_NAME+"++# heredocs preserve newlines+cat <<EOF+$message+EOF+# add the actual torrent and commit whatever's left to commit+cd "$TR_TORRENT_DIR"+git annex add "$TR_TORRENT_NAME" && \+git commit -F- <<EOF+$message+EOF
+ doc/tips/using_Amazon_S3/comment_8_4f9c2f6627f8ed3423bcc8b7bf2f76cb._comment view
@@ -0,0 +1,10 @@+[[!comment format=mdwn+ username="https://www.google.com/accounts/o8/id?id=AItOawkPIqJZ88VZEVqLhLOd1LMdYXcy6bAW9qE"+ nickname="Lemao"+ subject="comment 8"+ date="2015-01-07T13:54:23Z"+ content="""+I use github as my central git repository and I would like to use S3 to store large files with annex. Since the s3 remote in .git/config is not stored in github, how do I make sure I reconnect to the same s3 bucket in case I delete my local clone? Reinitializing the remote will create a completely new bucket.++I would also be a good idea to centralize git-annex folders inside a single bucket so I keep the global namespace under control and can narrow down the permissioning.+"""]]
+ doc/tips/using_Amazon_S3/comment_9_47e4ea77d0262d332d86a06d7aaeddd8._comment view
@@ -0,0 +1,11 @@+[[!comment format=mdwn+ username="http://joeyh.name/"+ subject="comment 9"+ date="2015-01-07T17:25:43Z"+ content="""+Lemao, make sure you have pushed your git-annex branch to your central git repository.++When you clone that repo elsewhere, you can add the S3 remote by running `git annex enableremote cloud` (replace \"cloud\" with whatever name you originally picked when you used `git annex initremote` to set up the S3 remote in the first place.++git-annex stores the necessary configuration of the S3 remote on the git-annex branch.+"""]]
doc/todo/inject_on_import.mdwn view
@@ -19,3 +19,45 @@      $ ls ~/annex/import     C++> You seem to have described exactly what --deduplicate already does.+> For example:++<pre>+# mkdir x+# cd x+# l+# git init+Initialized empty Git repository in /home/joey/tmp/x/.git/+# git annex init+init  ok+(Recording state in git...)+# echo hello > foo+# git annex add foo+add foo ok+(Recording state in git...)+# mkdir ../src+# echo hello > ../src/bar+# echo new > ../src/baz+# git annex import --deduplicate ../src+import src/bar (duplicate) ok+import src/baz ok+(Recording state in git...)+# ls+foo@  src/+# ls ../src/+# ls src+baz@+</pre>++> And, if you look at the documentation for --deduplicate,+> this is what it says:++<pre>+              To  only  import  files whose content has not been seen+              before by  git-annex,  use  the  --deduplicate  option.+              Duplicate  files  will be deleted from the import loca‐+              tion.+</pre>++> So, [[done]] I suppose... --[[Joey]]
doc/todo/windows_support.mdwn view
@@ -3,6 +3,12 @@  ## status +* There can be problems when the git-annex repository is in a deep+  or long path. Ie, `C:\loooooooooooooooooongdir\`.+  [Details here](http://git-annex.branchable.com/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows)+  Workaround: Put your git-annex repo in `C:\annex` or some similar short+  path if possible.+ * XMPP library not yet built. (See below.)  * Local pairing seems to fail, after acking on Linux box, it stalls.
git-annex.cabal view
@@ -1,5 +1,5 @@ Name: git-annex-Version: 5.20141231+Version: 5.20150113 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess <joey@kitenet.net>
standalone/android/Makefile view
@@ -1,96 +1,29 @@ # Cross-compiles utilities needed for git-annex on Android, # and builds the Android app. -# Add Android cross-compiler to PATH (as installed by ghc-android)-ANDROID_CROSS_COMPILER?=$(HOME)/.ghc/$(shell cat abiversion)/bin-PATH:=$(ANDROID_CROSS_COMPILER):$(PATH)--# Paths to the Android SDK and NDK.-export ANDROID_SDK_ROOT?=$(HOME)/.android/adt-bundle-linux-x86/sdk-export ANDROID_NDK_ROOT?=$(HOME)/.android/android-ndk--# Where to store the source tree used to build utilities. This-# directory will be created by `make source`.-GIT_ANNEX_ANDROID_SOURCETREE?=$(HOME)/.android/git-annex-sourcetree--GITTREE=$(GIT_ANNEX_ANDROID_SOURCETREE)/git/installed-tree--VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<../../CHANGELOG)--build: start-	if [ ! -e "$(GIT_ANNEX_ANDROID_SOURCETREE)" ]; then $(MAKE) source; fi-	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp-	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/build-stamp-	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/build-stamp-	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/build-stamp-	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg/build-stamp-	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/git/build-stamp-	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/term/build-stamp--	perl -i -pe 's/(android:versionName=)"[^"]+"/$$1"'$(VER)'"/' $(GIT_ANNEX_ANDROID_SOURCETREE)/term/AndroidManifest.xml-	-	# Debug build because it does not need signing keys.-	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && tools/build-debug--	# Install executables as pseudo-libraries so they will be-	# unpacked from the .apk.-	mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.busybox.so-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/ssh $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.ssh.so-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/ssh-keygen $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.ssh-keygen.so-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/rsync $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.rsync.so-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg/g10/gpg $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.gpg.so-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git.so-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git-shell $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-shell.so-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git-upload-pack $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-upload-pack.so-	arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/*-	cp runshell $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.runshell.so-	cp start $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.start.so-	-	# remove git stuff we don't need to save space-	rm -rf $(GITTREE)/bin/git-cvsserver \-		$(GITTREE)/libexec/git-core/git-daemon \-		$(GITTREE)/libexec/git-core/git-show-index \-		$(GITTREE)/libexec/git-core/mergetools \-		$(GITTREE)/libexec/git-core/git-credential-* \-		$(GITTREE)/libexec/git-core/git-cvsserver \-		$(GITTREE)/libexec/git-core/git-cvsimport \-		$(GITTREE)/libexec/git-core/git-fast-import \-		$(GITTREE)/libexec/git-core/git-http-backend \-		$(GITTREE)/libexec/git-core/git-imap-send \-		$(GITTREE)/libexec/git-core/git-instaweb \-		$(GITTREE)/libexec/git-core/git-p4 \-		$(GITTREE)/libexec/git-core/git-remote-test* \-		$(GITTREE)/libexec/git-core/git-submodule \-		$(GITTREE)/libexec/git-core/git-svn \-		$(GITTREE)/libexec/git-core/git-web--browse-	# Most of git is in one multicall binary, but a few important-	# commands are still shell scripts. Those are put into-	# a tarball, along with a list of all the links that should be-	# set up.-	cd $(GITTREE) && mkdir -p links-	cd $(GITTREE) && find -samefile bin/git -not -wholename ./bin/git > links/git-	cd $(GITTREE) && find -samefile bin/git-shell -not -wholename ./bin/git-shell > links/git-shell-	cd $(GITTREE) && find -samefile bin/git-upload-pack -not -wholename ./bin/git-upload-pack > links/git-upload-pack-	cd $(GITTREE) && find -type f -not -samefile bin/git -not -samefile bin/git-shell -not -samefile bin/git-upload-pack|tar czf ../git.tar.gz -T --	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git.tar.gz $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git.tar.gz.so+build:+	./buildapk 4+	./buildapk 5 -	git rev-parse HEAD > $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.version.so-	cp ../trustedkeys.gpg $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.trustedkeys.so+# Targets below are used by buildapk, which sets+# GIT_ANNEX_ANDROID_SOURCETREE -	mkdir -p ../../tmp/4.0 ../../tmp/4.3-	-	cp ../../tmp/androidtree/dist/build/git-annex/4.3/git-annex $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so-	arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so-	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && ant debug-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/term/bin/Term-debug.apk ../../tmp/4.3/git-annex.apk+source: $(GIT_ANNEX_ANDROID_SOURCETREE) -	cp ../../tmp/androidtree/dist/build/git-annex/4.0/git-annex $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so-	arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so-	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && ant debug-	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/term/bin/Term-debug.apk ../../tmp/4.0/git-annex.apk+$(GIT_ANNEX_ANDROID_SOURCETREE):+	mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)+	git clone git://git.debian.org/git/d-i/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox+	git clone git://git.kernel.org/pub/scm/git/git.git $(GIT_ANNEX_ANDROID_SOURCETREE)/git+	git clone git://git.samba.org/rsync.git $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync+	git clone git://git.gnupg.org/gnupg.git $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg+	git clone git://git.openssl.org/openssl $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl+	git clone git://github.com/CyanogenMod/android_external_openssh.git $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh+	git clone git://github.com/jackpal/Android-Terminal-Emulator.git $(GIT_ANNEX_ANDROID_SOURCETREE)/term  $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp:+	# This is a version which the openssh below can build with.+	# Newer versions changed something to do with BIGNUM.+	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && git reset --hard 616f71e486d693991b594439c884ec624b32c2d4 	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && CC=$$(which cc) ./Configure android 	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && $(MAKE) 	touch $@@@ -149,22 +82,3 @@ 	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && perl -pi -e 's/Terminal Emulator/Git Annex/g' res/*/strings.xml 	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && echo y | tools/update.sh || true 	touch $@--source: $(GIT_ANNEX_ANDROID_SOURCETREE)--$(GIT_ANNEX_ANDROID_SOURCETREE):-	mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)-	git clone git://git.debian.org/git/d-i/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox-	git clone git://git.kernel.org/pub/scm/git/git.git $(GIT_ANNEX_ANDROID_SOURCETREE)/git-	git clone git://git.samba.org/rsync.git $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync-	git clone git://git.gnupg.org/gnupg.git $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg-	git clone git://git.openssl.org/openssl $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl-	git clone git://github.com/CyanogenMod/android_external_openssh.git $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh-	git clone git://github.com/jackpal/Android-Terminal-Emulator.git $(GIT_ANNEX_ANDROID_SOURCETREE)/term--clean:-	rm -rf $(GITTREE)-	rm -f start--reallyclean: clean-	rm -rf $(GIT_ANNEX_ANDROID_SOURCETREE)
+ standalone/android/buildapk view
@@ -0,0 +1,145 @@+#!/bin/sh+#+# Cross-compiles utilities needed for git-annex on Android,+# and builds the Android app.++set -e++androidversion=$1+if [ -z "$androidversion" ]; then+	echo "need android version (4 or 5) as parameter" >&2+	exit 1+fi++VER="$(perl -e '$_=<>;print m/\((.*?)\)/'<../../CHANGELOG)"++wrap () {+	sed -e "s!PROG!$1!" -e "s!OPTS!$3!" < wrapper.pl > "$2"+	chmod +x "$2"+}++# Add Android cross-compiler to PATH (as installed by ghc-android)+androidtoolchain="$HOME/.ghc/$(cat abiversion)/bin"+# For Android 5, use a wrapped version of the C compiler,+# which sets PIE build flags.+if [ "$androidversion" = 5 ]; then+	rm -rf "$androidtoolchain/5"+	mkdir -p "$androidtoolchain/5"+	for f in $(find "$androidtoolchain" -maxdepth 1 -not -type d -printf '%f\n'); do+		src="$androidtoolchain/$f"+		dest="$androidtoolchain/5/$f"+		case "$f" in+		*-ld*)+			wrap "$src" "$dest" "-pie"+		;;+		*-gcc)+			wrap "$src" "$dest" "-pie -fPIE"+		;;+		*'-g++')+			wrap "$src" "$dest" "-pie -fPIE"+		;;+		*)+			cp -a "$src" "$dest"+		;;+		esac+	done+	PATH="$androidtoolchain/5:$PATH"+else+	PATH="$androidtoolchain:$PATH"+fi+export PATH++# Paths to the Android SDK and NDK.+export ANDROID_SDK_ROOT="$HOME/.android/adt-bundle-linux-x86/sdk"+export ANDROID_NDK_ROOT="$HOME/.android/android-ndk"++GIT_ANNEX_ANDROID_SOURCETREE="$HOME/.android/git-annex-sourcetree"+export GIT_ANNEX_ANDROID_SOURCETREE+if [ ! -e "$GIT_ANNEX_ANDROID_SOURCETREE" ]; then+	make source+fi+src="$GIT_ANNEX_ANDROID_SOURCETREE-$androidversion"+if [ ! -e "$src" ] ; then+	cp -a "$GIT_ANNEX_ANDROID_SOURCETREE" "$src"+fi+GIT_ANNEX_ANDROID_SOURCETREE="$src"+export GIT_ANNEX_ANDROID_SOURCETREE++gittree="$GIT_ANNEX_ANDROID_SOURCETREE/git/installed-tree"++make "$GIT_ANNEX_ANDROID_SOURCETREE/openssl/build-stamp"+make "$GIT_ANNEX_ANDROID_SOURCETREE/openssh/build-stamp"+make "$GIT_ANNEX_ANDROID_SOURCETREE/busybox/build-stamp"+make "$GIT_ANNEX_ANDROID_SOURCETREE/rsync/build-stamp"+make "$GIT_ANNEX_ANDROID_SOURCETREE/gnupg/build-stamp"+make "$GIT_ANNEX_ANDROID_SOURCETREE/git/build-stamp"+make "$GIT_ANNEX_ANDROID_SOURCETREE/term/build-stamp"++perl -i -pe 's/(android:versionName=)"[^"]+"/$1"'"$VER"'"/' \+	"$GIT_ANNEX_ANDROID_SOURCETREE/term/AndroidManifest.xml"++# Debug build because it does not need signing keys.+(cd "$GIT_ANNEX_ANDROID_SOURCETREE/term" && tools/build-debug)++# Install executables as pseudo-libraries so they will be+# unpacked from the .apk.+mkdir -p "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi"+cp "$GIT_ANNEX_ANDROID_SOURCETREE/busybox/busybox" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.busybox.so"+cp "$GIT_ANNEX_ANDROID_SOURCETREE/openssh/ssh" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.ssh.so"+cp "$GIT_ANNEX_ANDROID_SOURCETREE/openssh/ssh-keygen" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.ssh-keygen.so"+cp "$GIT_ANNEX_ANDROID_SOURCETREE/rsync/rsync" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.rsync.so"+cp "$GIT_ANNEX_ANDROID_SOURCETREE/gnupg/g10/gpg" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.gpg.so"+cp "$GIT_ANNEX_ANDROID_SOURCETREE/git/git" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git.so"+cp "$GIT_ANNEX_ANDROID_SOURCETREE/git/git-shell" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git-shell.so"+cp "$GIT_ANNEX_ANDROID_SOURCETREE/git/git-upload-pack" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git-upload-pack.so"+arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note "$GIT_ANNEX_ANDROID_SOURCETREE"/term/libs/armeabi/*+cp runshell "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.runshell.so"+cc start.c -o "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.start.so"++# remove git stuff we don't need to save space+rm -rf $gittree/bin/git-cvsserver \+	$gittree/libexec/git-core/git-daemon \+	$gittree/libexec/git-core/git-show-index \+	$gittree/libexec/git-core/mergetools \+	$gittree/libexec/git-core/git-credential-* \+	$gittree/libexec/git-core/git-cvsserver \+	$gittree/libexec/git-core/git-cvsimport \+	$gittree/libexec/git-core/git-fast-import \+	$gittree/libexec/git-core/git-http-backend \+	$gittree/libexec/git-core/git-imap-send \+	$gittree/libexec/git-core/git-instaweb \+	$gittree/libexec/git-core/git-p4 \+	$gittree/libexec/git-core/git-remote-test* \+	$gittree/libexec/git-core/git-submodule \+	$gittree/libexec/git-core/git-svn \+	$gittree/libexec/git-core/git-web--browse++# Most of git is in one multicall binary, but a few important+# commands are still shell scripts. Those are put into+# a tarball, along with a list of all the links that should be+# set up.+(cd $gittree && mkdir -p links)+(cd $gittree && find -samefile bin/git -not -wholename ./bin/git > links/git)+(cd $gittree && find -samefile bin/git-shell -not -wholename ./bin/git-shell > links/git-shell)+(cd $gittree && find -samefile bin/git-upload-pack -not -wholename ./bin/git-upload-pack > links/git-upload-pack)+(cd $gittree && find -type f -not -samefile bin/git -not -samefile bin/git-shell -not -samefile bin/git-upload-pack | tar czf ../git.tar.gz -T -)+(cp "$GIT_ANNEX_ANDROID_SOURCETREE/git/git.tar.gz" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git.tar.gz.so")++git rev-parse HEAD > "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.version.so"+cp ../trustedkeys.gpg "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.trustedkeys.so"++genapk () {+	mkdir -p ../../tmp/$1; \+	cp ../../tmp/androidtree/dist/build/git-annex/$1/git-annex "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git-annex.so"+	arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git-annex.so"+	(cd "$GIT_ANNEX_ANDROID_SOURCETREE/term" && ant debug)+	cp "$GIT_ANNEX_ANDROID_SOURCETREE/term/bin/Term-debug.apk" ../../tmp/$1/git-annex.apk+}++if [ "$androidversion" = 4 ]; then+	for v in 4.0 4.3; do+		genapk $v+	done+else+	genapk 5.0+fi
+ standalone/android/wrapper.pl view
@@ -0,0 +1,10 @@+#!/usr/bin/perl+my $prog=q{PROG}; # replaced+my @opts=qw{OPTS}; # replaced++if (grep { $_ eq "-r" || $_ eq "--relocatable" } @ARGV) {+	exec($prog,@ARGV) || die "failed to run $prog";+}+else {+	exec($prog,@opts,@ARGV) || die "failed to run $prog";+}
standalone/licences.gz view

binary file changed (63144 → 55832 bytes)

standalone/windows/build.sh view
@@ -73,7 +73,8 @@ Build/BuildVersion > dist/build-version  # Test git-annex-# (doesn't currently work well on autobuilder, reason unknown)+# The test is run in c:/WINDOWS/Temp, because running it in the autobuilder+# directory runs afoul of Windows's short PATH_MAX. PATH="$(pwd)/dist/build/git-annex/:$PATH" export PATH mkdir -p c:/WINDOWS/Temp/git-annex-test/