Merge branch 'master' of ssh://git-annex.branchable.com

This commit is contained in:
Joey Hess 2011-12-10 12:33:48 -04:00
commit d6fafc463e
3 changed files with 93 additions and 0 deletions

View file

@ -0,0 +1,46 @@
Im using git annex to manage my movie collection on various devices my laptop, a NSLU tucked away somewhere with lots of space, some external hard drives. For this use case, I do not need the full power of git as a version control system, so having to run "git commit" and coming up with commit messages is annoying. Also, this makes sense for a version control system, but not for my media collection:
$ git annex add Hot\ Fuzz\ -\ English.mkv
add Hot Fuzz - English.mkv (checksum...) ok
(Recording state in git...)
$ git commit -m 'another movie added'
[master 851dc8a] another movie added
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 120000 00 Noch nicht gesehen/Hot Fuzz - English.mkv
$ git push jeff
Counting objects: 38, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (26/26), 2.00 KiB, done.
Total 26 (delta 11), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To jeff:/mnt/media/Movies
! [rejected] git-annex -> git-annex (non-fast-forward)
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'jeff:/mnt/media/Movies'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
It seems that to successfully make the new files known to the other side, I have to log into jeff and pull _from_ my current machine.
What I would like to have is that
* git annex add does not require a commit afterwards.
* Changes to the files are automatically picked up with the next git-annex call (similar to how etckeeper works).
* Commands "git annex push" and "git annex pull" that will sync the metadata (i.e. the list of files) in both directions without further manual intervention, at least not until the two repositories have diverged in a way that is not possible to merge sensible.
Summay: git-annex is great. git is not always. Please make it possible to use git annex without having to use git.

View file

@ -0,0 +1,32 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 1"
date="2011-12-09T22:56:11Z"
content="""
First, you need a bare git repository that you can push to, and pull from. This simplifies most git workflow.
Secondly, I use [mr](http://kitenet.net/~joey/code/mr/), with this in `.mrconfig`:
<pre>
[DEFAULT]
lib =
annexupdate() {
git commit -a -m update || true
git pull \"$@\"
git annex merge
git push || true
}
[lib/sound]
update = annexupdate
[lib/big]
update = annexupdate
</pre>
Which makes \"mr update\" in repositories where I rarely care about git details take care of syncing my changes.
I also make \"mr update\" do a \"git annex get\" of some files in some repositories that I want to always populate. git-annex and mr go well together. :)
Perhaps my annexupdate above should be available as \"git annex sync\"?
"""]]

View file

@ -0,0 +1,15 @@
[[!comment format=mdwn
username="http://www.joachim-breitner.de/"
nickname="nomeata"
subject="comment 2"
date="2011-12-10T16:28:29Z"
content="""
Thanks for the tips so far. I guess a bare-only repo helps, but as well is something that I dont _need_ (for my use case), any only have to do because git works like this.
Also, if I have a mobile device that I want to push to, then Id have to have two repositories on the device, as I might not be able to reach my main bare repository when traveling, but I cannot push to the „real“ repo on the mobile device from my computer. I guess I am spoiled by darcs, which will happily push to a checked out
remote repository, updating the checkout if possible without conflict.
If I introduce a central bare repository to push to and from; Id still have to have the other non-bare repos as remotes, so that git-annex will know about them and their files, right?
Id appreciate a \"git annex sync\" that does what you described (commit all, pull, merge, push). Especially if it comes in a \"git annex sync --all\" variant that syncs all reachable repositories.
"""]]