git-annex-syncgit-annexhttp://git-annex.branchable.com/git-annex-sync/git-annexikiwiki2023-04-19T16:20:35Zwhen push fails due to non-fast-forward merge, pull and retry?http://git-annex.branchable.com/git-annex-sync/comment_1_2e12ed1c1a594dfbd06a3f25f5e25e57/Ilya_Shlyakhter2018-09-12T17:56:40Z2018-09-12T17:56:40Z
<p>When a push would result in a non-fast-forward merge, git-annex-sync currently fails. Maybe instead, pull and retry pushing? This happens in the context of several processes trying to push to the same git-annex repo.</p>
<p>Also, the docs mention synced/master, but it's synced/current-branch.</p>
comment 2http://git-annex.branchable.com/git-annex-sync/comment_2_cc11f83a06352e5049dcbc588d216f27/joey2019-01-21T15:42:51Z2018-10-04T19:07:09Z
<p>git-annex sync pulls before pushing. If another push occurs at the same
time, the push might fail, but retrying the pull will not avoid that same
situation occurring again. I don't think it makes sense for git-annex sync
to retry an arbitrary number of times.</p>
comment 3http://git-annex.branchable.com/git-annex-sync/comment_3_cf05eba2bcc10f48092334f9ce889863/Ilya_Shlyakhter2019-01-21T15:42:51Z2018-10-04T19:30:07Z
Maybe, have a config option for the number of retries or the maximum time to keep trying? An important property of git-annex-sync is that, even though it does merging, it does not normally fail. It'd be good to keep that guarantee even in the face of concurrent access to the repo. Alternately, you could push to a new branch synced/uuid/branchname, and then when git-annex-sync is later done at the target repo locally, merge from each of the synced/*/branchname .
comment 4http://git-annex.branchable.com/git-annex-sync/comment_4_bd5e45a7e668063df9159033a0857075/Ilya_Shlyakhter2019-01-21T15:42:51Z2018-10-09T18:41:33Z
When concurrent git-annex commands on the same repo update that repo's git-annex branch, how is that handled?
re: comment 4http://git-annex.branchable.com/git-annex-sync/comment_5_5bf6c2b9750dbe5cff87d630f59f511a/joey2020-06-17T01:18:32Z2020-02-20T19:30:38Z
<p>With approptiate locking to prevent concurrency problems. As is the case
extensively throughout git-annex, although users seem to keep expecting
that to not be the case no matter how many times I assure them it is.</p>
Sync to remote master?http://git-annex.branchable.com/git-annex-sync/comment_6_2c989d6d9f2ad2821db970cb3aed83c7/dud2252023-04-19T08:40:41Z2023-04-19T08:40:41Z
<p>I'm a bit confused by what is mentioned in this page:</p>
<blockquote><p>To make working with such non-bare remotes easier, sync pushes not only local master to remote master, but also to remote synced/master</p></blockquote>
<p>but just above it's explained that by default Git does not allow to push to remote master:</p>
<blockquote><p>Syncing with a non-bare remote will not normally update the remote's current branch with changes from the local repository.</p></blockquote>
<p>In addition the page https://git-annex.branchable.com/sync/ doesn't mention that the remote master branch is directly synchronized:</p>
<blockquote><p>When you run git annex sync [...] Finally, it updates synced/master to reflect the new state of master, and pushes it out to each of the remotes.</p></blockquote>
<p>So I was wondering about the correctness of the first cited sentence.</p>
Re: Sync to remote master?http://git-annex.branchable.com/git-annex-sync/comment_7_8f9a5457020bed293e9a93ccc9461a65/joey2023-04-19T16:20:35Z2023-04-19T16:17:11Z
<p>The push to remote master will typically fail in a non-bare repository
(it is possible to configure one to allow it). The push to synced/master
will then succeed. Then when sync is later run in that repository, it will
merge synced/master into master.</p>