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

Re: [BUG] "git --literal-pathspecs blame" broken in master

From
Duy Nguyen <pclouds@gmail.com>
Date
Oct 25, 2013, 04:11 UTC
Message-ID
<CACsJy8AYS8VLuuZ_4rVvrG8SV_aq8dtNa0TqfcjEmow05RSP_A@mail.gmail.com>
In-Reply-To
<20131025034947.GA4959@sigill.intra.peff.net>
On Fri, Oct 25, 2013 at 10:49 AM, Jeff King <peff@peff.net> wrote:
Show 6 quoted lines
>   $ git --literal-pathspecs blame ':(foo)bar'
>   fatal: :(foo)bar: pathspec magic not supported by this command: 'literal'
>
> The first one remains good, but the second one is still broken. I
> haven't dug further yet, but I thought it might be a bit more obvious to
> you.

I checked it too strict. Something like this should fix it. I'll post a patch with tests later

diff --git a/pathspec.c b/pathspec.c
index ad1a9f5..69e4fdb 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -405,7 +405,7 @@ void parse_pathspec(struct pathspec *pathspec,
                item[i].magic = prefix_pathspec(item + i, &short_magic,
                                                argv + i, flags,
                                                prefix, prefixlen, entry);
-               if (item[i].magic & magic_mask)
+               if (item[i].magic & (magic_mask & ~PATHSPEC_LITERAL))
                        unsupported_magic(entry,
                                          item[i].magic & magic_mask,
                                          short_magic);
-- 
Duy
Previous: Jeff KingNext: Nguyễn Thái Ngọc Duy
Message 5 of 8 in “[BUG] "git --literal-pathspecs blame" broken in master”
  1. Jeff KingOct 25, 2013
  2. Jeff KingOct 25, 2013
  3. Duy NguyenOct 25, 2013
  4. Jeff KingOct 25, 2013
  5. Duy NguyenOct 25, 2013
  6. pathspec: stop --*-pathspecs impact on internal parse_pathspec() usesNguyễn Thái Ngọc Duy, Oct 26, 2013
  7. Jeff KingOct 26, 2013
  8. pathspec: stop --*-pathspecs impact on internal parse_pathspec() usesNguyễn Thái Ngọc Duy, Oct 26, 2013

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.