From d9d8b83714e0c297858801c5fbf5bca056738ca8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 25 Feb 2016 16:11:13 -0400 Subject: adjusted branches, proof of concept "git annex adjust" may be a temporary interface, but works for a proof of concept. It is pretty fast at creating the adjusted branch. The main overhead is injecting pointer files. It might be worth optimising that by reusing the symlink target as the pointer file content. When I tried to do that, the problem was that the clean filter doesn't use that same format, and so git thought files had changed. Could be dealt with, perhaps make the clean filter use symlink format for pointer files when on an adjusted branch? But the real overhead is in checking out the branch, when git runs the smudge filter once per file. That is perhaps too slow to be usable, although it may only affect initial checkout of the branch, and not updates. TBD. --- Command/Adjust.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Command/Adjust.hs (limited to 'Command') diff --git a/Command/Adjust.hs b/Command/Adjust.hs new file mode 100644 index 000000000..b52537a64 --- /dev/null +++ b/Command/Adjust.hs @@ -0,0 +1,25 @@ +{- git-annex command + - + - Copyright 2016 Joey Hess + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Command.Adjust where + +import Command +import Annex.AdjustedBranch + +cmd :: Command +cmd = notBareRepo $ notDirect $ + command "adjust" SectionSetup "adjust branch" + paramNothing (withParams seek) + +seek :: CmdParams -> CommandSeek +seek = withWords start + +start :: [String] -> CommandStart +start [] = do + enterAdjustedBranch UnlockAdjustment + next $ next $ return True +start _ = error "Unknown parameter" -- cgit v1.2.3