summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-09 13:35:02 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-09 13:37:06 -0400
commite5ae5bd15965be6919165fb04644b17754e296f8 (patch)
tree0c1bef20f89fa7c6fd0a0c511f60716a872b8d71
parentf1c44f9fad9c10059df99d644a62332629af89cf (diff)
This fixes a bug in the assistant introduced by the literal pathspec changes in version 5.20150406.
git-checkignore refuses to work if any pathspec options are set. Urgh. I audited the rest of git, and no other commands used by git-annex have such limitations. Indeed, AFAICS, *all* other commands support --literal-pathspecs. So, worked around this where git-checkignore is called.
-rw-r--r--Git/CheckIgnore.hs8
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/pathspec_magic_not_supported_by_this_command:___39__literal__39__.mdwn16
3 files changed, 25 insertions, 1 deletions
diff --git a/Git/CheckIgnore.hs b/Git/CheckIgnore.hs
index 5fa3cb637..a03f45432 100644
--- a/Git/CheckIgnore.hs
+++ b/Git/CheckIgnore.hs
@@ -31,10 +31,13 @@ type CheckIgnoreHandle = CoProcess.CoProcessHandle
-
- The first version of git to support what we need is 1.8.4.
- Nothing is returned if an older git is installed.
+ -
+ - check-ignore does not support --literal-pathspecs, so remove that
+ - from the gitGlobalOpts if set.
-}
checkIgnoreStart :: Repo -> IO (Maybe CheckIgnoreHandle)
checkIgnoreStart repo = ifM supportedGitVersion
- ( Just <$> (CoProcess.rawMode =<< gitCoProcessStart True params repo)
+ ( Just <$> (CoProcess.rawMode =<< gitCoProcessStart True params repo')
, return Nothing
)
where
@@ -42,6 +45,9 @@ checkIgnoreStart repo = ifM supportedGitVersion
[ Param "check-ignore"
, Params "-z --stdin --verbose --non-matching"
]
+ repo' = repo { gitGlobalOpts = filter (not . pathspecs) (gitGlobalOpts repo) }
+ pathspecs (Param "--literal-pathspecs") = True
+ pathspecs _ = False
supportedGitVersion :: IO Bool
supportedGitVersion = do
diff --git a/debian/changelog b/debian/changelog
index 557d3eb6b..8b228f156 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,7 @@
git-annex (5.20150406.2) UNRELEASED; urgency=medium
+ * This fixes a bug in the assistant introduced by the literal pathspec
+ changes in version 5.20150406.
* --quiet now suppresses progress displays from eg, rsync.
(Second time's the charm..)
* fromkey, registerurl: When reading from stdin, allow the
diff --git a/doc/bugs/pathspec_magic_not_supported_by_this_command:___39__literal__39__.mdwn b/doc/bugs/pathspec_magic_not_supported_by_this_command:___39__literal__39__.mdwn
index c6703914a..73b846a49 100644
--- a/doc/bugs/pathspec_magic_not_supported_by_this_command:___39__literal__39__.mdwn
+++ b/doc/bugs/pathspec_magic_not_supported_by_this_command:___39__literal__39__.mdwn
@@ -78,3 +78,19 @@ fatal: Work/archive/Tidrapportering/Tid.md: pathspec magic not supported by this
fatal: Work/archive/Tidrapportering/Tid.md: pathspec magic not supported by this command: 'literal'
"""]]
+
+> I've fixed the pathspec magic problem. [[done]]
+>
+> Seems like you could possibly have a separate problem WRT the "commitBuffer:
+> invalid argument". When using the older version of git-annex, did you
+> get that in the log at all?
+>
+> OTOH, the
+> "@Projects/archive/20140515_METOCC_Gr������nsytem������te"
+> weirdness in the log could be where the problem chars are coming from
+> too, in which case it was somehow caused by the pathspec magic problem.
+>
+> I was able to reproduce the pathspec magic problem, but not the encoding
+> looking problem, even when using swedish chars in filenames.
+>
+> --[[Joey]]