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

Re: Unexpected (bug-like) behavior in `git ls-remote` matching.

From
Philip Oakley <philipoakley@iee.email>
Date
Feb 8, 2023, 14:51 UTC
Message-ID
<1e073897-162d-e1e6-bab2-b424b21e1015@iee.email>
In-Reply-To
<CALJHx12DetwZ=+aMEG6Ss4P3fMTeLN2styXuPw93C5N6yg98NA@mail.gmail.com>
On 08/02/2023 13:49, William Blevins wrote:
> This still feels "weird" to me. Other pattern matching tools like grep
> and sed don't have exceptions to their behavior like this.
>
> Can you reference the unit tests that verifies this specific behavior?

As someone who also trips up over the *nix command line, Is this a bash (glob) expansion issue? So there is a two step 'expansion', first by bash, and then by git's pattern match. Even plain text could be "expanded" if there's a suitable expansion

a quick search suggested https://superuser.com/questions/861077/is-it-possible-to-print-out-the-shell-expansion which has some tipe I wasn't aware of.

Philip
Show 17 quoted lines
>
> On Wed, Feb 8, 2023 at 2:20 AM Junio C Hamano <gitster@pobox.com> wrote:
>> William Blevins <wblevins001@gmail.com> writes:
>>
>>> What is totally unexpected.... is the most simple search for ABC-1...
>>> ```
>>> $ git ls-remote --heads git@github.com:owner/repo.git ABC-1
>>> <ref>    refs/head/ABC-1
>>> <ref>    refs/head/feature/ABC-1
>>> ```
>> Sorry, but I cannot see what is surprising about the above.  If you
>> have these branches locally, you should also see these refs in the
>> output of "git show-ref ABC-1".  Refname hierarchies work just like
>> pathnames with directories, and without glob in the pattern, tail
>> matching that honors path component boundary is very much the norm
>> in the oldest part of Git, i.e. ABC-1 matches refs/heads/ABC-1 but
>> not refs/heads/XABC-1.
Previous: William BlevinsNext: Jeff King
Message 4 of 16 in “Unexpected (bug-like) behavior in `git ls-remote` matching.”
  1. William BlevinsFeb 7, 2023
  2. Junio C HamanoFeb 8, 2023
  3. William BlevinsFeb 8, 2023
  4. Philip OakleyFeb 8, 2023
  5. Jeff KingFeb 8, 2023
  6. Jeff KingFeb 8, 2023
  7. Junio C HamanoFeb 8, 2023
  8. Junio C HamanoFeb 8, 2023
  9. Jeff KingFeb 9, 2023
  10. Junio C HamanoFeb 9, 2023
  11. Jeff KingFeb 11, 2023
  12. 1/2 doc/ls-remote: cosmetic cleanups for examplesJeff King, Feb 11, 2023
  13. 2/2 doc/ls-remote: clarify pattern formatJeff King, Feb 11, 2023
  14. Junio C HamanoFeb 11, 2023
  15. 2/2 doc/ls-remote: clarify pattern formatJeff King, Feb 11, 2023
  16. Ævar Arnfjörð BjarmasonFeb 8, 2023

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.