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

Wrong option -h in grep, ls-remote, and show-ref.

From
IGIgnacy Gawedzki <ignacy.gawedzki@green-communications.fr>
Date
Sep 24, 2021, 14:19 UTC
Message-ID
<20210924141920.ezfpyf4uutob2h5z@zenon.in.qult.net>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
git ls-remote -h
What did you expect to happen? (Expected behavior)
The same as git ls-remote --heads.
What happened instead? (Actual behavior)
Displayed the git ls-remote usage.
What's different between what you expected and what actually happened?

The usage indicates -h is the same as --heads, while -h is handled upstream and always displays the usage of the command.

Anything else you want to add:
The same problem exists with the following commands:
  grep -h is supposed to not show filenames according to its usage string.
  show-ref -h is defined as some hidden option equivalent to --head.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.30.2 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.11.0-31-lowlatency #33-Ubuntu SMP PREEMPT Wed Aug 11 14:21:21 UTC 2021 x86_64 compiler info: gnuc: 10.2 libc info: glibc: 2.33 $SHELL (typically, interactive shell): /bin/zsh

[Enabled Hooks] not run from a git repository - no hooks to show

Next: Ævar Arnfjörð Bjarmason
Message 1 of 12 in “Wrong option -h in grep, ls-remote, and show-ref.”
  1. Ignacy GawedzkiSep 24, 2021
  2. 0/3 show-ref, ls-remote, grep: fix -h handlingÆvar Arnfjörð Bjarmason, Sep 24, 2021
  3. 1/3 show-ref: remove unused custom handling of -hÆvar Arnfjörð Bjarmason, Sep 24, 2021
  4. Junio C HamanoSep 24, 2021
  5. René ScharfeSep 24, 2021
  6. Junio C HamanoSep 24, 2021
  7. 2/3 ls-remote: remove documentation for custom -h optionÆvar Arnfjörð Bjarmason, Sep 24, 2021
  8. SZEDER GáborSep 24, 2021
  9. Jeff KingSep 24, 2021
  10. Junio C HamanoSep 24, 2021
  11. 3/3 grep: pass PARSE_OPT_NO_INTERNAL_HELP, fix odd -h handlingÆvar Arnfjörð Bjarmason, Sep 24, 2021
  12. Junio C HamanoSep 24, 2021

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.