ku1ik / git-dude

Git commit notifier
http://ku1ik.com/
GNU General Public License v3.0
948 stars 68 forks source link

Using existing cloned repository #20

Closed schmurfy closed 13 years ago

schmurfy commented 13 years ago

Hi, I really like the idea of reusing my already cloned repository instead of cloning them again somewhere else but I was wondering how git would handle things in case of simultaneous operations, if git-dude is doing a fetch and at the same time I am doing a pull for example.

While I am pretty sure it may well never happen I would not want to corrupt a repository by accident.

Any idea if this case would be handled gracefully by git ?

ku1ik commented 13 years ago

Honestly, I'm not sure. I expect that git uses some lock to prevent data corruption in such scenario but I don't know if that happens.

You'd need to do some research on that topic.

schmurfy commented 13 years ago

Thanks for the answer, I did a quick google search but found nothing related. I expect too that git uses some lock internally but having multiple actions acting on the same filesystem seems to be such an edge case that I am not sure it was even considered.

That said git is doing an impressive job to keep integrity, I never managed to corrupt any repositories until now.

ku1ik commented 13 years ago

According to this comment http://stackoverflow.com/questions/750765/concurrency-in-a-git-repo-on-a-network-shared-folder/751026#751026 you should be rather safe.

This one http://git.661346.n2.nabble.com/concurrent-fetches-to-update-same-mirror-td5893458.html is particularly about concurrent git fetches and it seems nothing wrong should happen.

schmurfy commented 13 years ago

Nice findings, thanks for reporting them :) Looks like it is really safe after all, i will give it a try then.