From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Yasushi SHOJI <yashi@atmark-techno.com>
Cc: git@vger.kernel.org
Subject: Re: git diff-index with relative git-dir does not work
Date: Thu, 11 Feb 2010 17:35:25 +0700 [thread overview]
Message-ID: <fcaeb9bf1002110235p7fdb50a7we41715b795f76b99@mail.gmail.com> (raw)
In-Reply-To: <87wrymwo5a.wl@dns1.atmark-techno.com>
On Tue, Feb 9, 2010 at 8:10 PM, Yasushi SHOJI > In the diff-index
case, it, indeed, has RUN_SETUP explicitly
> set. however, it does not have NEED_WORK_TREE set. And, this is
> correct in the current semantics because diff-index is a tool to
> compare the index and the object store. it does not need a work tree.
Unless --cached is given, work tree is needed. I'm not saying that
diff-index is bug-free. But the bug you described is not relevant to
this.
> However, diff-index is used in describe which need a work tree if
> --dirty is given. That means that diff-index might be called
> with --work-tree.
Yes. And git-describe calls git-diff-index correctly, i.e. without --cached.
>> > In that case, we must change the setup functions signature to
>> > allow marking "not interested" or something.
>>
>> I'm not sure I get your idea.
>
> Given that in the current form of git, many built-in command is called
> by many other built-in commands. It is hard to predict what is needed
> and what's not. Plus, --git-dir and --work-tree are options to git
> itself not built-in's. So, I thought it might be a good idea to call,
> say, setup_work_tree_with_abs_path(), regardless of NEED_WORK_TREE, to
> explicitly setup run time environment before any other part of the
> code call, say, open_sha1_file.
The thing is not every command expect cwd to be moved to top
directory. In other words, they don't care about the prefix argument
being passed to it. So you would need go go through all commands
before doing that.
By the way, are you working on a patch for the diff-index bug?
--
Duy
prev parent reply other threads:[~2010-02-11 10:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-09 11:05 git diff-index with relative git-dir does not work Yasushi SHOJI
2010-02-09 11:58 ` Nguyen Thai Ngoc Duy
2010-02-09 13:10 ` Yasushi SHOJI
2010-02-11 10:35 ` Nguyen Thai Ngoc Duy [this message]
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=fcaeb9bf1002110235p7fdb50a7we41715b795f76b99@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=yashi@atmark-techno.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).