diff options
author | Joey Hess <joey@kitenet.net> | 2012-08-03 23:51:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-08-03 23:51:49 -0400 |
commit | 0ca85a94283a0ec067fc498747f246ef63dce993 (patch) | |
tree | 593f4ea3e4fa66d834ce880546ebdb546b29f192 /Init.hs | |
parent | 98aa929f0271631ba5ee1fc430cd177bd886d9ef (diff) |
Revert "init: If no description is provided for a new repository, one will automatically be generated, like "joey@gnu:~/foo""
This reverts commit abde98cda21d5deeb16ed3baf736b06fdc2fce2f.
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..
Diffstat (limited to 'Init.hs')
-rw-r--r-- | Init.hs | 22 |
1 files changed, 1 insertions, 21 deletions
@@ -19,26 +19,6 @@ import Logs.UUID import Annex.Version 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 mdescription = do prepUUID @@ -46,7 +26,7 @@ initialize mdescription = do setVersion gitPreCommitHookWrite u <- getUUID - describeUUID u =<< genDescription mdescription + maybe (recordUUID u) (describeUUID u) mdescription uninitialize :: Annex () uninitialize = do |