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

git 2.40.1 tree-diff crashes with (glob) magic on pathspecs

From
JPJim Pryor <dubiousjim@gmail.com>
Date
May 27, 2023, 13:53 UTC
Message-ID
<c2b73d05-1214-4e30-bab6-14e0b8d69773@app.fastmail.com>

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)
$ mkdir test2
$ cd test2
$ git init
Initialized empty Git repository in /Users/jim/repo/test2/.git/
$ mkdir -p foo/bar
$ touch foo/bar/test
$ git add foo/bar/test
$ git commit -m "first commit" -u
[master (root-commit) c6eb1c1] first commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo/bar/test
$ git mv foo/bar/test foo/bar/test2
$ git commit -m "second commit" -u
[master 2bacc0c] second commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename foo/bar/{test => test2} (100%)
$ echo "contents" > foo/bar/test2
$ git commit -m "third commit" -a
[master 13a1b11] third commit
 1 file changed, 1 insertion(+)
$ git --no-pager log --oneline -- ':(glob)**/test2'
What did you expect to happen? (Expected behavior)

13a1b11 (HEAD -> master) third commit 2bacc0c second commit c6eb1c1 first commit

What happened instead? (Actual behavior)
13a1b11 (HEAD -> master) third commit
BUG: tree-diff.c:596: unsupported magic 8
error: git died of signal 6
What's different between what you expected and what actually happened?
git tree-diff crashed
Anything else you want to add:
* Also get the crashes with ':(glob)*/bar/test2' and ':(glob)foo/*/test2'.
* The `git mv` does not seem to be necessary to reproduce.

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.40.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 21 21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 x86_64 compiler info: clang: 12.0.0 (clang-1200.0.32.29) libc info: no libc information available $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks]
-- 
dubiousjim@gmail.com
Next: Jeff King
Message 1 of 12 in “git 2.40.1 tree-diff crashes with (glob) magic on pathspecs”
  1. Jim PryorMay 27, 2023
  2. Jeff KingMay 27, 2023
  3. Jim PryorMay 27, 2023
  4. 0/3 handling pathspec magic with --followJeff King, Jun 1, 2023
  5. 1/3 pathspec: factor out magic-to-name functionJeff King, Jun 1, 2023
  6. 2/3 diff: factor out --follow pathspec checkJeff King, Jun 1, 2023
  7. 3/3 diff: detect pathspec magic not supported by --followJeff King, Jun 1, 2023
  8. Junio C HamanoJun 2, 2023
  9. Jeff KingJun 15, 2023
  10. Junio C HamanoJun 15, 2023
  11. Junio C HamanoJun 1, 2023
  12. Jeff KingJun 1, 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.