Re: [PATCH 9/5] Migrate git-checkout.sh to use git-rev-parse --parseopt --keep-dashdash
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 4, 2007, 07:44 UTC
- Message-ID
- <7v7ikytpz0.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1194112219-19968-4-git-send-email-madcoder@debian.org>
Pierre Habouzit <madcoder@debian.org> writes:
Show 24 quoted lines
> 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 <new_branch>] [-m] [<branch>] [<paths>...]' > +PARSEOPT_OPTS=--keep-dashdash > +OPTIONS_SPEC="\ > +git-branch [options] [<branch>] [<paths>...] > +-- > +b= create a new branch started at <branch> > +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.