Work around git 2.50 bug that caused it to crash when there is a merge conflict with an unlocked annexed file
This fixes several test suite failures with git 2.50. See the bug report for the full, gory details.
This commit is contained in:
parent
64263a8410
commit
fb155b1e3e
3 changed files with 24 additions and 2 deletions
|
@ -6,6 +6,8 @@ git-annex (10.20250606) UNRELEASED; urgency=medium
|
||||||
filesystems like VFAT that don't support such filenames.
|
filesystems like VFAT that don't support such filenames.
|
||||||
* webapp: Rename "Upgrade Repository" to "Convert Repository"
|
* webapp: Rename "Upgrade Repository" to "Convert Repository"
|
||||||
to avoid confusion with git-annex upgrade.
|
to avoid confusion with git-annex upgrade.
|
||||||
|
* Work around git 2.50 bug that caused it to crash when there is a merge
|
||||||
|
conflict with an unlocked annexed file.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Mon, 23 Jun 2025 11:11:29 -0400
|
-- Joey Hess <id@joeyh.name> Mon, 23 Jun 2025 11:11:29 -0400
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{- Sqlite database of information about Keys
|
{- Sqlite database of information about Keys
|
||||||
-
|
-
|
||||||
- Copyright 2015-2022 Joey Hess <id@joeyh.name>
|
- Copyright 2015-2025 Joey Hess <id@joeyh.name>
|
||||||
-
|
-
|
||||||
- Licensed under the GNU AGPL version 3 or higher.
|
- Licensed under the GNU AGPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
@ -260,7 +260,7 @@ isInodeKnown i s = or <$> runReaderIO ContentTable
|
||||||
- is an associated file.
|
- is an associated file.
|
||||||
-}
|
-}
|
||||||
reconcileStaged :: Bool -> H.DbQueue -> Annex DbTablesChanged
|
reconcileStaged :: Bool -> H.DbQueue -> Annex DbTablesChanged
|
||||||
reconcileStaged dbisnew qh = ifM isBareRepo
|
reconcileStaged dbisnew qh = ifM notneeded
|
||||||
( return mempty
|
( return mempty
|
||||||
, do
|
, do
|
||||||
gitindex <- inRepo currentIndexFile
|
gitindex <- inRepo currentIndexFile
|
||||||
|
@ -335,6 +335,14 @@ reconcileStaged dbisnew qh = ifM isBareRepo
|
||||||
getindextree = inRepo $ \r -> writeTreeQuiet $ r
|
getindextree = inRepo $ \r -> writeTreeQuiet $ r
|
||||||
{ gitGlobalOpts = gitGlobalOpts r ++ bypassSmudgeConfig }
|
{ gitGlobalOpts = gitGlobalOpts r ++ bypassSmudgeConfig }
|
||||||
|
|
||||||
|
notneeded = isBareRepo
|
||||||
|
-- Avoid doing anything when run by the
|
||||||
|
-- smudge clean filter. When that happens in a conflicted
|
||||||
|
-- merge situation, running git write-tree
|
||||||
|
-- here would cause git merge to fail with an internal
|
||||||
|
-- error. This works around around that bug in git.
|
||||||
|
<||> Annex.getState Annex.insmudgecleanfilter
|
||||||
|
|
||||||
diff old new =
|
diff old new =
|
||||||
-- Avoid running smudge clean filter, since we want the
|
-- Avoid running smudge clean filter, since we want the
|
||||||
-- raw output, and it would block trying to access the
|
-- raw output, and it would block trying to access the
|
||||||
|
|
|
@ -82,3 +82,15 @@ So, something that reconcileStaged does is making git unhappy when it
|
||||||
runs the smudge clean filter while creating a stash. It seems logical that
|
runs the smudge clean filter while creating a stash. It seems logical that
|
||||||
the problem would involve the index file, which `reconcileStaged` touches,
|
the problem would involve the index file, which `reconcileStaged` touches,
|
||||||
and which gets updated when stashing..
|
and which gets updated when stashing..
|
||||||
|
|
||||||
|
> Made reconcileStaged run `git write-tree` but not do anything else, and
|
||||||
|
> that is sufficient to make git stash fail. This must be a bug in git,
|
||||||
|
> `git write-tree` should be able to be run at any time, even if it exits
|
||||||
|
> 1 due to the index being in conflict. Having `git write-tree` affect
|
||||||
|
> another process that was already running is not good behavior for git.
|
||||||
|
> Since `git write-tree` does need to sometimes update the index,
|
||||||
|
> this feels like lacking locking.
|
||||||
|
>
|
||||||
|
> I have worked around this by making reconcileStaged avoid doing anything
|
||||||
|
> when called by the smudge clean filter. Which I don't think will cause
|
||||||
|
> any other problems, fingers crossed. [[done]] --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue