git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] checkout-index needs a working tree

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 5, 2007, 01:33 UTC
Message-ID
<Pine.LNX.4.64.0708050229200.14781@racer.site>
In-Reply-To
<7vvebuj4nw.fsf@assigned-by-dhcp.cox.net>
Hi,
On Sat, 4 Aug 2007, Junio C Hamano wrote:
> I wonder if it would help us to catch similar breakages if we change 
> git.c::run_command() so that we do not pass prefix (or pass a bogus 
> pointer ((const char *)1)) for commands that do not ask for 
> NEED_WORK_TREE.

I tried that, but we have some places where we ask "if (prefix && *prefix)", for example in ls-tree. It does not _require_ a work tree, but it certainly uses it when it is available -- which is fine.

Other users are more tricky, such as ls-files and update-index, which need a working tree only in some cases.

I'll probably write a patch on Monday (if nobody else is faster) to provide a function "require_work_tree()" in environment.c, which does the obvious (with caching). Then comes the tedious part: identifying all those options that need a working tree...

Ciao, Dscho

Previous: Junio C HamanoNext: Uwe Kleine-König
Message 3 of 12 in “checkout-index needs a working tree”
  1. checkout-index needs a working treeJohannes Schindelin, Aug 4, 2007
  2. Junio C HamanoAug 4, 2007
  3. Johannes SchindelinAug 5, 2007
  4. Uwe Kleine-KönigAug 9, 2007
  5. Johannes SchindelinAug 10, 2007
  6. Junio C HamanoAug 10, 2007
  7. Johannes SchindelinAug 10, 2007
  8. Reinstate the old behaviour when GIT_DIR is set and GIT_WORK_TREE is unsetJunio C Hamano, Aug 10, 2007
  9. Uwe Kleine-KönigAug 10, 2007
  10. Junio C HamanoAug 10, 2007
  11. Junio C HamanoAug 11, 2007
  12. checkout-index doc: use --work-dir in the export exampleUwe Kleine-König, Aug 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.