git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Monotone to git mirroring ... how to do updates

From
MCMatěj Cepl <mcepl@redhat.com>
Date
Nov 16, 2011, 10:49 UTC
Message-ID
<4EC39555.3060500@redhat.com>
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
Message 1 of 1 in “Monotone to git mirroring ... how to do updates”
  1. Matěj CeplNov 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.