All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] a tale of Git 2.5, ssh transport and GIT_* environment variables
@ 2015-09-04 10:52 Giuseppe Bilotta
  2015-09-04 12:54 ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2015-09-04 10:52 UTC (permalink / raw)
  To: Git List

Hello all,


I'm going to tell a tale of the oddest bug I've ever come across in
Git and aks for suggestions on how we can improve the user experience
in a sensible way.

I've been stymied for days trying to solve the following issue, which
I came across every time I tried to push to a specific machine when
using git 2.5 (I'm honestly not sure about which version introduced
this, and I haven't runthe necessary bisection due to lack of time,
sorry).

Trying to push any changes with 2.5 resulted in this kind of failure:

user@clientmachine:~/some/git/workdir $ git push
Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 841 bytes | 0 bytes/s, done.
Total 6 (delta 2), reused 0 (delta 0)
fatal: Could not switch to '/home/user/some/git': No such file or directory
error: unpack failed: unpack-objects abnormal exit
fatal: Could not switch to '/home/user/some/git': No such file or directory
To git@remote.machine:remote-repo
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'git@remote.machine:remote-repo'

Notice two things: the messages refer to the worktree updir of the
CLIENT machine, and even though it's _completely not obvious_ due to
the missing 'remote:' lines, the messages actually come from the
SERVER. The lack of indicator lines _alone_ took me hours of debugging
before I finally understood that they were coming from the other side
(yes, I woud say that it's a bug), but after this I was even more
perplexed: why the heck would the SERVER try to switch to the updir of
the CLIENT worktree?

I still couldn't do much on the SERVER to debug due to a variety of
reasons, but I finally had a suspicion: it was almost as if the SERVER
was getting the GIT_DIR information from the CLIENT. And why the heck
would _that_ be the case?

I then remembered that the server was actually configured to AcceptEnv
GIT_* in sshd_config, for reasons related to git identity preservation
despite single login account (please don't ask). Turning the AcceptEnv
to a stricter GIT_AUTHOR* and GIT_COMMITTER* solved the issue.

Now, a couple of questions:

1. since when have git internals started exporting GIT_* variables
related to the git dir and worktree location?
2. is it worth making sure that these don't get propagated via ssh?

Regarding 2., there are actually webpages around suggesting the
AcceptEnv GIT_* trick, and these setups are _all_ going to break with
the latest git, so this is something that might be worth looking into.


-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-09-08 21:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-04 10:52 [RFC] a tale of Git 2.5, ssh transport and GIT_* environment variables Giuseppe Bilotta
2015-09-04 12:54 ` Jeff King
2015-09-04 14:02   ` Giuseppe Bilotta
2015-09-04 14:26     ` Jeff King
2015-09-04 18:18   ` Junio C Hamano
2015-09-04 21:10     ` Giuseppe Bilotta
2015-09-04 21:44     ` Jeff King
2015-09-04 22:40       ` [PATCH] git_connect: clear GIT_* environment for ssh Jeff King
2015-09-05 13:50         ` Giuseppe Bilotta
2015-09-08  8:33           ` [PATCH] git_connect: clarify conn->use_shell flag Jeff King
2015-09-08 17:18             ` Junio C Hamano
2015-09-08 21:40               ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.