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
Duy Nguyen <pclouds@gmail.com>
Date
Sep 24, 2018, 15:17 UTC
Message-ID
<CACsJy8D_37U+4sb7tb8KqGM=_3CRrTaZX1ZE9VqDVrYJT-AhnA@mail.gmail.com>
In-Reply-To
<90301874969f7b11f33e504500c150a25d722ff8.camel@gmail.com>

On Sun, Sep 23, 2018 at 10:19 PM Kaartic Sivaraam <kaartic.sivaraam@gmail.com> wrote:

Show 26 quoted lines
>
> Hi,
>
> I was actually trying to automae the building and installation of Git
> source code to reduce my burden. I tried to automate it with the help
> of a script that runs daily via cron and a separate worktree used only
> by the build script.y run
>
> The script typically fetches new changes for the next branch by running
> the following in the build worktree (which is not the main worktree):
>
>    $ git fetch origin next
>
> I thought that would result in FETCH_HEAD pointing to the latest
> changes for origin/next if the command succeeded.
>
> Unfortunately, it seems to be behaving weirdely when run in a worktree.
> It sems to be behaving as if I ran 'git fetch origin'. To add to that
> confusion when I run
> ...
>    Why is this weirdness happening when run in other worktrees?
>
>    Why isn't 'git fetch <remote> <branch> not fetching the changes for
>    just the specified branch?
>
>    Am I missing something?

Yes, some bugs. It behaves correctly for me. There must be something strange that triggers this. What's your "git worktree list" (iow anything strange there, duplicate worktrees perhaps)? Also please try "git fetch" again with GIT_TRACE=1 and GIT_TRACE_SETUP=1. Hopefully we could catch something with that.

-- 
Duy
Previous: Kaartic SivaraamNext: Kaartic Sivaraam
Message 2 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.