# `cat-file --filter` is broken in 2.50?

2 messages from 2025-06-30 to 2025-06-30. Participants: Dan Pristupov, Phillip Wood.
Thread: https://gitlist.dev/t/63713

## Dan Pristupov, 2025-06-30 16:07

Subject: `cat-file --filter` is broken in 2.50?
Message-ID: <6eb10e33-4001-95a7-d2ad-3dd2a5c830ab@fork.dev>
URL: https://gitlist.dev/e/6eb10e33-4001-95a7-d2ad-3dd2a5c830ab%40fork.dev

```
Hi,

`cat-file --filter` stopped working in git 2.50.

ˋˋˋ
$ git version
git version 2.47.1.windows.2

$ git cat-file --filter "HEAD:changelog.md"
<content>
ˋˋˋ

ˋˋˋ
$ git version
git version 2.50.0.windows.1

$ git cat-file --filter "HEAD:changelog.md"
fatal: invalid filter-spec 'HEAD:changelog.md'
ˋˋˋ

The problem was introduced at eb83e4c64b5a3458569593c2ab0c29365f10a82f.

Then it was merged into the main branch by 
a271b05066a1fd2c3a62508d9908d6c5df14a1cb.

This seems like a bug.


```

## Phillip Wood, 2025-06-30 17:06

Subject: Re: `cat-file --filter` is broken in 2.50?
Message-ID: <9b3623a9-b596-44bc-b267-499e568a7f60@gmail.com>
URL: https://gitlist.dev/e/9b3623a9-b596-44bc-b267-499e568a7f60%40gmail.com
In-Reply-To: <6eb10e33-4001-95a7-d2ad-3dd2a5c830ab@fork.dev>

```
Hi Dan

On 30/06/2025 17:07, Dan Pristupov wrote:
> Hi,
> 
> `cat-file --filter` stopped working in git 2.50.

cat-file did not have a "--filter" option before 2.50. The option you 
are looking for is "--filters". As git accepts unambiguous abbreviations 
for long options "--filter" used to match "--filters" but now it is a 
separate option. Being able to use abbreviated option names is useful at 
the command line but they are best avoided in scripts.

Best Wishes

Phillip

> 
> ˋˋˋ
> $ git version
> git version 2.47.1.windows.2
> 
> $ git cat-file --filter "HEAD:changelog.md"
> <content>
> ˋˋˋ
> 
> ˋˋˋ
> $ git version
> git version 2.50.0.windows.1
> 
> $ git cat-file --filter "HEAD:changelog.md"
> fatal: invalid filter-spec 'HEAD:changelog.md'
> ˋˋˋ
> 
> The problem was introduced at eb83e4c64b5a3458569593c2ab0c29365f10a82f.
> 
> Then it was merged into the main branch by 
> a271b05066a1fd2c3a62508d9908d6c5df14a1cb.
> 
> This seems like a bug.
> 
> 


```
