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

git command unrecognized argument issue?

From
GCGilbert Catipon <gcatipon@gmail.com>
Date
Jul 18, 2017, 17:28 UTC
Message-ID
<CABdvCd2ntSJT_9G2NnTHLeLA8zRStyECPaMSfifW_5JYzye4Qw@mail.gmail.com>
Hi,

I noticed a surprise inconsistency when using the git command. Using git version 2.7.4 and trying most of the commands listed by git –help usually output error: and usage text when passing an invalid argument.

The exception was the commands log and show. Looks like a cosmetic issue but I didn’t know if this is a dup issue/already in issue tracker.

Thanks, Gilbert Catipon

So to reproduce the issue:

gilbert@tea:~/dev/profile$ git log --foobar fatal: unrecognized argument: --foobar

• Using a for loop to check a list of commands returns 2 fatal commands:

gilbert@tea:~/dev/profile$ for k in bisect grep log show status; do echo $k; git $k --foobarf; done

log fatal: unrecognized argument: --foobarf show fatal: unrecognized argument: --foobarf status error: unknown option `foobarf' usage: git status [<options>] [--] <pathspec>...

• All these commands gave expected error for k in branch checkout commit diff merge rebase tag; do echo $k ; git $k --asdfasd; done

• On ubuntu gilbert@tea:~/dev/profile$ uname -a Linux tea 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

• Setting GIT_TRACE=/tmp/git_trace.log

gilbert@tea:~/dev/profile$ cat /tmp/git_trace.log 09:59:47.703082 git.c:561 trace: exec: 'git-bisect' '--foobarf' 09:59:47.703164 run-command.c:334 trace: run_command: 'git-bisect' '--foobarf' 09:59:47.710513 git.c:344 trace: built-in: git 'rev-parse' '--git-dir' 09:59:47.712607 git.c:344 trace: built-in: git 'rev-parse' '--show-cdup' 09:59:47.714954 git.c:344 trace: built-in: git 'rev-parse' '--git-path' 'objects' 09:59:47.720353 git.c:344 trace: built-in: git 'grep' '--foobarf' 09:59:47.723324 git.c:344 trace: built-in: git 'log' '--foobarf' 09:59:47.726310 git.c:344 trace: built-in: git 'show' '--foobarf' 09:59:47.729065 git.c:344 trace: built-in: git 'status' '--foobarf' gilbert@tea:~/dev/profile$

Message 1 of 1 in “git command unrecognized argument issue?”
  1. Gilbert CatiponJul 18, 2017

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.