From 4e12a0146f3d76282b2f406f4fcb377450085447 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Mar 2016 11:33:26 -0400 Subject: docs for git-annex adjust --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index eed11e4f8..62caa20d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,7 @@ git-annex (6.20160319) UNRELEASED; urgency=medium + * adjust --unlock: Enters an adjusted branch in which all annexed files + are unlocked. The v6 equivilant of direct mode, but much cleaner! * ddar remote: fix ssh calls Thanks, Robie Basak -- cgit v1.2.3 From d3eac61d33603ef2896be9e4b20217e63505a4d6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Mar 2016 13:52:13 -0400 Subject: init: Automatically enter the adjusted unlocked branch when in a v6 repo on a filesystem not supporting symlinks. --- Annex/AdjustedBranch.hs | 13 +++++++++++++ Annex/Init.hs | 12 ++++++++---- Command/Adjust.hs | 1 + debian/changelog | 2 ++ doc/todo/smudge.mdwn | 6 ------ 5 files changed, 24 insertions(+), 10 deletions(-) (limited to 'debian') diff --git a/Annex/AdjustedBranch.hs b/Annex/AdjustedBranch.hs index b2ca7dbf6..8b4712db1 100644 --- a/Annex/AdjustedBranch.hs +++ b/Annex/AdjustedBranch.hs @@ -14,6 +14,7 @@ module Annex.AdjustedBranch ( fromAdjustedBranch, getAdjustment, enterAdjustedBranch, + adjustToCrippledFileSystem, updateAdjustedBranch, propigateAdjustedCommits, ) where @@ -151,6 +152,18 @@ enterAdjustedBranch adj = go =<< originalBranch ] go Nothing = error "not on any branch!" +adjustToCrippledFileSystem :: Annex () +adjustToCrippledFileSystem = do + warning "Entering an adjusted branch where files are unlocked as this filesystem does not support locked files." + whenM (isNothing <$> originalBranch) $ + void $ inRepo $ Git.Branch.commitCommand Git.Branch.AutomaticCommit + [ Param "--quiet" + , Param "--allow-empty" + , Param "-m" + , Param "commit before entering adjusted unlocked branch" + ] + enterAdjustedBranch UnlockAdjustment + adjustBranch :: Adjustment -> OrigBranch -> Annex AdjBranch adjustBranch adj origbranch = do sha <- adjust adj origbranch diff --git a/Annex/Init.hs b/Annex/Init.hs index 7501d9b8f..99f8ece2c 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -33,6 +33,7 @@ import Annex.UUID import Annex.Link import Config import Annex.Direct +import Annex.AdjustedBranch import Annex.Environment import Annex.Hook import Annex.InodeSentinal @@ -92,10 +93,13 @@ initialize' mversion = do whenM versionSupportsUnlockedPointers $ do configureSmudgeFilter Database.Keys.scanAssociatedFiles - ifM (crippledFileSystem <&&> (not <$> isBare) <&&> (not <$> versionSupportsUnlockedPointers)) - ( do - enableDirectMode - setDirect True + ifM (crippledFileSystem <&&> (not <$> isBare)) + ( ifM versionSupportsUnlockedPointers + ( adjustToCrippledFileSystem + , do + enableDirectMode + setDirect True + ) -- Handle case where this repo was cloned from a -- direct mode repo , unlessM isBare diff --git a/Command/Adjust.hs b/Command/Adjust.hs index 2ea39edd2..3f3fd0d82 100644 --- a/Command/Adjust.hs +++ b/Command/Adjust.hs @@ -36,5 +36,6 @@ start :: Adjustment -> CommandStart start adj = do unlessM versionSupportsAdjustedBranch $ error "Adjusted branches are only supported in v6 or newer repositories." + showStart "adjust" "" enterAdjustedBranch adj next $ next $ return True diff --git a/debian/changelog b/debian/changelog index 62caa20d1..f8cd5020c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ git-annex (6.20160319) UNRELEASED; urgency=medium * adjust --unlock: Enters an adjusted branch in which all annexed files are unlocked. The v6 equivilant of direct mode, but much cleaner! + * init --version=6: Automatically enter the adjusted unlocked branch + when filesystem doesn't support symlinks. * ddar remote: fix ssh calls Thanks, Robie Basak diff --git a/doc/todo/smudge.mdwn b/doc/todo/smudge.mdwn index c615f8f14..a80869dc0 100644 --- a/doc/todo/smudge.mdwn +++ b/doc/todo/smudge.mdwn @@ -23,12 +23,6 @@ git-annex should use smudge/clean filters. (May need to use libgit2 to do this efficiently, cannot find any plumbing except git-update-index, which is very inneficient for smudged files.) -* Crippled filesystem should cause all files to be transparently unlocked. - Note that this presents problems when dealing with merge conflicts and - when pushing changes committed in such a repo. Ideally, should avoid - committing implicit unlocks, or should prevent such commits leaking out - in pushes. See [[design/adjusted_branches]]. - * Eventually (but not yet), make v6 the default for new repositories. Note that the assistant forces repos into direct mode; that will need to be changed then, and it should enable annex.thin instead. -- cgit v1.2.3