From: Junio C Hamano <hidden> Date: 2016-06-15 22:45:13
Jeff King [off-list ref] writes:
On Sun, Aug 24, 2008 at 04:40:21PM -0700, Junio C Hamano wrote:
quoted
Judging from the occasional "I tried core.worktree but it does not work in
this and that situations" I see here and on #git, my impression is that
new people try it, saying "git is cool -- unlike cvs that sprinkles those
ugly CVS directories all over the place, it only contaminates my work tree
with a single directory '.git' and nothing else. Ah, wait --- what's this
core.worktree thing? Can I get rid of that last one as well? That sounds
even cooler".
IOW, I do not think it is really _needed_ per-se as a feature, but it was
done because it was thought to be doable, which unfortunately turned out
to involve hair-pulling complexity that the two attempts that led to the
current code still haven't resolved.
I really wish we do not have to worry about that anymore.
Well, as a non-user of this feature, I certainly have no argument
against taking it out. Maybe the subject line will pull some other
people into the discussion.
Heh, if we are to do the attention-getter, let's do so more strongly ;-)
On Sun, Aug 24, 2008 at 05:30:54PM -0700, Junio C Hamano [off-list ref] wrote:
Heh, if we are to do the attention-getter, let's do so more strongly ;-)
Does this include removing of --work-tree as well?
The git backend of Pootle (http://translate.sourceforge.net/wiki/) uses
it.
Also, here is a question:
$ git --git-dir git/.git --work-tree git diff --stat|tail -n 1
1443 files changed, 0 insertions(+), 299668 deletions(-)
So, it's like it thinks every file is removed.
But then:
$ cd git
$ git diff --stat|wc -l
0
is this a bug, or a user error?
Thanks.
From: Michael J Gruber <hidden> Date: 2016-06-15 22:45:13
Junio C Hamano venit, vidit, dixit 25.08.2008 02:30:
Jeff King [off-list ref] writes:
quoted
Well, as a non-user of this feature, I certainly have no argument
against taking it out. Maybe the subject line will pull some other
people into the discussion.
Heh, if we are to do the attention-getter, let's do so more strongly ;-)
Sorry for being late to the discussion.
I think there are many use cases or environments which differ
substantially from those of the "typical" developer; this implies that
they differ from those of the typical git contributor, which naturally
leads to a certain bias in discussions like this one.
"Typical" developers track source code in the proper sense (somewhere in
$HOME); on local file systems; mostly on machines where they have root
access, or least can get extra accounts (for gitosis) or a port for "git
daemon" etc; they collaborate with peers for whom basically the same
assumptions apply.
Now think of a user say in academics, who tracks "source code" for
scientific papers (somewhere in $HOME) but also needs to track, e.g.,
central web pages or other "sources" where he has partial write access
but can't have ".git" in place (and shouldn't change ownership &
permissions), but needs to be aware of changes and log own changes; on
NFS; no extra accounts but in need of an authenticated protocol (papers
in progress are private, public only when published); who collaborates
with peers for whom the same assumptions apply, except most certainly
for git usage...
Yes, that's me, but also many others, I would think and hope, at least
increasingly so. That second scenario is one where I have to cope with
how things are set up centrally, making the best possible use of git.
I would imagine that many corporate environments are basically similar,
if individual employees want to use git without central support.
These remarks apply to the discussion about an authenticated protocol
(some way for secure, private pull&push for users with access to $HOME
and maybe cgi-bins), but also here:
I need to keep .git away from the work tree for several projects. Using
--git-dir etc. leads to problems with some commands, especially
git{k,-gui,-citool}. I found the most robust solution to be an alias
(shell) which guesses the work tree (from core.worktree etc.) and cd's
there before doing anything. This also solves the problems with diff.
I would strongly advocate for keeping the possibility of separating
git-dir and work-tree, and possibly dropping the assumption that
everything "foo.git" is a bare repo. There are config variables for
this. The Tcl/Tk family I mentioned makes even stronger assumptions. I
promise to have a look at these when I find time (oh yeah...).
Michael
From: Jeff King <hidden> Date: 2016-06-15 22:45:14
[resend: urgh, I somehow missed the git-list when replying, so it is
cc'd here]
On Tue, Aug 26, 2008 at 09:35:50AM +0200, Michael J Gruber wrote:
"Typical" developers track source code in the proper sense (somewhere in
$HOME); on local file systems; mostly on machines where they have root
access, or least can get extra accounts (for gitosis) or a port for "git
daemon" etc; they collaborate with peers for whom basically the same
assumptions apply.
Now think of a user say in academics, who tracks "source code" for
scientific papers (somewhere in $HOME) but also needs to track, e.g.,
central web pages or other "sources" where he has partial write access
but can't have ".git" in place (and shouldn't change ownership &
Actually, I do all of those things, and I don't use the work-tree config
variable or command line options at all. :)
I think the general advice with things like web access is "don't just
dump your git stuff into a production area; instead, build and/or
install from your git work tree into your production area". Because
things like merges _can_ leave your files in a broken state.
But I do recognize that there are some special circumstances where that
isn't possible, and you are willing to accept the tradeoff. E.g., if the
checkout is extremely large and you can't afford another copy, if you
have clueless collaborators who can't understand a build procedure.
And even though I expect those cases to be the exception, it seems a
shame for git not to support split git-dir/work-tree setups because we
really are 99% there. This code has been the source of a number of
problems.
I think what is really needed is somebody to look carefully at the git
startup sequence and figure out a sane set of rules for the order of:
- looking at env variables
- looking at config
- figuring out GIT_DIR and GIT_WORK_TREE
- chdir'ing to top level of work tree if necessary
Because we obviously have some corner cases where very confusing things
are happening.
This is on my long term todo list, but my git time is very short at
least for the next few months. I think it would be great if somebody
else wanted to take the lead on this, and I would be happy to give
pointers about some of the corner cases we have already seen.
-Peff