git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Philip Oakley" <philipoakley@iee.org>
To: "John Cheng" <johnlicheng@gmail.com>, <git@vger.kernel.org>
Subject: Re: cygwin git and golang: how @{u} is handled
Date: Sun, 21 Jan 2018 23:43:24 -0000	[thread overview]
Message-ID: <0A3A0675F3984789908D19A7A39235D5@PhilipOakley> (raw)
In-Reply-To: CAJzZBAQuOqwRmBLOdUEVMY74_xT2dWe3a+9qT9ufc4bp8gjgig@mail.gmail.com

From: "John Cheng" <johnlicheng@gmail.com>
>I am experiencing a strange behavior and I'm not certain if it is a
> problem with golang or the cygwin version of git.
>
> Steps to reproduce:
> Use golang's os/exec library to execute
> exec.Command(os.Args[1],"log","@{u}") // where os.Args[1] is either
> cygwin git or Windows git
>
> Expected result:
> commit 09357db3a29909c3498143b0d06989e00f5e2442
> Author: John Cheng <johnlicheng@gmail.com>
> Date:   Sun Jan 14 10:57:01 2018 -0800
> ...
>
> Actual result:
> Suppose that cygwin git is specified, the result becomes:
> exit status 128 fatal: ambiguous argument '@u': unknown revision or
> path not in the working tree.
>
> Version:
> git version 2.15.1.windows.2
> git version 2.15.1
>
> I'm not certain if this is a git problem, as I could not reproduce
> this problem using python to script cygwin git.
>
> A list of scenarios I've tested are
> 1. golang + cygwin git = "exit code 128"
> 2. golang + windows git = "exit code 0"
> 3. python + cygwin git = "exit code 0"
> 4. python + windows git = "exit code 0"
>
> I've tried to write a simple program to echo the command line
> parameters passed by go into the process it executes - and it appears
> that go itself does not change "@{u}" into "@u". I'm a bit stuck at
> point to figure out which may be the cause: golang or git. I figured
> I'd start here.
>
There is a similar problem a user is experiencing on Git-for-Windows, that 
we/the user haven't got to the bottom of, but it appears to have a similar 
form where the braces appear to be is some form parsed twice (though thats 
still a guess / hypothesis).

"Aliases in git are stripping curly-brackets (#1220)" 
https://github.com/git-for-windows/git/issues/1220#issuecomment-340341336



Philip


  parent reply	other threads:[~2018-01-21 23:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-21 18:31 cygwin git and golang: how @{u} is handled John Cheng
2018-01-21 18:55 ` Ævar Arnfjörð Bjarmason
2018-01-21 23:43 ` Philip Oakley [this message]
2018-01-22  1:44   ` John Cheng

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=0A3A0675F3984789908D19A7A39235D5@PhilipOakley \
    --to=philipoakley@iee.org \
    --cc=git@vger.kernel.org \
    --cc=johnlicheng@gmail.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).