Revert "init: If no description is provided for a new repository, one will automatically be generated, like "joey@gnu:~/foo""
This reverts commit abde98cda2
.
Temporarily dropping from master, since this actually uses stuff
that's only currently availble in the assistant branch. Will come back when
I merge that, and can wait..
This commit is contained in:
parent
98aa929f02
commit
0ca85a9428
3 changed files with 2 additions and 25 deletions
22
Init.hs
22
Init.hs
|
@ -19,26 +19,6 @@ import Logs.UUID
|
||||||
import Annex.Version
|
import Annex.Version
|
||||||
import Annex.UUID
|
import Annex.UUID
|
||||||
|
|
||||||
import System.Posix.User
|
|
||||||
|
|
||||||
genDescription :: Maybe String -> Annex String
|
|
||||||
genDescription (Just d) = return d
|
|
||||||
genDescription Nothing = do
|
|
||||||
hostname <- getHostname
|
|
||||||
let at = if null hostname then "" else "@"
|
|
||||||
username <- clicketyclickety
|
|
||||||
reldir <- liftIO . relHome =<< fromRepo Git.repoPath
|
|
||||||
return $ concat [username, at, hostname, ":", reldir]
|
|
||||||
where
|
|
||||||
{- Haskell lacks uname(2) bindings, except in the
|
|
||||||
- Bindings.Uname addon. Rather than depend on that,
|
|
||||||
- use uname -n when available. -}
|
|
||||||
getHostname = liftIO $ catchDefaultIO uname_node ""
|
|
||||||
uname_node = takeWhile (/= '\n') <$>
|
|
||||||
readProcess "uname" ["-n"]
|
|
||||||
clicketyclickety = liftIO $ userName <$>
|
|
||||||
(getUserEntryForID =<< getEffectiveUserID)
|
|
||||||
|
|
||||||
initialize :: Maybe String -> Annex ()
|
initialize :: Maybe String -> Annex ()
|
||||||
initialize mdescription = do
|
initialize mdescription = do
|
||||||
prepUUID
|
prepUUID
|
||||||
|
@ -46,7 +26,7 @@ initialize mdescription = do
|
||||||
setVersion
|
setVersion
|
||||||
gitPreCommitHookWrite
|
gitPreCommitHookWrite
|
||||||
u <- getUUID
|
u <- getUUID
|
||||||
describeUUID u =<< genDescription mdescription
|
maybe (recordUUID u) (describeUUID u) mdescription
|
||||||
|
|
||||||
uninitialize :: Annex ()
|
uninitialize :: Annex ()
|
||||||
uninitialize = do
|
uninitialize = do
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -2,8 +2,6 @@ git-annex (3.20120722) UNRELEASED; urgency=low
|
||||||
|
|
||||||
* initremote: Avoid recording remote's description before checking
|
* initremote: Avoid recording remote's description before checking
|
||||||
that its config is valid.
|
that its config is valid.
|
||||||
* init: If no description is provided for a new repository, one will
|
|
||||||
automatically be generated, like "joey@gnu:~/foo"
|
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Fri, 27 Jul 2012 21:04:47 -0400
|
-- Joey Hess <joeyh@debian.org> Fri, 27 Jul 2012 21:04:47 -0400
|
||||||
|
|
||||||
|
|
|
@ -194,8 +194,7 @@ subdirectories).
|
||||||
using it in a repository that was not intended to have an annex.
|
using it in a repository that was not intended to have an annex.
|
||||||
|
|
||||||
It's useful, but not mandatory, to initialize each new clone
|
It's useful, but not mandatory, to initialize each new clone
|
||||||
of a repository with its own description. If you don't provide one,
|
of a repository with its own description.
|
||||||
one will be generated.
|
|
||||||
|
|
||||||
* describe repository description
|
* describe repository description
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue