Jakub Narebski wrote: > Brian Gernhardt wrote: > >> On Dec 20, 2006, at 5:08 AM, Andy Parkins wrote: >> >>> Hello, >>> >>> Help... >>> >>>> +if [ -f .gitmodules ]; then >>> This doesn't work because git-commit is not necessarily in the root >>> of the >>> working tree. How do I safely get that root? While ${GIT_DIR}/.. >>> would work >>> it is not guaranteed. >> The way to do that seems to be "git rev-parse --git-dir". I'm not >> sure why it's not just "git --git-dir" or similar (probably just >> historical reasons), but there you go. > > Because it is "git --git-dir=<PATH>" to set it (probably). > Although it is not insurmountable difficulity... AFAIR, the discussions long ago went along the lines of "if no argument is passed to any of the --*-dir options, print out the current value". If "git --git-dir" doesn't print the directory name of the .git directory inside the repo you're currently in, I'd consider it a bug. -- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htmlReceived on Wed Dec 20 23:36:18 2006
This archive was generated by hypermail 2.1.8 : 2006-12-20 23:37:46 EST