git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel Graña" <dangra@gmail.com>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org,
	Richard Hartmann <richih.mailinglist@gmail.com>
Subject: Re: [PATCH] Solve git-submodule issues with detached work trees
Date: Mon, 23 Jul 2012 15:22:57 -0300	[thread overview]
Message-ID: <CAHCkQtOCrCaF01fu-LS5jaTbiD7mxmWu0Mi5Dh1YCvcjdUkqLg@mail.gmail.com> (raw)
In-Reply-To: <500D8C30.9010807@web.de>

On Mon, Jul 23, 2012 at 2:38 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
> Am 23.07.2012 07:09, schrieb Junio C Hamano:
>> Daniel Graña <dangra@gmail.com> writes:
>>
>>> A common way to track dotfiles with git is using GIT_DIR and
>>> GIT_WORK_TREE to move repository out of ~/.git with something like:
>>>
>>>     git init --bare ~/.dotfiles
>>>     alias dotfiles="GIT_DIR=~/.dotfiles GIT_WORK_TREE=~ git"
>>>
>>>     dotfiles add ~/.bashrc
>>>     dotfiles commit -a -m "add my bashrc"
>>>     ...
>>>
>>> but git-submodule complains when trying to add submodules:
>>>
>>>     dotfiles submodule add http://path.to/submodule
>>>     fatal: working tree '/home/user' already exists.
>>>
>>>     git --git-dir ~/.dotfiles submodule add http://path.to/submodule
>>>     fatal: /usr/lib/git-core/git-submodule cannot be used without a
>>> working tree.
>>>
>>> Signed-off-by: Daniel Graña <dangra@gmail.com>
>>> ---
>>
>> I think this is in line with what we discussed earlier on list when
>> the interaction between GIT_DIR/GIT_WORK_TREE and submodules came up
>> the last time.  Jens?
>
> Yes, I think this is the only way submodules in current git can
> be used with the GIT_DIR and GIT_WORK_TREE environment variables:
> set them when adding or initializing the submodule and always use
> the same settings when accessing them later. Daniel's dotfile
> alias achieves exactly that, so his fix looks good. But I agree
> the tests should be improved as you already pointed out.

Hi Jens, Junio.

Thanks for reviewing the patch, glad to hear this is acceptable way to
fix my itch.

I will work soon on getting the test cases improved and the patch
submitted without line wrapping.

thanks again,
Daniel.

  parent reply	other threads:[~2012-07-23 18:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-22 14:49 [PATCH] Solve git-submodule issues with detached work trees Daniel Graña
2012-07-23  5:09 ` Junio C Hamano
2012-07-23 17:38   ` Jens Lehmann
2012-07-23 18:21     ` Junio C Hamano
2012-07-23 20:02       ` Jens Lehmann
2012-07-23 20:34         ` Junio C Hamano
2012-07-23 23:17           ` Jens Lehmann
2012-07-23 23:42             ` Junio C Hamano
2012-07-23 18:22     ` Daniel Graña [this message]
2012-07-23 18:25   ` Richard Hartmann
2012-07-23 18:27     ` Richard Hartmann

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=CAHCkQtOCrCaF01fu-LS5jaTbiD7mxmWu0Mi5Dh1YCvcjdUkqLg@mail.gmail.com \
    --to=dangra@gmail.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=richih.mailinglist@gmail.com \
    /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).