Hacker News new | ask | show | jobs
by zabcik 4222 days ago
Why are there multiple main() functions? I've never seen this style before. Is it multi-process?
4 comments

There's a bunch of different utilities in there. Each has it's own main() function, and they're compiled into a bunch of binaries.
There are multiple main() functions because there are multiple programs! Check out https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23...
Look at the makefile, it just has a command line program for each basic operation.
Could just be initializers for different modules maybe?