git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joshua Jensen <jjensen@workspacewhiz.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Giuseppe Scrivano <gscrivano@gnu.org>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	msysgit@googlegroups.com
Subject: Re: [msysGit] git rev-parse broken on Git for Windows
Date: Fri, 30 Jul 2010 08:26:45 -0600	[thread overview]
Message-ID: <4C52E125.1020004@workspacewhiz.com> (raw)
In-Reply-To: <201007301102.15274.trast@student.ethz.ch>

  ----- Original Message -----
From: Thomas Rast
Date: 7/30/2010 3:02 AM
> Johannes Schindelin wrote:
>> On Thu, 29 Jul 2010, Joshua Jensen wrote:
>>>   9c7304e3e39ed397b3cc6566573333e2698a52b4 (print the usage string on stdout
>>> instead of stderr) and then 47e9cd28f8a404a0d6293935252ddca5fc243931
>>> (parseopt: wrap rev-parse --parseopt usage for eval consumption) break the
>>> following line from the manual and 'git subtree' on msysGit:
>>>
>>> eval $(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)
>> Both commits are from Junio's 'next' branch. I Cc:ed the authors of both
>> commits.
> Can you elaborate on "break"?
>
> Because as you can see in git-sh-setup.sh, the "official" user of
> parseopt does
>
> 	eval "$(
> 		echo "$OPTIONS_SPEC" |
> 			git rev-parse --parseopt $parseopt_extra -- "$@" ||
> 		echo exit $?
> 	)"
>
> So AFAICS they only differ in the quoting.  And the latter works.
Here is the output from Git Bash:

$ git subtree
C:\Program Files (x86)\Git/libexec/git-core/git-subtree: eval: line 31: 
syntax error near unexpected token `<'
C:\Program Files (x86)\Git/libexec/git-core/git-subtree: eval: line 31: 
`cat <<\EOF usage: git subtree add --prefix=<prefix> <commit
 > or: git subtree merge --prefix=<prefix> <commit> or: git subtree pull 
--prefix=<prefix> <repository> <refspec...> or: git subtree
push --prefix=<prefix> <repository> <refspec...> or: git subtree split 
--prefix=<prefix> <commit...> -h, --help show the help -q qui
et -d show debug messages -P, --prefix ... the name of the subdir to 
split out -m, --message ... use the given message as the commit
  message for the merge commit options for 'split' --annotate ... add a 
prefix to commit message of new commits -b, --branch ... crea
te a new branch from the split subtree --ignore-joins ignore prior 
--rejoin commits --onto ... try connecting new tree to an existin
g one --rejoin merge the new branch back into HEAD options for 'add', 
'merge', 'pull' and 'push' --squash merge subtree changes as a
  single commit EOF exit 129'
Usage: git subtree

The example from the git rev-parse documentation fails in the same way:

eval `echo "$OPTS_SPEC" | git rev-parse --parseopt $parseopt_extra -- 
"$@" || echo exit $?`

What does work is the example you gave with the quotes:

eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt $parseopt_extra -- 
"$@" || echo exit $?)"

I can live with modifying 'git subtree' in this manner, but something 
about one or both of those rev-parse commits cause the non-quoted 
version $(echo...) version in git subtree and the `echo...` version to 
break.

Josh

  reply	other threads:[~2010-07-30 14:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30  5:25 git rev-parse broken on Git for Windows Joshua Jensen
2010-07-30  8:26 ` [msysGit] " Johannes Schindelin
2010-07-30  9:02   ` Thomas Rast
2010-07-30 14:26     ` Joshua Jensen [this message]
2010-07-30 14:43       ` Thomas Rast
2010-07-30 15:01         ` [PATCH] Documentation/rev-parse: quoting is required with --parseopt Thomas Rast
2010-07-30 16:44         ` [msysGit] git rev-parse broken on Git for Windows Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C52E125.1020004@workspacewhiz.com \
    --to=jjensen@workspacewhiz.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gscrivano@gnu.org \
    --cc=msysgit@googlegroups.com \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).