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

Re: git fetch <remote> <branch> behaves weirdely when run in a worktree

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2018, 21:40 UTC
Message-ID
<xmqqpnx1ntmm.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<fa6d37b850177f7f2ba31c596d5986962eaf7382.camel@gmail.com>
Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes:
Show 12 quoted lines
>>  Also please try
>> "git fetch" again with GIT_TRACE=1 and GIT_TRACE_SETUP=1. Hopefully we
>> could catch something with that.
>
> $ GIT_TRACE_SETUP=1 GIT_TRACE=1 git fetch origin next
> 23:10:26.049785 trace.c:377             setup: git_dir: $COMMON_ROOT/git/.git/worktrees/git-next-build-automate
> ...
> 23:10:28.402815 git.c:415               trace: built-in: git rev-list --objects --stdin --not --all --quiet
> From https://github.com/git/git
>  * branch                  next       -> FETCH_HEAD
> 23:10:28.437350 run-command.c:1553      run_processes_parallel: preparing to run up to 1 tasks
> ...

That looks like fetching only the 'next' branch and nothing else to me.

Perhaps your script is referring to a variable whose assignment is misspelled and invoking

	git fetch $origin $branch

and you are expecting the $branch variable to have string 'next' but due to some bugs it is empty somehow? That explains why sometimes (i.e. when $branch does not get the value you expect it to have) the script fetches everything and some other times (i.e. when $branch does get the right value) the script fetches only the named branch.

Previous: Kaartic SivaraamNext: Kaartic Sivaraam
Message 4 of 12 in “git fetch <remote> <branch> behaves weirdely when run in a worktree”
  1. Kaartic SivaraamSep 23, 2018
  2. Duy NguyenSep 24, 2018
  3. Kaartic SivaraamSep 25, 2018
  4. Junio C HamanoSep 25, 2018
  5. Kaartic SivaraamSep 26, 2018
  6. Kaartic SivaraamSep 26, 2018
  7. Duy NguyenSep 26, 2018
  8. Duy NguyenSep 26, 2018
  9. Junio C HamanoSep 26, 2018
  10. Kaartic SivaraamOct 2, 2018
  11. Kaartic SivaraamOct 4, 2018
  12. Duy NguyenOct 4, 2018

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.