Jump to content

working with multiple users in one git repository


Guest balrok

Recommended Posts

we have multiple persons who develop at sd2 and core - for that we have one user (dbs in group dbs) who has the mangos-source + binary stored in it

all developer are also in the group "dbs" and through that they can write and commit their things in the source + compile mangos (starting the binary is done by a restartscript, which runs at the dbs-user)

my problem is, if one user commits his stuff in the source, that the filepermissions of

".git/*" dissallow other users to commit too

example:

-rwxrwxrwx   1 dbs   dbs      317 2009-03-23 12:21 FETCH_HEAD
-rw-r--r--   1 user5 user5     32 2009-03-14 00:37 HEAD
drwxrwxrwx   2 dbs   dbs     4096 2009-03-09 18:35 hooks

maybe thats a bad example cause HEAD isn't maybe so important, but there are also many files in this dir which are owned by a foreign user with rw-r--r (for example the commited revisions)

that i chmodded 777 everything shows just my desperation, if i have a solution i will give it better rights ^^

i think the best will be if we can still use this developement system

but i also thought about making the source-directory to a repository and every developer push's and pulls from there.. i just don't like this solution so much, cause then i need to explain everyone git - and explaining git to people who don't like reading manpages isn't so easy as telling them to change some stuff, do "git add" and "git commit"..

i hope someone has a good idea how to do it, or will just strengthen my idea with a local repository where everybody has to push'n pull

Link to comment
Share on other sites

I'd do it with the one-repo-per-user strategy and pushing to one shared bare repo. It's a lot safer and cleaner way. If (in your scenario) would one dev leave the working tree in a dirty state (including index) and some other try to apply his work and commit, it would be really bad.

If you set up a repo for each individual user, you can make "repo prepare" script which fetches and hard resets to the latest remote commit. Dev can then apply his work, commit and push (you can do automatic push with post-commit hook). You don't even need any kind of ssh encryption when using local paths to remotes to pull/push from/to.

I don't know if you have some time schedules for committing so one dev wouldn't interfere some other, but if you have, you shouldn't feel any need to use rebase. One dev fetch+resets, commits and pushes, other just does the fetch+reset and can do the same as he would on a shared repository.

If you are low on HDD space and can't afford that many working trees, you can take care of that in the "repo prepare" and post-commit scripts. Ie. create working tree for a dev after fetch (using hard reset) and delete it after push in post-commit hook. He don't need it if you have the time schedule as I guessed.

Link to comment
Share on other sites

thank you very much, i realy hoped for this kind of message :)

you're right with the problems you mentioned (we already got them too and if our devs would do more stuff it can be even more problematic)

so more repos will be realy much cleaner

and the idea with just telling them to fetch+reset and commit+push is also quite good.. cause we only allow one running binary there, the devs have to communicate who will test right now - and therefore it's not so hard to watch out that only one fetches+commits at a time.. (and for more skilled gitusers even that wouldn't be a problem)

diskspace is also no problem, i just feared that an own repo for every user would make it to complicated and hoped that for my problem a git solution exists (but you already convinced my, that this solution isn't very good.. when devs will work more, it would only cause problems with dirty working trees)

Link to comment
Share on other sites

Offtopic: just out of curiosity, who are those people and why do they need to work at the same machine ? :).

I'd guess it's some kind of a terminal server so they can work from several places easily. You know -- not all people have a public IP ... (or permission for ipv6 tunnel on both sides).

Link to comment
Share on other sites

we play together at the same server and develop there sd2, database and very seldom mangos-stuff (i have my own port at this testserver and can work on my own copy of source)

i think they develop there, cause the server which hosts this code is extremely fast and compiling+testing can be done quite well.. also some have poor machines where it's not possible to run mangos and the client at the same time and they don't have to set up the server..

also it's good for sharing the work and people who should test the scripts can be easily invited to this server cause of a static ip and fast computer

mh this is every reason i could imagine ^^

it's realy good to have a fast server for such things somewhere in the internet, so i mostly can develop with my laptop and save energy at home :)

edit: today i managed to convert and it was quite easy, i logged in as dbs-user

made

git clone --bare source mangos.git

git clone --bare source/src/bindings/ScriptDev2 sd2.git

and now other user have to fetch and push to /home/dbs/sd2.git or /home/dbs/mangos.git

i explained to them only "reset" "add" "apply" "push" "fetch" "clone" "commit" "diff" "status"

lets see if this new system will work :)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use