git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Paul Drews <paul.drews@intel.com>
Cc: git@vger.kernel.org
Subject: Re: rebase not honoring core.worktree pointing elsewhere
Date: Tue, 2 Nov 2010 07:11:16 +0700	[thread overview]
Message-ID: <AANLkTi=ejRcnz+83zc2Z-6etUGMsBSw1FFUY0JNFRFGB@mail.gmail.com> (raw)
In-Reply-To: <loom.20101101T182113-378@post.gmane.org>

On Tue, Nov 2, 2010 at 12:22 AM, Paul Drews <paul.drews@intel.com> wrote:
> Hello,
>
> I'm observing an unexpected error from "git rebase" run from the directory
> containing the ".git" directory:
>
> $ git --version
>
> git version 1.7.3.GIT
> (includes up to commit ca2090 from git repository at
> http://www.kernel.org/pub/scm/git/git.git)
>
> $ mkdir wherefilesare
> $ mkdir wheregitis
> $ cd wherefilesare
> $ echo "Here is a line from the original" > myfile.txt
> $ cd ../wheregitis
> $ git init
> $ git config core.worktree /absolute/path/to/wherefilesare/
> $ git add .
> $ git commit
> $ git branch mybranch
> $ git checkout mybranch
> $ vim ../wherefilesare/myfile.txt
> $ git add .
> $ git commit
> $ git checkout master
> $ vim ../wherefilesare/myfile.txt
> $ git add .
> $ git commit
> $ git checkout mybranch
> $ git rebase master
>
> fatal: /usr/libexec/git-core/git-rebase cannot be used without a working tree.
>
> Since I'm in the directory containing ".git" at this point, the ".git" directory
> and the worktree can be unambiguously found.  Other commands besides "git
> rebase" work.  I would expect "git rebase" to work as well.  Is this a bug or an
> unreasonable expectation on my part?

First of all, core.worktree should not matter because GIT_DIR has not
been set (No don't trust core.worktree documentation, it's equivalent
to --work-tree in "man git"). You need to set GIT_DIR (or --git-dir).
That's a bug I'm working on.

Then, yes, rebase should be updated to use worktree even if it's
outside cwd. I'm not sure how to do it properly in git-rebase.sh
though.  The requirement "require_work_tree" can be loosen a bit.
-- 
Duy

  parent reply	other threads:[~2010-11-02  0:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 17:22 rebase not honoring core.worktree pointing elsewhere Paul Drews
2010-11-01 17:38 ` Sverre Rabbelier
2010-11-02  0:11 ` Nguyen Thai Ngoc Duy [this message]
2010-11-02  1:21   ` Junio C Hamano
2010-11-02 16:26   ` Paul Drews
2010-11-03  0:13     ` Nguyen Thai Ngoc Duy
2010-11-03 15:41       ` Paul Drews
2010-11-03 15:52         ` Nguyen Thai Ngoc Duy
2010-11-03 16:13         ` Jonathan Nieder
2010-11-04 14:20           ` Nguyen Thai Ngoc Duy

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='AANLkTi=ejRcnz+83zc2Z-6etUGMsBSw1FFUY0JNFRFGB@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paul.drews@intel.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).