From: Junio C Hamano Date: Sun, 04 Nov 2007 07:44:03 GMT Subject: Re: [PATCH 9/5] Migrate git-checkout.sh to use git-rev-parse --parseopt --keep-dashdash Message-ID: <7v7ikytpz0.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1194112219-19968-4-git-send-email-madcoder@debian.org> Pierre Habouzit writes: > Also fix some space versus tabs issues. > --- > git-checkout.sh | 99 +++++++++++++++++++++++++++---------------------------- > 1 files changed, 49 insertions(+), 50 deletions(-) > > diff --git a/git-checkout.sh b/git-checkout.sh > index 8993920..5424745 100755 > --- a/git-checkout.sh > +++ b/git-checkout.sh > @@ -1,6 +1,16 @@ > #!/bin/sh > > -USAGE='[-q] [-f] [-b ] [-m] [] [...]' > +PARSEOPT_OPTS=--keep-dashdash > +OPTIONS_SPEC="\ > +git-branch [options] [] [...] > +-- > +b= create a new branch started at > +l create the new branchs reflog > +track tells if the new branch should track the remote branch > +f proceed even if the index or working tree is not HEAD > +m performa three-way merge on local modifications if needed > +q,quiet be quiet > +" Ok, so this is how PARSEOPT_OPTS gets used. It is a way for the command that sources git-sh-setup to tell the parseopt code what to do. I can agree with this, but then all the other commands that do not set PARSEOPT_OPTS before sourcing git-sh-setup should set it to empty string. Otherwise the users can screw you with their environment variables.