git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Mike Mueller via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Mike Mueller <mike.mueller@moodys.com>
Subject: Re: [PATCH v2 1/1] p4 unshelve: fix "Not a valid object name HEAD0" on Windows
Date: Wed, 29 May 2019 13:41:54 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1905291341060.44@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqq7eaa1fjt.fsf@gitster-ct.c.googlers.com>

Hi Junio,

On Tue, 28 May 2019, Junio C Hamano wrote:

> "Mike Mueller via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Mike Mueller <mike.mueller@moodys.com>
> >
> > git p4 unshelve was failing with these errors:
> >
> > fatal: Not a valid object name HEAD0
> > Command failed: git cat-file commit HEAD^0
> >
> > (git version 2.21.0.windows.1, python 2.7.16)
> >
> > The pOpen call used by git-p4 to invoke the git command can take either a
> > string or an array as a first argument. The array form is preferred
> > because platform-specific escaping of special characters will be
> > handled automatically.(https://docs.python.org/2/library/subprocess.html)
> > The extractLogMessageFromGitCommit method was, however, using the string
> > form and so the caret (^) character in the HEAD^0 argument was not being
> > escaped on Windows.  The caret happens to be the escape character, which
> > is why the git command was receiving HEAD0.
>
> In the output from
>
>     git grep 'read_pipe_lines("'
>
> together with a few hits to harmless constant command line, we find
> this line
>
>     diff = read_pipe_lines("git diff-tree -r %s \"%s^\" \"%s\"" % (self.diffOpts, id, id))
>
> Would the caret we see there cause a similar problem?  It would end
> up running something like
>
>    $ git diff-tree -r -M "HEAD^" "HEAD"

I think you're right!

In addition, I wonder whether we would want to replace the `^` by a `~`,
which would have the same effect, but does not need quoting in Bash nor
CMD.

Ciao,
Dscho

      reply	other threads:[~2019-05-29 11:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 15:33 [PATCH 0/1] p4: fix "Not a valid object name HEAD0" when unshelving Mike Mueller via GitGitGadget
2019-05-10 15:33 ` [PATCH 1/1] p4 unshelve: fix "Not a valid object name HEAD0" Mike Mueller via GitGitGadget
2019-05-15  5:25   ` Junio C Hamano
2019-05-28 18:15 ` [PATCH v2 0/1] p4: fix "Not a valid object name HEAD0" when unshelving Mike Mueller via GitGitGadget
2019-05-28 18:15   ` [PATCH v2 1/1] p4 unshelve: fix "Not a valid object name HEAD0" on Windows Mike Mueller via GitGitGadget
2019-05-28 20:37     ` Junio C Hamano
2019-05-29 11:41       ` Johannes Schindelin [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.1905291341060.44@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=mike.mueller@moodys.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).