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

Re: [Bug] git pull doesn't recognize --work-tree parameter

From
Jeff King <peff@peff.net>
Date
Oct 13, 2011, 19:44 UTC
Message-ID
<20111013194432.GA20082@sigill.intra.peff.net>
In-Reply-To
<20111013191457.GA18460@sigill.intra.peff.net>
On Thu, Oct 13, 2011 at 03:14:57PM -0400, Jeff King wrote:
Show 23 quoted lines
> On Thu, Oct 13, 2011 at 12:06:46PM -0700, Junio C Hamano wrote:
> 
> > It is not as simple as that I am afraid. We could introduce cd_to_top with
> > the new semantics and use it in pull and rebase, but a case that would
> > break is for a script (let's call that hypothetical operation "git svn
> > dcommit", even though I do not know if dcommit uses the real working tree
> > or a temporary one) that prepares a temporary working tree inside .git/svn/
> > and run "git rebase" there without setting GIT_WORKING_TREE to point at
> > the temporary directory.
> 
> I didn't think that could happen now, because you would not be in the
> working tree, and therefore require_work_tree would fail. E.g., with
> current git I get:
> 
>   $ mkdir .git/tmp
>   $ cd .git/tmp
>   $ git rebase
>   fatal: fatal: /home/peff/local/git/private/libexec/git-core/git-rebase
>   cannot be used without a working tree.
> 
> So that case is already broken. The only change this would make is that
> what used to fail would not actually take them to the top-level of the
> working tree[1].
Ugh. It does work if you do:
  mkdir .git/tmp
  cd .git/tmp
  GIT_DIR=$PWD/.. git rebase
What a god-awful mess our initialization rules are.
-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 8 of 10 in “[Bug] git pull doesn't recognize --work-tree parameter”
  1. Kirill LikhodedovOct 13, 2011
  2. Nguyen Thai Ngoc DuyOct 13, 2011
  3. Jeff KingOct 13, 2011
  4. Junio C HamanoOct 13, 2011
  5. Jeff KingOct 13, 2011
  6. Junio C HamanoOct 13, 2011
  7. Jeff KingOct 13, 2011
  8. Jeff KingOct 13, 2011
  9. Junio C HamanoOct 18, 2011
  10. Junio C HamanoOct 13, 2011

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.