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

[BUG] :(attr) pathspecs can die("BUG") in the tree-walker

From
Jeff King <peff@peff.net>
Date
May 9, 2017, 22:24 UTC
Message-ID
<20170509222432.3dxt7osjt2zjtaiw@sigill.intra.peff.net>

I was playing with the new :(attr) pathspecs in the upcoming v2.13 today, and noticed:

  $ git ls-files -- ':(attr:-diff)'
  t/t0110/url-1
  t/t0110/url-10
  [etc]
So far so good.
  $ git ls-tree HEAD -- ':(attr:-diff)'
  fatal: :(attr:-diff): pathspec magic not supported by this command: 'attr'

Bummer, but I understand that sometimes the options need to be plumbed through to work everywhere.

  $ git log HEAD -- ':(attr:-diff)'
  fatal: BUG:tree-walk.c:947: unsupported magic 40

Whoops. This is presumably ls-tree is protected, but I think we are missing a GUARD_PATHSPEC call somewhere.

This isn't a huge deal, as the correct behavior is probably to die like ls-tree does, but we probably shouldn't be hitting BUG assertions as a general rule.

-Peff
Next: Brandon Williams
Message 1 of 3 in “[BUG] :(attr) pathspecs can die("BUG") in the tree-walker”
  1. Jeff KingMay 9, 2017
  2. Brandon WilliamsMay 9, 2017
  3. Jeff KingMay 10, 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.