git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Karl Chen <quarl@cs.berkeley.edu>
Subject: Re: Dropping core.worktree and GIT_WORK_TREE support (was Re: limiting relationship of git dir and worktree)
Date: Tue, 26 Aug 2008 20:49:24 -0400	[thread overview]
Message-ID: <20080827004924.GA8204@coredump.intra.peff.net> (raw)
In-Reply-To: <48B3B256.6010609@fastmail.fm>

[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

  reply	other threads:[~2008-08-27  0:50 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22  4:14 [PATCH] Support "core.excludesfile = ~/.gitignore" Karl Chen
2008-08-22 16:58 ` Eric Raible
2008-08-22 17:56   ` Bert Wesarg
2008-08-22 21:10 ` Junio C Hamano
2008-08-24  8:40   ` Karl Chen
2008-08-24 18:11     ` Junio C Hamano
2008-08-24 22:08       ` Jeff King
2008-08-24 22:59         ` Junio C Hamano
2008-08-24 23:13           ` Jeff King
2008-08-24 23:40             ` Junio C Hamano
2008-08-24 23:51               ` limiting relationship of git dir and worktree (was Re: [PATCH] Support "core.excludesfile = ~/.gitignore") Jeff King
2008-08-25  0:30                 ` Dropping core.worktree and GIT_WORK_TREE support (was Re: limiting relationship of git dir and worktree) Junio C Hamano
2008-08-25  2:00                   ` Miklos Vajna
2008-08-25  3:05                     ` Dropping core.worktree and GIT_WORK_TREE support Junio C Hamano
2008-08-25 12:52                       ` Miklos Vajna
2008-08-25 13:52                         ` Nguyen Thai Ngoc Duy
2008-08-25 14:43                           ` [PATCH] git diff/diff-index/diff-files: call setup_work_tree() Miklos Vajna
2008-08-25 14:46                             ` Nguyen Thai Ngoc Duy
2008-08-25 14:50                               ` Miklos Vajna
2008-08-25 15:11                                 ` Miklos Vajna
2008-08-25 15:26                                   ` Nguyen Thai Ngoc Duy
2008-08-26 23:58                                     ` Junio C Hamano
2008-08-28 13:02                                       ` [PATCH] diff*: fix worktree setup Nguyễn Thái Ngọc Duy
2008-08-25 21:21                         ` Dropping core.worktree and GIT_WORK_TREE support Junio C Hamano
2008-08-25 21:37                           ` Miklos Vajna
2008-08-26  7:35                   ` Dropping core.worktree and GIT_WORK_TREE support (was Re: limiting relationship of git dir and worktree) Michael J Gruber
2008-08-27  0:49                     ` Jeff King [this message]
2008-08-25 19:07               ` [PATCH v2] Support "core.excludesfile = ~/.gitignore" Karl Chen
2008-08-26  6:42                 ` Johannes Sixt
2008-08-27  0:25                 ` Jeff King
2008-08-27  3:12                   ` Karl Chen
2008-08-27  5:01                     ` Junio C Hamano
2008-08-28  9:09                       ` [PATCH v3] Expand ~ and ~user in core.excludesfile, commit.template Karl Chen
2008-08-29  3:26                         ` Jeff King
2008-08-29  4:08                           ` Junio C Hamano
2008-08-29  9:29                             ` [PATCH v4] " Karl Chen
2008-08-29 16:08                               ` Junio C Hamano
2008-08-29 19:01                                 ` Karl Chen
2008-08-29 19:28                                   ` Junio C Hamano
2008-08-29 22:34                                     ` Karl Chen
2008-08-30  5:31                                       ` Junio C Hamano
2008-08-30  6:02                               ` Jeff King
2008-08-29  7:00                         ` [PATCH v3] " Johannes Sixt
2008-08-27  3:18                   ` [PATCH v2] Support "core.excludesfile = ~/.gitignore" Karl Chen
2008-08-27  4:50                     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080827004924.GA8204@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=michaeljgruber+gmane@fastmail.fm \
    --cc=quarl@cs.berkeley.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).