git-annex/Annex
Joey Hess 2b97f5381a add tweak-fetch command, for use in the tweak-fetch hook
tweak-fetch is a new git hook I have developed (not yet accepted into
git, but looking bright). Amoung other things, the hook can be used to
observe what is being fetched, notice remote git-annex branches that might
be updated, and merge them into the git-annex branch.

This will solve problems where users do a git pull, immediately followed
by a push, and it refuses to push because their git-annex branch is
diverged, and they neither ran git annex merge by hand, nor ran other
git-annex commands that auto-merge.

The tweak-fetch is written by git annex init. Of course, existing
repositories won't have it, which is ok, because git-annex still
automatically does a merge if changed branches have appeared. Indeed,
it will always need to do that check, as long as it needs to support
support git-annex branches that might be updated by other means.

Eventually though, I will want to ensure all repositories have the
tweak-fetch hook. Perhaps a minor verison upgrade to ensure it is added?

A subtlety of the hook is that when it's run, the remote tracking refs
have not yet been updated. So Annex.Branch.updateTo has to be careful to
only use the sha1 that was fetched, not the branch name. The branch
name is only used in the commit message.

The other tricky thing is that git tweak-fetch hook should *only*
output lines in a specific format, and git will be unhappy if it also
outputs status messages, etc. So those messages are sent to stderr.
2011-12-26 14:25:37 -04:00
..
Branch.hs add tweak-fetch command, for use in the tweak-fetch hook 2011-12-26 14:25:37 -04:00
BranchState.hs split out Annex/BranchState.hs 2011-12-12 17:38:46 -04:00
CatFile.hs detect and recover from branch push/commit race 2011-12-11 20:41:35 -04:00
Content.hs hslint 2011-12-09 01:57:13 -04:00
Exception.hs rename 2011-10-05 16:02:51 -04:00
Journal.hs split out Annex/Journal.hs 2011-12-12 18:03:28 -04:00
Queue.hs reorder repo parameters last 2011-11-08 16:27:20 -04:00
Ssh.hs use Common in a few more modules 2011-12-20 14:37:53 -04:00
UUID.hs split out three modules from Git 2011-12-13 15:06:49 -04:00
Version.hs split out three modules from Git 2011-12-13 15:06:49 -04:00