aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Git/Config.hs11
-rw-r--r--Git/Construct.hs6
-rw-r--r--Git/Types.hs2
-rw-r--r--debian/changelog2
-rw-r--r--debian/control1
-rw-r--r--doc/forum/git_pull_remote_git-annex/comment_8_7e76ee9b6520cbffaf484c9299a63ad3._comment12
-rw-r--r--doc/forum/pure_git-annex_only_workflow/comment_10_683768c9826b0bf0f267e8734b9eb872._comment8
-rw-r--r--doc/install.mdwn1
-rw-r--r--doc/tips/using_gitolite_with_git-annex.mdwn12
9 files changed, 51 insertions, 4 deletions
diff --git a/Git/Config.hs b/Git/Config.hs
index 7b72eba5a..b2587aa44 100644
--- a/Git/Config.hs
+++ b/Git/Config.hs
@@ -42,13 +42,17 @@ hRead repo h = do
- can be updated inrementally. -}
store :: String -> Repo -> IO Repo
store s repo = do
- let repo' = repo { config = parse s `M.union` config repo }
+ let c = parse s
+ let repo' = repo
+ { config = (M.map Prelude.head c) `M.union` config repo
+ , fullconfig = M.unionWith (++) c (fullconfig repo)
+ }
rs <- Git.Construct.fromRemotes repo'
return $ repo' { remotes = rs }
{- Parses git config --list or git config --null --list output into a
- config map. -}
-parse :: String -> M.Map String String
+parse :: String -> M.Map String [String]
parse [] = M.empty
parse s
-- --list output will have an = in the first line
@@ -57,4 +61,5 @@ parse s
| otherwise = sep '\n' $ split "\0" s
where
ls = lines s
- sep c = M.fromList . map (separate (== c))
+ sep c = M.fromListWith (++) . map (\(k,v) -> (k, [v])) .
+ map (separate (== c))
diff --git a/Git/Construct.hs b/Git/Construct.hs
index a35a87cc7..2cc965b4e 100644
--- a/Git/Construct.hs
+++ b/Git/Construct.hs
@@ -115,7 +115,6 @@ remoteNamedFromKey k = remoteNamed basename
fromRemoteLocation :: String -> Repo -> IO Repo
fromRemoteLocation s repo = gen $ calcloc s
where
- filterconfig f = filter f $ M.toList $ config repo
gen v
| scpstyle v = fromUrl $ scptourl v
| isURI v = fromUrl v
@@ -133,6 +132,10 @@ fromRemoteLocation s repo = gen $ calcloc s
startswith prefix k &&
endswith suffix k &&
startswith v l
+ filterconfig f = filter f $
+ concatMap splitconfigs $
+ M.toList $ fullconfig repo
+ splitconfigs (k, vs) = map (\v -> (k, v)) vs
(prefix, suffix) = ("url." , ".insteadof")
-- git remotes can be written scp style -- [user@]host:dir
scpstyle v = ":" `isInfixOf` v && not ("//" `isInfixOf` v)
@@ -210,6 +213,7 @@ newFrom l =
Repo {
location = l,
config = M.empty,
+ fullconfig = M.empty,
remotes = [],
remoteName = Nothing
}
diff --git a/Git/Types.hs b/Git/Types.hs
index 250da5f5e..6063ad213 100644
--- a/Git/Types.hs
+++ b/Git/Types.hs
@@ -18,6 +18,8 @@ data RepoLocation = Dir FilePath | Url URI | Unknown
data Repo = Repo {
location :: RepoLocation,
config :: M.Map String String,
+ -- a given git config key can actually have multiple values
+ fullconfig :: M.Map String [String],
remotes :: [Repo],
-- remoteName holds the name used for this repo in remotes
remoteName :: Maybe String
diff --git a/debian/changelog b/debian/changelog
index 61b10c80f..f3e830c01 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ git-annex (3.20111212) UNRELEASED; urgency=low
* Format strings can be specified using the new --format option, to control
what is output by git annex find.
* Support git annex find --json
+ * Fixed behavior when multiple insteadOf configs are provided for the
+ same url base.
* Can now be built with older git versions (before 1.7.7); the resulting
binary should only be used with old git.
* Updated to build with monad-control 0.3.
diff --git a/debian/control b/debian/control
index a3035e880..3f88c71ea 100644
--- a/debian/control
+++ b/debian/control
@@ -14,6 +14,7 @@ Build-Depends:
libghc-hs3-dev (>= 0.5.6),
libghc-testpack-dev [any-i386 any-amd64],
libghc-monad-control-dev (>= 0.3),
+ libghc-lifted-base-dev,
libghc-json-dev,
ikiwiki,
perlmagick,
diff --git a/doc/forum/git_pull_remote_git-annex/comment_8_7e76ee9b6520cbffaf484c9299a63ad3._comment b/doc/forum/git_pull_remote_git-annex/comment_8_7e76ee9b6520cbffaf484c9299a63ad3._comment
new file mode 100644
index 000000000..5943d9312
--- /dev/null
+++ b/doc/forum/git_pull_remote_git-annex/comment_8_7e76ee9b6520cbffaf484c9299a63ad3._comment
@@ -0,0 +1,12 @@
+[[!comment format=mdwn
+ username="http://joey.kitenet.net/"
+ nickname="joey"
+ subject="git tweak-fetch"
+ date="2011-12-26T18:50:35Z"
+ content="""
+The git tweak-fetch hook that I have been developing, and hope will be accepted into git soon, provides some abilities that could be used to make \"git pull remote\" always merge remote/master. Normall, git can only be configured to do that merge automatically for one remote (ie, origin). But the tweak-fetch hook can flag arbitrary branches as needing merge.
+
+So, it could always flag tracking branches of the currently checked out branch for merge. This would be enabled by some setting, probably, since it's not necessarily the case that everyone wants to auto-merge when they pull like this. (Which is why git doesn't do it by default after all.)
+
+(The tweak-fetch hook will also entirely eliminate the need to run git annex merge manually, since it can always take care of merging the git-annex branch.)
+"""]]
diff --git a/doc/forum/pure_git-annex_only_workflow/comment_10_683768c9826b0bf0f267e8734b9eb872._comment b/doc/forum/pure_git-annex_only_workflow/comment_10_683768c9826b0bf0f267e8734b9eb872._comment
new file mode 100644
index 000000000..dc499cbc9
--- /dev/null
+++ b/doc/forum/pure_git-annex_only_workflow/comment_10_683768c9826b0bf0f267e8734b9eb872._comment
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="http://www.joachim-breitner.de/"
+ nickname="nomeata"
+ subject="Finally some code"
+ date="2011-12-29T19:58:31Z"
+ content="""
+The repository at http://git.nomeata.de/?p=git-annex.git;a=summary contains changes to Commands/Sync.hs (and to the manpage) that implements this behavior. The functionality should be fine; the progress output is not very nice yet, but I’m not sure if I really understood the various Command types. It also should be more easily discoverable how to activate the behavior (by running \"git branch synced/master\") by providing a helpful message, at least unless git annex init creates the branch by default.
+"""]]
diff --git a/doc/install.mdwn b/doc/install.mdwn
index cc26ee91d..ceaa3544f 100644
--- a/doc/install.mdwn
+++ b/doc/install.mdwn
@@ -25,6 +25,7 @@ To build and use git-annex, you will need:
* [SHA](http://hackage.haskell.org/package/SHA)
* [dataenc](http://hackage.haskell.org/package/dataenc)
* [monad-control](http://hackage.haskell.org/package/monad-control)
+ * [lifted-base](http://hackage.haskell.org/package/lifted-base)
* [TestPack](http://hackage.haskell.org/cgi-bin/hackage-scripts/package/testpack)
* [QuickCheck 2](http://hackage.haskell.org/package/QuickCheck)
* [HTTP](http://hackage.haskell.org/package/HTTP)
diff --git a/doc/tips/using_gitolite_with_git-annex.mdwn b/doc/tips/using_gitolite_with_git-annex.mdwn
index ac0a1f6b6..0d89a255b 100644
--- a/doc/tips/using_gitolite_with_git-annex.mdwn
+++ b/doc/tips/using_gitolite_with_git-annex.mdwn
@@ -75,3 +75,15 @@ sent 2606 bytes received 31 bytes 1758.00 bytes/sec
total size is 2502 speedup is 0.95
ok
</pre>
+
+
+### Troubleshooting
+
+I got an error like this when setting up gitolite *after* setting up a local git repo and git annex:
+
+<pre>
+git-annex-shell: First run: git-annex init
+Command ssh ["git@git.example.com","git-annex-shell 'configlist' '/~/myrepo.git'"] failed; exit code 1
+</pre>
+
+because I forgot to "git push --all" after adding the new gitolite remote.