From: Junio C Hamano Date: Tue, 17 May 2005 21:18:18 GMT Subject: Re: [PATCH 1/2] Introduce git-run-with-user-path helper program. Message-ID: <7v4qd1tuud.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20050517203500.GH7136@pasky.ji.cz> >>>>> "PB" == Petr Baudis writes: PB> Actually, my doubts about general usefulness of this wrapper are PB> growing. Cogito is unlikely to ever make use of it since it has to PB> figure out the .git location anyway for own use (it keeps plenty of own PB> files there). I think "having to figure out .git anyway" is backwards, if your plan is to make Cogito take filesystem paths as opposed to GIT paths. If the plan for Cogito is to take always GIT paths, which is a sensible way as well, then it is irrelevant for the implementation of Cogito, but then it becomes useful for users of Cogito). If your plan is to make Cogito take filesystem paths, then you can move bulk of the code currently in cg-blah, except the part that picks up non-path parameters, to cg-Xblah, and reduce cg-blah implementation down to just: ... parse options by shifting "$@" out. ... then git-run-with-user-path cg-Xblah $non-path-opts -- "$@" and you can rip "the code to figure out .git" out from cg-Xblah. There is nothing to figure out at that point; it always is ${GIT_DIR-.git}/.