{"thread":{"id":"62058","subject":"`git log FETCH_HEAD` only logs whatever happens to be the first among the fetched refs (instead of all the fetched refs)","startedAt":"2024-09-05T04:26:02Z","lastAt":"2024-09-05T22:17:53Z","messageCount":3,"participants":["Han Jiang","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"502190","messageId":"CANrWfmSMbR+8oGsCzOygBA0sFSmMwUmCy=qQEsa16RWcztYaQA@mail.gmail.com","threadId":"62058","inReplyTo":null,"subject":"`git log FETCH_HEAD` only logs whatever happens to be the first among the fetched refs (instead of all the fetched refs)","fromName":"Han Jiang","fromEmail":"jhcarl0814@gmail.com","sentAt":"2024-09-05T04:25:50Z","receivedAt":"2024-09-05T04:26:02Z","isPatch":false,"sender":{"key":"jhcarl0814@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5171262?v=4"},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\ncd '/'; cd '/'; rm --force --recursive -- './test_git2'; mkdir \"$_\"; cd \"$_\";\nmkdir --parents -- './server' './client';\n\ngit -C './server' init --bare './repo.git'\nbranch_default_path=\"$(git -C './server/repo.git' symbolic-ref HEAD)\"\nbranch_default_name=\"${branch_default_path#'refs/heads/'}\"\ngit --git-dir='./server/repo.git' --work-tree='.' commit --allow-empty\n-m \"$((++number))\"\ngit --git-dir='./server/repo.git' --work-tree='.' checkout -b branch1\n\ngit -C './client' init './repo'\n\ngit --git-dir='./server/repo.git' --work-tree='.' commit --allow-empty\n-m \"$((++number))\"\ngit -C './client/repo' fetch 'file://'\"$(realpath\n'./server/repo.git')\" \"$branch_default_name\" 'branch1'\ncat './client/repo/.git/FETCH_HEAD'\ngit -C './client/repo' log --all\ngit -C './client/repo' log --all FETCH_HEAD\nawk 'BEGIN { ORS = \"\\0\"; } { print $1; }'\n<'./client/repo/.git/FETCH_HEAD' | xargs --null git -C './client/repo'\nlog --all\n\ngit --git-dir='./server/repo.git' --work-tree='.' commit --allow-empty\n-m \"$((++number))\"\ngit -C './client/repo' fetch 'file://'\"$(realpath\n'./server/repo.git')\" 'branch1' \"$branch_default_name\"\ncat './client/repo/.git/FETCH_HEAD'\ngit -C './client/repo' log --all\ngit -C './client/repo' log --all FETCH_HEAD\nawk 'BEGIN { ORS = \"\\0\"; } { print $1; }'\n<'./client/repo/.git/FETCH_HEAD' | xargs --null git -C './client/repo'\nlog --all\n\nWhat did you expect to happen? (Expected behavior)\n\n`git -C './client/repo' log --all FETCH_HEAD` logs all commits.\n\nWhat happened instead? (Actual behavior)\n\n`git -C './client/repo' log --all FETCH_HEAD` logs $GIT_DEFAULT_BRANCH\nwhen $GIT_DEFAULT_BRANCH is listed first in `git fetch`, logs branch1\nwhen branch1 is listed first in `git fetch`.\n\nWhat's different between what you expected and what actually happened?\n\nAnything else you want to add:\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.46.0.windows.1\ncpu: x86_64\nbuilt from commit: 2e6a859ffc0471f60f79c1256f766042b0d5d17d\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: D:/git-sdk-64-build-installers/usr/bin/sh\nfeature: fsmonitor--daemon\nlibcurl: 8.9.0\nOpenSSL: OpenSSL 3.2.2 4 Jun 2024\nzlib: 1.3.1\nuname: Windows 10.0 22631\ncompiler info: gnuc: 14.1\nlibc info: no libc information available\n$SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n"},{"id":"502243","messageId":"xmqqplpi5em7.fsf@gitster.g","threadId":"62058","inReplyTo":"CANrWfmSMbR+8oGsCzOygBA0sFSmMwUmCy=qQEsa16RWcztYaQA@mail.gmail.com","subject":"Re: `git log FETCH_HEAD` only logs whatever happens to be the first among the fetched refs (instead of all the fetched refs)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-09-05T15:01:20Z","receivedAt":"2024-09-05T15:01:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is totally expected.  FETCH_HEAD is only special to \"git\nmerge\".  When FETCH_HEAD is used as if it were a ref, everybody else\nuses only the first entry.\n\n"},{"id":"502293","messageId":"CANrWfmRmELO3ZxOZs2i5LvekK+fe3N2zfMebJosmzvkkdrG+AQ@mail.gmail.com","threadId":"62058","inReplyTo":"xmqqplpi5em7.fsf@gitster.g","subject":"Re: `git log FETCH_HEAD` only logs whatever happens to be the first among the fetched refs (instead of all the fetched refs)","fromName":"Han Jiang","fromEmail":"jhcarl0814@gmail.com","sentAt":"2024-09-05T22:17:39Z","receivedAt":"2024-09-05T22:17:53Z","isPatch":false,"sender":{"key":"jhcarl0814@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5171262?v=4"},"body":"Got it, Thanks! I clearly remembered that \"using first line\" stuff was\nmentioned in the documentation/progit, but can only find the `git\nmerge` part now. False memory😰.\n\nOn Fri, Sep 6, 2024 at 3:01 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> This is totally expected.  FETCH_HEAD is only special to \"git\n> merge\".  When FETCH_HEAD is used as if it were a ref, everybody else\n> uses only the first entry.\n>\n"}]}