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

Bug: diff --no-index with cachetextconv crashes

From
PDPaweł Dominiak <dominiak.pawel@gmail.com>
Date
Feb 26, 2024, 07:03 UTC
Message-ID
<CACeVQwQ4MELjB8nZyeu9QDTtgwhhw0oOsL8BHdm_rxTj1vMy+A@mail.gmail.com>
Hey!

That's my first bug report for git and my first email to a mailing list in general, I hope for understanding :)

[Steps to reproduce your issue]
Global .gitattributes:
*.txt diff=test
Global .gitconfig:
[diff "test"]
    textconv = cat
    cachetextconv = true
Called command:
git --no-pager diff --no-index foo.txt bar.txt
[Expected behavior]
diff --git a/foo.txt b/bar.txt
index f6a4b70..2b24d27 100644
--- a/foo.txt
+++ b/bar.txt
@@ -1 +1 @@
-Foo bar baz
+Foo bar qux

[Actual behavior]

BUG: refs.c:2095: attempting to get main_ref_store outside of repository

The command works as expected if cachetextconv is disabled:

git --no-pager -c diff.test.cachetextconv=false diff --no-index foo.txt bar.txt

[System Info]
git version 2.44.0.windows.1
cpu: x86_64
built from commit: ad0bbfffa543db6979717be96df630d3e5741331
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19045
compiler info: gnuc: 13.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

[Enabled Hooks]
not run from a git repository - no hooks to show

Pawel
Next: Jeff King
Message 1 of 5 in “Bug: diff --no-index with cachetextconv crashes”
  1. Paweł DominiakFeb 26, 2024
  2. Jeff KingFeb 26, 2024
  3. Paweł DominiakFeb 26, 2024
  4. userdiff: skip textconv caching when not in a repositoryJeff King, Feb 26, 2024
  5. Junio C HamanoFeb 26, 2024

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.