{"thread":{"id":"56868","subject":"bug or a general misunderstanding","startedAt":"2021-11-10T12:00:50Z","lastAt":"2021-11-16T09:01:17Z","messageCount":7,"participants":["andre_pohlmann@posteo.de","Ævar Arnfjörð Bjarmason","Johannes Schindelin","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"440830","messageId":"0bb0056a59cda294d416762d7f8a9c47@posteo.de","threadId":"56868","inReplyTo":null,"subject":"bug or a general misunderstanding","fromName":"","fromEmail":"andre_pohlmann@posteo.de","sentAt":"2021-11-10T12:00:40Z","receivedAt":"2021-11-10T12:00:50Z","isPatch":false,"sender":{"key":"andre_pohlmann@posteo.de","avatar":null},"body":"Hello there\n\nI'm not sure if I'm in the right place here.\nMaybe it's a bug or a general misunderstanding of how GIT works.\n\nThe following situation: I wanted to create a branch from a commit. From \nthere on the work should be continued.\n\nThe possible bug:\nThe newly created branch is missing commits in the history. Not only are \nthey not displayed, the code changes are not present.\nIt doesn't matter if the branch is created by Visual Studio or GIT for \nWindows.\nOnly in a branch created by GitHub Desktop the commits are present, as I \nwould expect.\n\nIs this a bug or do I not understand how GIT works?\n\nBest regards and thank you for the effort\nAndré Pohlmann\n"},{"id":"440843","messageId":"211110.868rxwhy9v.gmgdl@evledraar.gmail.com","threadId":"56868","inReplyTo":"0bb0056a59cda294d416762d7f8a9c47@posteo.de","subject":"Re: bug or a general misunderstanding","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-11-10T14:33:04Z","receivedAt":"2021-11-10T14:37:52Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Nov 10 2021, andre_pohlmann@posteo.de wrote:\n\n> Hello there\n>\n> I'm not sure if I'm in the right place here.\n> Maybe it's a bug or a general misunderstanding of how GIT works.\n>\n> The following situation: I wanted to create a branch from a\n> commit. From there on the work should be continued.\n>\n> The possible bug:\n> The newly created branch is missing commits in the history. Not only\n> are they not displayed, the code changes are not present.\n> It doesn't matter if the branch is created by Visual Studio or GIT for\n> Windows.\n> Only in a branch created by GitHub Desktop the commits are present, as\n> I would expect.\n>\n> Is this a bug or do I not understand how GIT works?\n>\n> Best regards and thank you for the effort\n> André Pohlmann\n\nHi there.\n\nThe mailing list you contacted is the Git development mailing list. I\nthink it's fair to assume that you haven't run into a bug in git, but\nare in need of more basic resources on the topic of Git.\n\nGit's pretty good at retaining your data, if you can't find it after\nsaving it in git the reason for why is likely to be explained by an\nintroductory tutorial.\n\nA good resource to start with is: https://git-scm.com/community\n"},{"id":"440846","messageId":"nycvar.QRO.7.76.6.2111101545000.21127@tvgsbejvaqbjf.bet","threadId":"56868","inReplyTo":"0bb0056a59cda294d416762d7f8a9c47@posteo.de","subject":"Re: bug or a general misunderstanding","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-11-10T14:46:10Z","receivedAt":"2021-11-10T14:46:15Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi André,\n\nOn Wed, 10 Nov 2021, andre_pohlmann@posteo.de wrote:\n\n> The following situation: I wanted to create a branch from a commit. From there\n> on the work should be continued.\n\nI suspect that the command you used was `git branch <name> <commit>`? That\n_creates_ the branch, but does not switch to it. You need to call `git\nswitch <name>` to switch the worktree to it. If you want to do all in one\ngo, use `git switch -c <name> <commit>`.\n\nCiao,\nJohannes\n\n>\n> The possible bug:\n> The newly created branch is missing commits in the history. Not only are they\n> not displayed, the code changes are not present.\n> It doesn't matter if the branch is created by Visual Studio or GIT for\n> Windows.\n> Only in a branch created by GitHub Desktop the commits are present, as I would\n> expect.\n>\n> Is this a bug or do I not understand how GIT works?\n>\n> Best regards and thank you for the effort\n> André Pohlmann\n>\n>\n"},{"id":"440856","messageId":"3dd24fb6153cf8d67b74c6cea1a4a734@posteo.de","threadId":"56868","inReplyTo":"nycvar.QRO.7.76.6.2111101545000.21127@tvgsbejvaqbjf.bet","subject":"Re: bug or a general misunderstanding","fromName":"","fromEmail":"andre_pohlmann@posteo.de","sentAt":"2021-11-10T18:27:56Z","receivedAt":"2021-11-10T18:28:01Z","isPatch":false,"sender":{"key":"andre_pohlmann@posteo.de","avatar":null},"body":"Hello Johannes,\n\nThanks for your ideas.\n\nI have checked out the respective new branch and switched between the \noriginal and the new, multiple times.\nOtherwise I would not have noticed the lack of commits.\n\nI have also set up a virtual machine, free of any IDE or GIT. There I \nonly installed Git for Windows and repeated the process via cmd. The \nresult is the same, there are missing commits in the history compared to \nthe original branch.\n\nBest regards\nAndré Pohlmann\n\nAm 10.11.2021 15:46 schrieb Johannes Schindelin:\n> Hi André,\n> \n> On Wed, 10 Nov 2021, andre_pohlmann@posteo.de wrote:\n> \n>> The following situation: I wanted to create a branch from a commit. \n>> From there\n>> on the work should be continued.\n> \n> I suspect that the command you used was `git branch <name> <commit>`? \n> That\n> _creates_ the branch, but does not switch to it. You need to call `git\n> switch <name>` to switch the worktree to it. If you want to do all in \n> one\n> go, use `git switch -c <name> <commit>`.\n> \n> Ciao,\n> Johannes\n> \n>> \n>> The possible bug:\n>> The newly created branch is missing commits in the history. Not only \n>> are they\n>> not displayed, the code changes are not present.\n>> It doesn't matter if the branch is created by Visual Studio or GIT for\n>> Windows.\n>> Only in a branch created by GitHub Desktop the commits are present, as \n>> I would\n>> expect.\n>> \n>> Is this a bug or do I not understand how GIT works?\n>> \n>> Best regards and thank you for the effort\n>> André Pohlmann\n>> \n>> \n"},{"id":"441130","messageId":"468f30fbff6f1fcf708c484c19c287b7@posteo.de","threadId":"56868","inReplyTo":"YY2MXSZXIRSDLQCu@camp.crustytoothpaste.net","subject":"Re: bug or a general misunderstanding","fromName":"","fromEmail":"andre_pohlmann@posteo.de","sentAt":"2021-11-15T10:56:00Z","receivedAt":"2021-11-15T10:56:07Z","isPatch":false,"sender":{"key":"andre_pohlmann@posteo.de","avatar":null},"body":"Hi,\n\nStarting from the relevant branch\n\ngit branch TEST_1\ngit checkout TEST_1\ngit status\n\nthen\n\ngit checkout BBV ---- that is the original Branch\ngit branch TEST_2 ff2c8952 ---- the commit to check out from\ngit checkout TEST_2\ngit status\n\ngit branch --contains 48c8756e ---- the commit with the specific code\n\nthe result is that only TEST_1 is shown, not TEST_2.\nIt looks to me like the commit is missing.\nWhen I look at the code, the lines in question are also missing.\n\n\nAm 11.11.2021 22:34 schrieb brian m. carlson:\n> On 2021-11-10 at 18:27:56, andre_pohlmann@posteo.de wrote:\n>> Hello Johannes,\n>> \n>> Thanks for your ideas.\n>> \n>> I have checked out the respective new branch and switched between the\n>> original and the new, multiple times.\n>> Otherwise I would not have noticed the lack of commits.\n>> \n>> I have also set up a virtual machine, free of any IDE or GIT. There I \n>> only\n>> installed Git for Windows and repeated the process via cmd. The result \n>> is\n>> the same, there are missing commits in the history compared to the \n>> original\n>> branch.\n> \n> Could you give us a set of commands you've run (in Git Bash) to create \n> a\n> new test repository (or clone an existing public repository) and\n> reproduce this problem?  Right now, we don't know exactly what you've\n> done, so we can only speculate about what you're seeing.\n"},{"id":"441162","messageId":"YZLMVk3ULURAelQ2@coredump.intra.peff.net","threadId":"56868","inReplyTo":"468f30fbff6f1fcf708c484c19c287b7@posteo.de","subject":"Re: bug or a general misunderstanding","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-11-15T21:08:38Z","receivedAt":"2021-11-15T21:27:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 15, 2021 at 10:56:00AM +0000, andre_pohlmann@posteo.de wrote:\n\n> Starting from the relevant branch\n> \n> git branch TEST_1\n> git checkout TEST_1\n> git status\n\nOK, so TEST_1 points at something. We don't know what, but from below,\nit sounds like the BBV branch.\n\n> then\n> \n> git checkout BBV ---- that is the original Branch\n> git branch TEST_2 ff2c8952 ---- the commit to check out from\n\nOK, so now TEST_2 is created from ff2c8952. But from the details you've\ngiven, we don't know what relationship that has to what was on BBV, or\nany other commit.\n\n> git checkout TEST_2\n> git status\n\nAnd now it's our HEAD, though I don't think that matters, because...\n\n> git branch --contains 48c8756e ---- the commit with the specific code\n\n...this is asking which branches contain 48c8756e, and doesn't care\nabout HEAD at all.\n\n> the result is that only TEST_1 is shown, not TEST_2.\n> It looks to me like the commit is missing.\n\nI can't say if this is a bug or not, without knowing the relationship\nbetween 48c8756e and ff2c8952. Have you tried something like:\n\n  git log --oneline --graph 48c8756e...ff2c8952\n\nThat should show you whether one is an ancestor of the other.\n\n-Peff\n"},{"id":"441266","messageId":"ee27d7905184a56e2d943602040f9a6c@posteo.de","threadId":"56868","inReplyTo":"YZLMVk3ULURAelQ2@coredump.intra.peff.net","subject":"Re: bug or a general misunderstanding","fromName":"","fromEmail":"andre_pohlmann@posteo.de","sentAt":"2021-11-16T09:01:06Z","receivedAt":"2021-11-16T09:01:17Z","isPatch":false,"sender":{"key":"andre_pohlmann@posteo.de","avatar":null},"body":"Good Morning Peff,\n\nI am not sure how to interpret the result. I just get a graph displayed.\nDoes this refer to the current branch?\n\nIs it possible that the commit 48c8756e is in the history of a branch \nbut not an ancestor of ff2c8952?\nWould this mean that GIT ignores commits in the history if they are not \ndirect ancestors of the commit from which the branch is created?\n\nAnd why is the behavior of creating the branch different compared to Git \nHub Desktop?\n\nAndré\n\n\nAm 15.11.2021 22:08 schrieb Jeff King:\n> On Mon, Nov 15, 2021 at 10:56:00AM +0000, andre_pohlmann@posteo.de \n> wrote:\n> \n>> Starting from the relevant branch\n>> \n>> git branch TEST_1\n>> git checkout TEST_1\n>> git status\n> \n> OK, so TEST_1 points at something. We don't know what, but from below,\n> it sounds like the BBV branch.\n> \n>> then\n>> \n>> git checkout BBV ---- that is the original Branch\n>> git branch TEST_2 ff2c8952 ---- the commit to check out from\n> \n> OK, so now TEST_2 is created from ff2c8952. But from the details you've\n> given, we don't know what relationship that has to what was on BBV, or\n> any other commit.\n> \n>> git checkout TEST_2\n>> git status\n> \n> And now it's our HEAD, though I don't think that matters, because...\n> \n>> git branch --contains 48c8756e ---- the commit with the specific code\n> \n> ...this is asking which branches contain 48c8756e, and doesn't care\n> about HEAD at all.\n> \n>> the result is that only TEST_1 is shown, not TEST_2.\n>> It looks to me like the commit is missing.\n> \n> I can't say if this is a bug or not, without knowing the relationship\n> between 48c8756e and ff2c8952. Have you tried something like:\n> \n>   git log --oneline --graph 48c8756e...ff2c8952\n> \n> That should show you whether one is an ancestor of the other.\n> \n> -Peff\n"}]}