From 72959b23e58be8ab61094660700a3d878dd2fc5a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 19 Feb 2020 11:33:35 -0400 Subject: [PATCH] remove mention of receive.denyNonFastforwards on push failure That was added back in 2013 commit 2af652e1b8c13fcc4a1c7c8ec731f04199b09413 and I'm a bit unclear about the reasons. It seemed that, at the time, receive.denyNonFastforwards=true, which is the default in a repo created by git init --shared --bare (but not without --shared), which the assistant did, caused problems syncing. But even at the time the bug report showed an error message clearly explaining that it was a non-fast-forward push being denied. I tried it with the current version, and since git-annex sync pulls from the bare repo and merges, it pushes a fast-forward. So there's no failure to push. (There could be one if another push happened after the pull, but you'd want it to fail then presumably.) I'm not 100% sure what changed to make it not be a problem, but I know I've seen this message in many circumstances and I can't ever recall it having anything to do with any issue that prevented a push. Based on doc/forum/non_fast_forward_error_with_git_annex_sync.mdwn, which showed the problem when syncing from a direct mode repo, and on doc/forum/receiving_indirect_renames_on_direct_repo___63__/comment_3_0246fff6c7c75f6be45bd257ec3872a5._comment which seems to show the problem was actually a problem pulling, I think there's a good chance that the problem actually involved direct mode. --- Command/Sync.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Command/Sync.hs b/Command/Sync.hs index 4986de914f..d841313395 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -492,7 +492,6 @@ pushRemote o remote (Just branch, _) = do then postpushupdate repo else do warning $ unwords [ "Pushing to " ++ Remote.name remote ++ " failed." ] - showLongNote "(non-fast-forward problems can be solved by setting receive.denyNonFastforwards to false in the remote's git config)" return ok where gc = Remote.gitconfig remote @@ -548,9 +547,6 @@ pushRemote o remote (Just branch, _) = do - But overwriting of data on synced/git-annex can happen, in a race. - The only difference caused by using a forced push in that case is that - the last repository to push wins the race, rather than the first to push. - - - - The sync push will fail to overwrite if receive.denyNonFastforwards is - - set on the remote. -} pushBranch :: Remote -> Maybe Git.Branch -> Git.Repo -> IO Bool pushBranch remote mbranch g = directpush `after` annexpush `after` syncpush