unused, dropunused: Now work in bare repositories.

Turned out I had already done all the work needed to support this when
unused started checking all branches.
This commit is contained in:
Joey Hess 2011-10-29 19:16:45 -04:00
parent c102e63595
commit 22e9f445ab
5 changed files with 13 additions and 14 deletions

View file

@ -35,7 +35,7 @@ withUnusedMaps params = do
return $ map (start (unused, unusedbad, unusedtmp)) params return $ map (start (unused, unusedbad, unusedtmp)) params
start :: (UnusedMap, UnusedMap, UnusedMap) -> FilePath -> CommandStart start :: (UnusedMap, UnusedMap, UnusedMap) -> FilePath -> CommandStart
start (unused, unusedbad, unusedtmp) s = notBareRepo $ search start (unused, unusedbad, unusedtmp) s = search
[ (unused, perform) [ (unused, perform)
, (unusedbad, performOther gitAnnexBadLocation) , (unusedbad, performOther gitAnnexBadLocation)
, (unusedtmp, performOther gitAnnexTmpLocation) , (unusedtmp, performOther gitAnnexTmpLocation)

View file

@ -36,7 +36,7 @@ seek = [withNothing start]
{- Finds unused content in the annex. -} {- Finds unused content in the annex. -}
start :: CommandStart start :: CommandStart
start = notBareRepo $ do start = do
from <- Annex.getState Annex.fromremote from <- Annex.getState Annex.fromremote
let (name, action) = case from of let (name, action) = case from of
Nothing -> (".", checkUnused) Nothing -> (".", checkUnused)

1
debian/changelog vendored
View file

@ -12,6 +12,7 @@ git-annex (3.20111026) UNRELEASED; urgency=low
and file contents. Does not check that numcopies is satisfied, as and file contents. Does not check that numcopies is satisfied, as
.gitattributes information about numcopies is not available in a bare .gitattributes information about numcopies is not available in a bare
repository. repository.
* unused, dropunused: Now work in bare repositories.
-- Joey Hess <joeyh@debian.org> Thu, 27 Oct 2011 13:58:53 -0400 -- Joey Hess <joeyh@debian.org> Thu, 27 Oct 2011 13:58:53 -0400

View file

@ -7,16 +7,12 @@ Of course, for that to work, the bare repository has to be on a system with
[[git-annex-shell]] installed. If "origin" is on GitWeb, you still can't [[git-annex-shell]] installed. If "origin" is on GitWeb, you still can't
use git-annex to store stuff there. use git-annex to store stuff there.
Known to work ok: It took a while, but bare repositories are now supported exactly as well
as non-bare repositories. Except for these caveats:
* `git annex move --to` and `--from`, when pointed at a bare repository. * `git annex fsck` works in a bare repository, but does not display
* `git annex copy` ditto. warnings about insufficient
* `git annex drop` can check that a bare repository has a copy of data [[copies]]. To get those warnings, just run it in one of the non-bare
that is being dropped. checkouts.
* `git annex get` can transfer data from a bare repository. * `git annex unused` in a bare repository only knows about keys used in
* Most other stuff (ie, init, describe, trust, etc.) branches that have been pushed to the bare repository. So use it with care..
There are a few caveats to keep in mind when using bare repositories:
* A few subcommands, like `unused` cannot be run in a bare repository.
Those subcommands will refuse to do anything.

View file

@ -12,4 +12,6 @@ What is says on the tin:
>> Fsck is done. Rest not done yet. --[[Joey]] >> Fsck is done. Rest not done yet. --[[Joey]]
>>> all [[done]]! --[[Joey]]
[[!meta title="support unused, dropunused in bare repos"]] [[!meta title="support unused, dropunused in bare repos"]]