git-annex/Git
Joey Hess 3802f2f270 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.
2013-11-05 21:08:31 -04:00
..
AutoCorrect.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
Branch.hs work around lack of receive.denyCurrentBranch in direct mode 2013-11-05 21:08:31 -04:00
BuildVersion.hs better git version checking 2013-08-02 18:32:26 -04:00
CatFile.hs git-recover-repository 1/2 done 2013-10-20 17:50:51 -04:00
CheckAttr.hs fix off-by-one 2013-10-16 12:14:14 -04:00
CheckIgnore.hs gitignore support for the assistant and watcher 2013-08-02 20:37:03 -04:00
Command.hs pass -c option on to all git commands run 2013-11-05 13:38:37 -04:00
Config.hs automatically set and unset core.bare when switching to/from direct mode 2013-11-05 15:41:24 -04:00
Construct.hs pass -c option on to all git commands run 2013-11-05 13:38:37 -04:00
CurrentRepo.hs avoid more build warnings on Windows 2013-08-04 14:05:36 -04:00
DiffTree.hs use TopFilePath for DiffTree and LsTree 2013-10-17 14:51:19 -04:00
FileMode.hs more completely solve catKey memory leak 2013-09-19 16:41:21 -04:00
Filename.hs handle C-style escapes in Format 2011-12-23 01:05:16 -04:00
FilePath.hs use TopFilePath for DiffTree and LsTree 2013-10-17 14:51:19 -04:00
Fsck.hs add git fsck to cronner, and UI for repository repair (not yet wired up) 2013-10-22 16:02:52 -04:00
GCrypt.hs enabling rsync.net gcrypt repos 2013-09-26 23:47:30 -04:00
HashObject.hs git-recover-repository 1/2 done 2013-10-20 17:50:51 -04:00
Hook.hs refactored hook setup 2013-11-05 15:29:56 -04:00
Index.hs clean up from windows porting 2013-05-11 18:23:41 -04:00
LsFiles.hs repair command: add handling of git-annex branch and index 2013-10-23 13:00:45 -04:00
LsTree.hs implemented removal of corrupt tracking branches 2013-10-21 15:28:06 -04:00
Merge.hs better git version checking 2013-08-02 18:32:26 -04:00
Objects.hs git-recover-repository 1/2 done 2013-10-20 17:50:51 -04:00
Queue.hs try working around windows xargs problem 2013-10-17 15:56:56 -04:00
Ref.hs work around lack of receive.denyCurrentBranch in direct mode 2013-11-05 21:08:31 -04:00
RefLog.hs clean warnings 2013-10-22 14:52:17 -04:00
Remote.hs fix windows build 2013-10-02 20:26:00 -04:00
Repair.hs assistant: Support repairing git remotes that are locally accessible 2013-10-27 15:38:59 -04:00
Sha.hs whitespace fixes 2012-12-13 00:45:27 -04:00
SharedRepository.hs Support git's core.sharedRepository configuration 2012-04-21 15:36:52 -04:00
Types.hs pass -c option on to all git commands run 2013-11-05 13:38:37 -04:00
UnionMerge.hs union merge bugfix 2013-01-16 21:31:06 -04:00
UpdateIndex.hs index file recovery 2013-10-22 12:58:04 -04:00
Url.hs map: Work when there are gcrypt remotes. 2013-11-04 14:14:44 -04:00
Version.hs better git version checking 2013-08-02 18:32:26 -04:00