summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-26 15:53:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-26 15:53:05 -0400
commite6b5913428189abb834bd52b6d4c562219aacdf6 (patch)
treeda7808ec8e3222a2023b7a28d7960513ca82d1e0
parent5fb1f657d783d80b9c41bdbc7b159ff1483c271e (diff)
sync: print a hint about receive.denyNonFastForwards when a push fails
-rw-r--r--Command/Sync.hs9
-rw-r--r--doc/assistant/release_notes.mdwn9
-rw-r--r--doc/bugs/Windows_and_Linux_in_direct_mode_confuses_git.mdwn5
3 files changed, 13 insertions, 10 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index d792f156f..0c3804c1f 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -184,7 +184,11 @@ pushRemote remote branch = go =<< needpush
showStart "push" (Remote.name remote)
next $ next $ do
showOutput
- inRepo $ pushBranch remote branch
+ ok <- inRepo $ pushBranch remote branch
+ unless ok $ do
+ warning $ unwords [ "Pushing to " ++ Remote.name remote ++ " failed." ]
+ showNote "(non-fast-forward problems can be solved by setting receive.denyNonFastforwards to false in the remote's git config)"
+ return ok
{- Pushes a regular branch like master to a remote. Also pushes the git-annex
- branch.
@@ -211,6 +215,9 @@ pushRemote remote branch = go =<< needpush
- 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 -> Git.Ref -> Git.Repo -> IO Bool
pushBranch remote branch g = tryIO (directpush g) `after` syncpush g
diff --git a/doc/assistant/release_notes.mdwn b/doc/assistant/release_notes.mdwn
index b7f61c373..1b1ece0a0 100644
--- a/doc/assistant/release_notes.mdwn
+++ b/doc/assistant/release_notes.mdwn
@@ -1,12 +1,3 @@
-## 4.20131025
-
-Note that all past versions of the assistant, when used to create a
-git repository on a ssh server, set up the repository in a way that
-prevents `git annex sync` from working (although the assistant can sync
-with it). To fix this misconfiguration, you can ssh to the server
-and run this command inside the bare git repository:
-`git config receive.denyNonFastforwards false`
-
## version 4.20131024
This version fixes several different bugs that could cause the webapp to
diff --git a/doc/bugs/Windows_and_Linux_in_direct_mode_confuses_git.mdwn b/doc/bugs/Windows_and_Linux_in_direct_mode_confuses_git.mdwn
index 100549120..dd4b6a921 100644
--- a/doc/bugs/Windows_and_Linux_in_direct_mode_confuses_git.mdwn
+++ b/doc/bugs/Windows_and_Linux_in_direct_mode_confuses_git.mdwn
@@ -377,3 +377,8 @@ $
# End of transcript or log.
"""]]
+
+> Apparently `test.git` had `receive.denyNonFastForwards`
+> set to true, which prevents the forced pushing `git annex sync`
+> needs to do. I have made it print out a hint about this setting
+> when a push failes. [[done]] --[[Joey]]