aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-11 16:18:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-11 16:18:53 -0400
commit71b216d1fb2d2308c75ba0da62e6e6a85c5adb19 (patch)
tree495d6285d52c7df78d22806609f088765c7c2c3d
parent826d5887b2c31c9dca1415997d7704d9442077b0 (diff)
map: Support remotes with /~/ and /~user/
More accurately, it was supported already when map uses git-annex-shell, but not when it does not. Note that the user name cannot be shell escaped using git-annex's current approach for shell escaping. I tried and some shells like dash cannot cd ~'joey'. Rest of directory is still shell escaped, not for security but in case a directory has a space or other weird character.
-rw-r--r--Command/Map.hs12
-rw-r--r--debian/changelog5
-rw-r--r--doc/bugs/git_annex_map_has_problems_with_urls_containing___126__.mdwn2
3 files changed, 14 insertions, 5 deletions
diff --git a/Command/Map.hs b/Command/Map.hs
index f72cb107a..8755bc7c2 100644
--- a/Command/Map.hs
+++ b/Command/Map.hs
@@ -195,11 +195,17 @@ tryScan r
configlist =
onRemote r (pipedconfig, Nothing) "configlist" []
manualconfiglist = do
- let sshcmd =
- "cd " ++ shellEscape(Git.workTree r) ++ " && " ++
- "git config --list"
sshparams <- sshToRepo r [Param sshcmd]
liftIO $ pipedconfig "ssh" sshparams
+ where
+ sshcmd = cddir ++ " && " ++
+ "git config --list"
+ dir = Git.workTree r
+ cddir
+ | take 2 dir == "/~" =
+ let (userhome, reldir) = span (/= '/') (drop 1 dir)
+ in "cd " ++ userhome ++ " && cd " ++ shellEscape (drop 1 reldir)
+ | otherwise = "cd " ++ shellEscape dir
-- First, try sshing and running git config manually,
-- only fall back to git-annex-shell configlist if that
diff --git a/debian/changelog b/debian/changelog
index e1d08ecdb..9c2de7b08 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-git-annex (3.20111108) UNRELEASED; urgency=low
+git-annex (3.20111111) unstable; urgency=low
* Handle a case where an annexed file is moved into a gitignored directory,
by having fix --force add its change.
@@ -7,8 +7,9 @@ git-annex (3.20111108) UNRELEASED; urgency=low
for files that are already present.
* Automatically fix up badly formatted uuid.log entries produced by
3.20111105, whenever the uuid.log is changed (ie, by init or describe).
+ * map: Support remotes with /~/ and /~user/
- -- Joey Hess <joeyh@debian.org> Mon, 07 Nov 2011 18:08:42 -0400
+ -- Joey Hess <joeyh@debian.org> Fri, 11 Nov 2011 13:44:18 -0400
git-annex (3.20111107) unstable; urgency=low
diff --git a/doc/bugs/git_annex_map_has_problems_with_urls_containing___126__.mdwn b/doc/bugs/git_annex_map_has_problems_with_urls_containing___126__.mdwn
index c6eb7bc73..24f04eeb5 100644
--- a/doc/bugs/git_annex_map_has_problems_with_urls_containing___126__.mdwn
+++ b/doc/bugs/git_annex_map_has_problems_with_urls_containing___126__.mdwn
@@ -42,3 +42,5 @@ map` works too:
ok
+
+> [[fixed|done]] --[[Joey]]