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

Weird problem with long $PATH and alternates (bisected)

From
MMMikael Magnusson <mikachu@gmail.com>
Date
Oct 26, 2008, 14:46 UTC
Message-ID
<237967ef0810260746w10e930c1sf36a2674f49afbe1@mail.gmail.com>

% mkdir 1; cd 1 % echo > a; git add a; git commit -m a % cd .. % git clone -s 1 2 % git push . master:master fatal: Could not switch to '/tmp/a/1/.git/objects/n:/usr/games/bin:/usr/local/ipod-chain' fatal: The remote end hung up unexpectedly % PATH=/bin:/usr/bin git push . master:master Everything up-to-date

The same thing happens if i try to push from 1 to 2: % cd ../1 % git push ../2 fatal: Could not switch to '/tmp/a/1/.git/objects/n:/usr/games/bin:/usr/local/ipod-chain' fatal: The remote end hung up unexpectedly

% echo $#PATH 196 % echo $PATH /home/mikaelh/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/i686-pc-linux-gnu/gcc-bin/4.2.4:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin:/usr/local/ipod-chain/bin

d79796bcf05b89774671a75b3285000c43129823 is first bad commit
commit d79796bcf05b89774671a75b3285000c43129823
Author: Junio C Hamano <gitster@pobox.com>
Date:   Tue Sep 9 01:27:10 2008 -0700
    push: receiver end advertises refs from alternate repositories
    Earlier, when pushing into a repository that borrows from alternate object
    stores, we followed the longstanding design decision not to trust refs in
    the alternate repository that houses the object store we are borrowing
    from.  If your public repository is borrowing from Linus's public
    repository, you pushed into it long time ago, and now when you try to push
    your updated history that is in sync with more recent history from Linus,
    you will end up sending not just your own development, but also the
    changes you acquired through Linus's tree, even though the objects needed
    for the latter already exists at the receiving end.  This is because the
    receiving end does not advertise that the objects only reachable from the
    borrowed repository (i.e. Linus's) are already available there.
    This solves the issue by making the receiving end advertise refs from
    borrowed repositories.  They are not sent with their true names but with a
    phoney name ".have" to make sure that the old senders will safely ignore
    them (otherwise, the old senders will misbehave, trying to push matching
    refs, and mirror push that deletes refs that only exist at the receiving
    end).
    Signed-off-by: Junio C Hamano <gitster@pobox.com>

:100644 100644 6d6027ead17b86519d69c3dfc9b98c01e916d277 45e3cd90fd476cdb0a32e5de27739b18e060e031 Mbuiltin-receive-pack.c :100644 100644 98a742122dbacbb39fa104cdfe909a9a884ed7b6 99af83a0479ef472078afcd288b1f6ba6283a2f0 Mcache.h :100644 100644 ae550e89c0942bb9e34b252b653c40e869a074a4 12be17b5dace07a2ca71613e4e9093cdb77492ac Msha1_file.c

-- 
Mikael Magnusson
Next: Junio C Hamano
Message 1 of 7 in “Weird problem with long $PATH and alternates (bisected)”
  1. Mikael MagnussonOct 26, 2008
  2. Junio C HamanoOct 26, 2008
  3. Mikael MagnussonOct 26, 2008
  4. René ScharfeOct 26, 2008
  5. Junio C HamanoOct 26, 2008
  6. Mikael MagnussonOct 26, 2008
  7. Junio C HamanoOct 27, 2008

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.