Have you tried to debug it?
Remember: Git for Windows is a project run by volunteers. And git daemon
in particular was something that was made to run on Windows with a lot of
effort by a volunteer.
So if it does not run for you, I ask that you put in an effort to find out
why it does not and try to fix it. (In the alternative, you could think of
incentives to convince the few volunteers working on Git for Windows -- in
particular git-daemon on Windows -- to fix your issue.)
Hopefully you understand,
Johannes
--detach isn't supported on Windows. git-daemon even tells you this
when you try to start it, by outputting "--detach not supported on
this platform" to stderr.
Adding built-in windows-service support to git-daemon isn't
straight-forward. However, I've looked into making a windows-service
wrapper for git-daemon, and it seems quite doable. But then I found
out about SrvAny, and figured that was probably good enough for what
people needs.
Hmm. Seems not to print this message for me:
C:\src\git-gui>git daemon --export-all --detach
C:\src\git-gui>git version
git version 1.7.9.msysgit.0
Neither for cmd nor git bash shells.
line 1004 of daemon.c says "die("--detach not supported on this
platform");". And I can even step through the code and see that it
gets called. But for some reason the message never appears on the
terminal. Strange.
After stepping a little bit, I see what the problem is: --detach
implies --syslog, which calls sets a custom die-routine before trying
to daemonize. So when we try to print errors, they end up in Windows'
application event log instead of on the console.
Which isn't really that strange, and is the same as what happens on
Linux (if an error would occur, that is). But it's certainly not the
most graceful way of erroring out in this case; this is a missing
feature, not a normal run-time error.
Ah - I was about to post my tracing too :)
It makes more sense when the platform disallows --detach to avoid
setting the log_syslog flag so that it doesn't divert the messages.
Maybe just the following to die immediately:
diff --git a/daemon.c b/daemon.c
index ab21e66..b11e0b4 100644
--- a/daemon.c
+++ b/daemon.c
@@ -1189,8 +1189,12 @@ int main(int argc, char **argv)
continue;
}
if (!strcmp(arg, "--detach")) {
+#ifdef NO_POSIX_GOODIES
+ die("--detach not supported on this platform");
+#else
detach = 1;
log_syslog = 1;
+#endif
continue;
}
if (!prefixcmp(arg, "--user=")) {
Yeah. The reason that wasn't done that way in the first place was that
Junio doesn't like ifdefs inside functions, and we didn't spot this
glitch until now.