git/list[1] front-page[2] threads[3] people[4] search[5] about
 

cygwin git and golang: how @{u} is handled

From
JCJohn Cheng <johnlicheng@gmail.com>
Date
Jan 21, 2018, 18:31 UTC
Message-ID
<CAJzZBAQuOqwRmBLOdUEVMY74_xT2dWe3a+9qT9ufc4bp8gjgig@mail.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.

-- 
---
John L Cheng
Next: Ævar Arnfjörð Bjarmason
Message 1 of 4 in “cygwin git and golang: how @{u} is handled”
  1. John ChengJan 21, 2018
  2. Ævar Arnfjörð BjarmasonJan 21, 2018
  3. Philip OakleyJan 21, 2018
  4. John ChengJan 22, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.