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

reversion in GIT_COMMON_DIR refs path

From
Joey Hess <id@joeyh.name>
Date
May 16, 2017, 17:10 UTC
Message-ID
<20170516171028.5eagqr2sw5a2i77d@kitenet.net>

Bisecting this test suite failure https://git-annex.branchable.com/git-annex_in_nixpkgs_fails_with_git-2.13.0/ I landed on commit f57f37e2e1bf11ab4cdfd221ad47e961ba9353a0 to git.

It seems that changed resolving refs paths when GIT_DIR and GIT_COMMON_DIR are both set. While before refs were looked for in GIT_COMMON_DIR, now they're not.

Test case:

#!/bin/sh set -e set -x rm -rf testdir git init testdir cd testdir echo 1 > foo git add foo git commit -m add mkdir dummy mkdir dummy/overlay cp .git/index .git/HEAD dummy/overlay #cp .git/refs .git/packed-refs dummy/overlay -a cd dummy export GIT_COMMON_DIR=`pwd`/../.git export GIT_DIR=`pwd`/overlay git rev-parse --git-path refs/heads/master git show refs/heads/master

This script succeeds with git 2.11.0, but with 2.13.0, it fails:
fatal: ambiguous argument 'refs/heads/master': unknown revision or path not in the working tree.

It seems to be failing to look up refs in GIT_COMMON_DIR. Note that uncommenting the commented out line in the script, to copy the refs into GIT_DIR, makes it succeed.

git rev-parse --git-path refs/heads/master shows the GIT_COMMON_DIR/refs path still (as gitrepository-layout documents). So this reversion made different parts of git disagreeing about the refs path.

Next: Ævar Arnfjörð Bjarmason
Message 1 of 14 in “reversion in GIT_COMMON_DIR refs path”
  1. Joey HessMay 16, 2017
  2. Ævar Arnfjörð BjarmasonMay 16, 2017
  3. Joey HessMay 16, 2017
  4. tests: add an optional test to test git-annexÆvar Arnfjörð Bjarmason, May 16, 2017
  5. Joey HessMay 16, 2017
  6. Junio C HamanoMay 17, 2017
  7. Ævar Arnfjörð BjarmasonMay 17, 2017
  8. Junio C HamanoMay 17, 2017
  9. Ævar Arnfjörð BjarmasonMay 17, 2017
  10. Stefan BellerMay 17, 2017
  11. Brandon WilliamsMay 17, 2017
  12. Brandon WilliamsMay 17, 2017
  13. Joey HessMay 19, 2017
  14. Duy NguyenMay 22, 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.