diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-05 21:08:31 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-05 21:08:31 -0400 |
commit | b9d5c418cd5eb89e6ea2de58559da4fe9f487934 (patch) | |
tree | 74d4661836aed80ba72cbcb483e20cf09eec5c12 /doc/todo | |
parent | 638a0190aa2797970151988fa26fe128d1804c9c (diff) |
work around lack of receive.denyCurrentBranch in direct mode
Now that direct mode sets core.bare=true, git's normal prohibition about
pushing into the currently checked out branch doesn't work.
A simple fix for this would be an update hook which blocks the pushes..
but git hooks must be executable, and git-annex needs to be usable on eg,
FAT, which lacks x bits.
Instead, enabling direct mode switches the branch (eg master) to a special
purpose branch (eg annex/direct/master). This branch is not pushed when
syncing; instead any changes that git annex sync commits get written to
master, and it's pushed (along with synced/master) to the remote.
Note that initialization has been changed to always call setDirect,
even if it's just setDirect False for indirect mode. This is needed because
if the user has just cloned a direct mode repo, that nothing has synced
with before, it may have no master branch, and only a annex/direct/master.
Resulting in that branch being checked out locally too. Calling setDirect False
for indirect mode moves back out of this branch, to a new master branch,
and ensures that a manual "git push" doesn't push changes directly to
the annex/direct/master of the remote. (It's possible that the user
makes a commit w/o using git-annex and pushes it, but nothing I can do
about that really.)
This commit was sponsored by Jonathan Harrington.
Diffstat (limited to 'doc/todo')
-rw-r--r-- | doc/todo/direct_mode_guard.mdwn | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/doc/todo/direct_mode_guard.mdwn b/doc/todo/direct_mode_guard.mdwn index 9fbb21cd3..bb7f90897 100644 --- a/doc/todo/direct_mode_guard.mdwn +++ b/doc/todo/direct_mode_guard.mdwn @@ -96,7 +96,10 @@ even when `receive.denyCurrentBranch` is set.) > branch. However, won't work on crippled filesystems! (No +x bit) > > Could make git annex sync detect this. It could reset the master -> branch to the last one committed, before committing. Will work, -> does have the minor oddity that eg `git log` will show commits -> pushed to master before `git annex sync` has been run and so before -> those commits are reflected in the tree. +> branch to the last one committed, before committing. Seems very racy +> and hard to get right! +> +> Could make direct mode operate on a different branch, like +> `annex/direct/master` rather than `master`. Avoid pushing to that +> branch (`git annex sync` can map back from it to `master` and push there +> instead). A bit clumsy, but works. |