Your message dated Thu, 15 Apr 2021 22:03:38 +0000
with message-id <[email protected]>
and subject line Bug#986947: fixed in git-annex 8.20210223-2
has caused the Debian Bug report #986947,
regarding backported patch to fix bug importing from a special remote into a
subdirectory more than one level deep
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
986947: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986947
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: git-annex
Version: 8.20210223-1
Severity: normal
Since I assume git-annex is frozen at this version, and a subsequent
version fixed a relatively bad bug, I've put together this backport of a
patch. I'd rate this just below a data loss bug, since it can end up
generating trees that significantly confuse git.
https://git-annex.branchable.com/bugs/Importing_into_nested_directory_overwrites_files__63__/
--
see shy jo
From 4611813ef1a6ecc86fafc095a324ef0cfe7427e7 Mon Sep 17 00:00:00 2001
From: Joey Hess <[email protected]>
Date: Fri, 26 Mar 2021 16:01:55 -0400
Subject: [PATCH] Fix bug importing from a special remote into a subdirectory more than one level deep
Which generated unusual git trees that could confuse git merge,
since they incorrectly had 2 subtrees with the same name.
Root of the bug was a) not testing that at all! but also
b) confusing graftdirs, which contains eg "foo/bar" with
non-recursively read trees, which would contain eg "bar"
when reading a subtree of "foo".
It's worth noting that Annex.Import uses graftTree, but it really
shouldn't have needed to. Eg, when importing into foo/bar from a remote,
it's enough to generate a tree of foo/bar/x, foo/bar/y, and does not
include other files that are at the top of the master branch. It uses
graftTree, so it does include the other files, as well as the foo/bar
tree. git merge will do the same thing for both trees. With that said,
switching it away from graftTree would result in another import
generating a new commit that seems to delete files that were there in a
previous commit, so it probably has to keep using graftTree since it
used it before.
---
Git/Tree.hs | 26 +++++++++----------
diff --git a/Git/Tree.hs b/Git/Tree.hs
index 325508e46..6a43cff0e 100644
--- a/Git/Tree.hs
+++ b/Git/Tree.hs
@@ -306,43 +306,43 @@ graftTree'
-> Repo
-> MkTreeHandle
-> IO Sha
-graftTree' subtree graftloc basetree repo hdl = go basetree graftdirs
+graftTree' subtree graftloc basetree repo hdl = go basetree subdirs graftdirs
where
- go tsha (topmostgraphdir:restgraphdirs) = do
+ go tsha (subdir:restsubdirs) (topmostgraphdir:restgraphdirs) = do
Tree t <- getTree LsTree.LsTreeNonRecursive tsha repo
- t' <- case partition isabovegraft t of
+ let abovegraftpoint i = gitPath i == gitPath subdir
+ t' <- case partition abovegraftpoint t of
+ -- the graft point is not already in the tree,
+ -- so graft it in, keeping the existing tree
+ -- content
([], _) -> do
graft <- graftin (topmostgraphdir:restgraphdirs)
return (graft:t)
- -- normally there can only be one matching item
- -- in the tree, but it's theoretically possible
- -- for a git tree to have multiple items with the
- -- same name, so process them all
(matching, rest) -> do
newshas <- forM matching $ \case
RecordedSubTree tloc tsha' _
| null restgraphdirs -> return $
RecordedSubTree tloc subtree []
| otherwise -> do
- tsha'' <- go tsha' restgraphdirs
+ tsha'' <- go tsha' restsubdirs restgraphdirs
return $ RecordedSubTree tloc tsha'' []
_ -> graftin (topmostgraphdir:restgraphdirs)
return (newshas ++ rest)
mkTree hdl t'
- go _ [] = return subtree
-
- isabovegraft i = beneathSubTree i graftloc || gitPath i == gitPath graftloc
+ go _ _ [] = return subtree
graftin t = recordSubTree hdl $ graftin' t
graftin' [] = RecordedSubTree graftloc subtree []
graftin' (d:rest)
| d == graftloc = graftin' []
| otherwise = NewSubTree d [graftin' rest]
-
+
+ subdirs = splitDirectories $ gitPath graftloc
+
-- For a graftloc of "foo/bar/baz", this generates
-- ["foo", "foo/bar", "foo/bar/baz"]
graftdirs = map (asTopFilePath . toInternalGitPath . encodeBS) $
- mkpaths [] $ splitDirectories $ gitPath graftloc
+ mkpaths [] subdirs
mkpaths _ [] = []
mkpaths base (d:rest) = (joinPath base </> d) : mkpaths (base ++ [d]) rest
--
2.30.2
signature.asc
Description: PGP signature
--- End Message ---
--- Begin Message ---
Source: git-annex
Source-Version: 8.20210223-2
Done: Sean Whitton <[email protected]>
We believe that the bug you reported is fixed in the latest version of
git-annex, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Sean Whitton <[email protected]> (supplier of updated git-annex package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Wed, 14 Apr 2021 10:05:22 -0700
Source: git-annex
Architecture: source
Version: 8.20210223-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Haskell Group
<[email protected]>
Changed-By: Sean Whitton <[email protected]>
Closes: 986947
Changes:
git-annex (8.20210223-2) unstable; urgency=medium
.
* Apply backported patch to fix special remote import bug (Closes: #986947).
Thanks to Joey Hess for the fix and for making me aware of the problem.
Checksums-Sha1:
2688d4068e559d51e995b76825119bbad30a7150 5518 git-annex_8.20210223-2.dsc
dc558cbc3c3304b496909b49ef7f6b8d41bbc07e 79956
git-annex_8.20210223-2.debian.tar.xz
Checksums-Sha256:
b9cfa7a96bed0c2cb9f09fddc7894555a8888a9f42321ba2dd56c8eadd125af0 5518
git-annex_8.20210223-2.dsc
6708351b6cdb176f7ae80a17fa09190a0d2f773a6225680eaf38b59effeea815 79956
git-annex_8.20210223-2.debian.tar.xz
Files:
dcc43f77d552287f4ca04505c80b28e3 5518 utils optional git-annex_8.20210223-2.dsc
42807cce656833dc0d4da6867f101743 79956 utils optional
git-annex_8.20210223-2.debian.tar.xz
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEm5FwB64DDjbk/CSLaVt65L8GYkAFAmB4sxIACgkQaVt65L8G
YkC47A//dUQB3hDgTAED+4mxN6Cdm+aL825Xk0AmB6vi6popBkSKuuxwB3wkZIxm
kdNhbaF6lil68TlNI748EnTKOehzZZKCm8ssHaSNuF1qIFoL3tInJaAfp5EzppHq
IfQf9raH7dIzNNqF/p1iZyJ/c1kbeEgYpJB5JaaY+hPxNFZUFsZBli4Tcx5KOSSz
+ydhiLAidpPOEEpi98n8nL/bEQFC5tO9qaC1ndWofscm7FUDkq0L+tlVfuitnT8u
O9Le3ONfnnItGhRzChI/aY+BnCMI6LvzZ0s5DgU+ogwihgd0e8sSyLPEyn9ThZyB
xawg1TrmkBBIkUY7CZgyOWY5LtQ+ryANax3HuvpLI9J5ts6cOTT2JQg4MQVsveYA
uoURlwdBSNVjv/4jm47RXpwt2bMQdJMQOEbdLjUAQuBJyL2m8GFmGtH80yDbauf9
SvnK7765UZvpSK0rG8MHYKnyFnfuoKTShAuDpiRJEqzqyQ0I/rY0uNtQPcK/Ayt7
GG/uOp06RwSYgYJw/0eYKyiZHfDuoTRgUV7Lwp8z9WSwIu1mvW3G7FEEPccCIOJJ
Qkl3JtISIucN0cfjnzLinmp9wmelCGAETslX5uWJUBL6lbFq5rzsmpkulsu4ps61
flnruGJPEKIt1Pk6OpVKzSQBZBz1LVJ53jy8aM2Qg/EC5UxNzTI=
=LKAq
-----END PGP SIGNATURE-----
--- End Message ---