Monotone to git mirroring ... how to do updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am trying to make script to be run from crontab which would periodically mirror pidgin monotone repo to my git one (using https://github.com/felipec/pidgin-git-import).

The main script in this repo is import:

#!/bin/sh

export GIT_DIR=pidgin.git

git init

git_marks="marks-git.txt"
mtn_marks="marks-mtn.txt"

touch $git_marks $mtn_marks

mtn --db pidgin.mtn pull
mtn git_export --db pidgin.mtn --authors-file=authors_map.txt \
    --branches-file=branches_map.txt \
    --refs=revs --import-marks=$mtn_marks --export-marks=$mtn_marks \
    --use-one-changelog | \
  git fast-import --import-marks=$git_marks --export-marks=$git_marks

I can see what this script does on the first run (when creating new git repo), but what it does when I try to update with it already existing repo from updated pidgin.mtn database? Where I can see the new changes? Probably remote branches should be updated, right? (yes, I don't understand well what actually git fast-import does, that's the problem).

Also, if I get eventually new changes to the remote branches on the git repo, how can I update (preferably by one command) 140+ branches at once? Or do I have to do something in the tune of?

for remote_branch in $(git branches -r) ; do
   local_branch=$(echo $remote_branch |sed -e 's/origin\///')
   git checkout $local_branch
   git merge $remote_branch
done

Thank you in advance for any ideas,

Matěj
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]