perforce - git p4 submit from a bare repository? -
we have devs pushing remote bare repo on server, , automate push perforce nightly using git p4 central bare repo. running snag because seems can't run git p4 submit outside of working tree.
what's recommended way deal this?
i similar script runs every few minutes , 2-way sync between git , p4. git-p4 can't work without both checked-out git tree , p4 repo. in end 3 versions of source:
- the bare git repo
- checked-out git repo 'git p4' work in
- p4 checkout submit p4 from.
developers push bare git repo (held on gitolite), using branch called 'dev'. every few minutes, there's script does:
- update checked-out git tree (git pull --rebase)
- pull down latest upstream p4 changes p4/master (git p4 sync)
- rebase git world against p4 world (git rebase p4/master)
- send git changes p4 (git p4 submit)
- rewrite 'dev' branch (git push origin +head:dev)
gotchas
merge conflicts. these occur infrequently can cause few problems.
i had add locking around whole thing developers don't lose changes if push change between (1) , (5). locking creates lock directory gets used in 1 of hook scripts delay pushes.
rcs keywords. newer versions of 'git p4' copes rcs keywords didn't, whole thing stuck cause merge conflicts.
it took while setup it's been going 18 months 100+ developers few incidents.
Comments
Post a Comment