{"thread":{"id":"46112","subject":"Git p4 sync changelist interval","startedAt":"2017-06-04T09:56:10Z","lastAt":"2017-06-06T10:55:06Z","messageCount":8,"participants":["Андрей Ефанов","Luke Diamand"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"321505","messageId":"CAPRL90JeQ3i1m7ydYzTCFgtZ4cC+gYEXFeAKvCuAVwPLXpsgXg@mail.gmail.com","threadId":"46112","inReplyTo":null,"subject":"Git p4 sync changelist interval","fromName":"Андрей Ефанов","fromEmail":"1134togo@gmail.com","sentAt":"2017-06-04T09:56:03Z","receivedAt":"2017-06-04T09:56:10Z","isPatch":false,"sender":{"key":"1134togo@gmail.com","avatar":"https://gravatar.com/avatar/659a8d32a27740dbaf9bd80a9d4d89e494c3fc41fd746d6fa653c81b5df91eaa?d=mp&s=160"},"body":"Hello,\n\nMy goal is to sync the repository from p4 using an interval of\nchangelists so that the first changelist version of the repository\nwould be considered as an initial commit.\nSo I used the following command:\n\n git p4 clone //depot@cl1,cl2\n\nAnd when it finished, the files, that were created before the cl1 were\nnot in the HEAD.\n\nThe problem, as I see it, is that before syncing changes in the given\nrange, p4 task does not sync to cl1 version of the repo, and applies\ncommits to the empty repository.\nIs it a bug or my misunderstanding of how git p4 should work?\n\nRegards,\nAndrew Yefanov\n"},{"id":"321508","messageId":"CAE5ih7-Nmy2J6zO9mx7g=L7Ey9PnVUcD3wnXBN4_0znwOHaUeQ@mail.gmail.com","threadId":"46112","inReplyTo":"CAPRL90JeQ3i1m7ydYzTCFgtZ4cC+gYEXFeAKvCuAVwPLXpsgXg@mail.gmail.com","subject":"Re: Git p4 sync changelist interval","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2017-06-04T11:09:36Z","receivedAt":"2017-06-04T11:09:42Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 4 June 2017 at 10:56, Андрей Ефанов <1134togo@gmail.com> wrote:\n> Hello,\n>\n> My goal is to sync the repository from p4 using an interval of\n> changelists so that the first changelist version of the repository\n> would be considered as an initial commit.\n> So I used the following command:\n>\n>  git p4 clone //depot@cl1,cl2\n>\n> And when it finished, the files, that were created before the cl1 were\n> not in the HEAD.\n\nDo you mean that if foo.c was created at cl1+1, that after doing the\nclone, it wasn't there?\n\nIf so, that doesn't sound right to me.\n\nI have just tried doing what I think you mean:\n\n1. Create p4 depot\n2. Add foo.c (at CL 2)\n3. Add bar.c (at CL 3)\n4. git-p4 clone //depot@2,3\n\nI end up with both files.\n\n>\n> The problem, as I see it, is that before syncing changes in the given\n> range, p4 task does not sync to cl1 version of the repo, and applies\n> commits to the empty repository.\n> Is it a bug or my misunderstanding of how git p4 should work?\n\nPossibly I'm misunderstanding what you're doing! Can you give a\nsequence of steps to show the problem?\n\nThanks!\nLuke\n"},{"id":"321549","messageId":"CAKOu8-0DG_wQf4ch_MH=rjAncg1iP=uA1U7XHgXe7JNrEJSkGg@mail.gmail.com","threadId":"46112","inReplyTo":"CAKOu8-2iBV=sAP0WeRMQFT+0y5cJ1g6A3bQ5x=D=8q9ocxnBVg@mail.gmail.com","subject":"Fwd: Git p4 sync changelist interval","fromName":"Андрей Ефанов","fromEmail":"1134togo@gmail.com","sentAt":"2017-06-05T18:50:55Z","receivedAt":"2017-06-05T18:51:01Z","isPatch":false,"sender":{"key":"1134togo@gmail.com","avatar":"https://gravatar.com/avatar/659a8d32a27740dbaf9bd80a9d4d89e494c3fc41fd746d6fa653c81b5df91eaa?d=mp&s=160"},"body":"2017-06-04 14:09 GMT+03:00 Luke Diamand <luke@diamand.org>:\n>\n> On 4 June 2017 at 10:56, Андрей Ефанов <1134togo@gmail.com> wrote:\n> > Hello,\n> >\n> > My goal is to sync the repository from p4 using an interval of\n> > changelists so that the first changelist version of the repository\n> > would be considered as an initial commit.\n> > So I used the following command:\n> >\n> >  git p4 clone //depot@cl1,cl2\n> >\n> > And when it finished, the files, that were created before the cl1 were\n> > not in the HEAD.\n>\n> Do you mean that if foo.c was created at cl1+1, that after doing the\n> clone, it wasn't there?\n>\n> If so, that doesn't sound right to me.\n>\n> I have just tried doing what I think you mean:\n>\n> 1. Create p4 depot\n> 2. Add foo.c (at CL 2)\n> 3. Add bar.c (at CL 3)\n> 4. git-p4 clone //depot@2,3\n>\n> I end up with both files.\n>\n> >\n> > The problem, as I see it, is that before syncing changes in the given\n> > range, p4 task does not sync to cl1 version of the repo, and applies\n> > commits to the empty repository.\n> > Is it a bug or my misunderstanding of how git p4 should work?\n>\n> Possibly I'm misunderstanding what you're doing! Can you give a\n> sequence of steps to show the problem?\n\nWhat I meant is:\n\n1. Create p4 depot\n2. Add first.file (CL 2)\n3. Add second.file (at CL 3)\n4. Add third.file (at CL 4)\n5. Modify first.file (at CL 5)\n4. git-p4 clone //depot@3,5\n\nIn this case first.file, will not be represented in the repository.\n\nRegards,\nAndrew\n"},{"id":"321578","messageId":"CAE5ih79VCpmMmaq0AEW=5HeOmVdpjpSmh=1CheUZbqvbNfBFbA@mail.gmail.com","threadId":"46112","inReplyTo":"CAKOu8-0DG_wQf4ch_MH=rjAncg1iP=uA1U7XHgXe7JNrEJSkGg@mail.gmail.com","subject":"Re: Git p4 sync changelist interval","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2017-06-05T23:29:52Z","receivedAt":"2017-06-05T23:30:05Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 5 June 2017 at 19:50, Андрей Ефанов <1134togo@gmail.com> wrote:\n> 2017-06-04 14:09 GMT+03:00 Luke Diamand <luke@diamand.org>:\n>>\n>> On 4 June 2017 at 10:56, Андрей Ефанов <1134togo@gmail.com> wrote:\n>> > Hello,\n>> >\n>> > My goal is to sync the repository from p4 using an interval of\n>> > changelists so that the first changelist version of the repository\n>> > would be considered as an initial commit.\n>> > So I used the following command:\n>> >\n>> >  git p4 clone //depot@cl1,cl2\n>> >\n>> > And when it finished, the files, that were created before the cl1 were\n>> > not in the HEAD.\n>>\n>> Do you mean that if foo.c was created at cl1+1, that after doing the\n>> clone, it wasn't there?\n>>\n>> If so, that doesn't sound right to me.\n>>\n>> I have just tried doing what I think you mean:\n>>\n>> 1. Create p4 depot\n>> 2. Add foo.c (at CL 2)\n>> 3. Add bar.c (at CL 3)\n>> 4. git-p4 clone //depot@2,3\n>>\n>> I end up with both files.\n>>\n>> >\n>> > The problem, as I see it, is that before syncing changes in the given\n>> > range, p4 task does not sync to cl1 version of the repo, and applies\n>> > commits to the empty repository.\n>> > Is it a bug or my misunderstanding of how git p4 should work?\n>>\n>> Possibly I'm misunderstanding what you're doing! Can you give a\n>> sequence of steps to show the problem?\n>\n> What I meant is:\n>\n> 1. Create p4 depot\n> 2. Add first.file (CL 2)\n> 3. Add second.file (at CL 3)\n> 4. Add third.file (at CL 4)\n> 5. Modify first.file (at CL 5)\n> 4. git-p4 clone //depot@3,5\n>\n> In this case first.file, will not be represented in the repository.\n\nHmmm, it's not working right for me. Although in my case I seem to be\nmissing the second file.\n\nIt's fine if I don't use the revision range \"3,5\".\n\nLuke\n"},{"id":"321598","messageId":"CAE5ih7_yt4zjju3F34gUTKLPip9T98ow=shZY7EPe3yE8gk32Q@mail.gmail.com","threadId":"46112","inReplyTo":"CAE5ih79VCpmMmaq0AEW=5HeOmVdpjpSmh=1CheUZbqvbNfBFbA@mail.gmail.com","subject":"Re: Git p4 sync changelist interval","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2017-06-06T07:00:32Z","receivedAt":"2017-06-06T07:00:37Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 6 June 2017 at 00:29, Luke Diamand <luke@diamand.org> wrote:\n> On 5 June 2017 at 19:50, Андрей Ефанов <1134togo@gmail.com> wrote:\n>> 2017-06-04 14:09 GMT+03:00 Luke Diamand <luke@diamand.org>:\n>>>\n>>>\n>>> >\n>>> > The problem, as I see it, is that before syncing changes in the given\n>>> > range, p4 task does not sync to cl1 version of the repo, and applies\n>>> > commits to the empty repository.\n>>> > Is it a bug or my misunderstanding of how git p4 should work?\n>>>\n>>> Possibly I'm misunderstanding what you're doing! Can you give a\n>>> sequence of steps to show the problem?\n>>\n>> What I meant is:\n>>\n>> 1. Create p4 depot\n>> 2. Add first.file (CL 2)\n>> 3. Add second.file (at CL 3)\n>> 4. Add third.file (at CL 4)\n>> 5. Modify first.file (at CL 5)\n>> 4. git-p4 clone //depot@3,5\n>>\n>> In this case first.file, will not be represented in the repository.\n>\n> Hmmm, it's not working right for me. Although in my case I seem to be\n> missing the second file.\n>\n> It's fine if I don't use the revision range \"3,5\".\n\nIt's also fine if I do:\n\ngit p4 sync //depot@3\ncd depot\ngit p4 rebase\n"},{"id":"321601","messageId":"CAE5ih7-+EzUhjXCCOu_oELof_2X_qf5snoqUZyuRNqEu+p=ewg@mail.gmail.com","threadId":"46112","inReplyTo":"CAE5ih7_yt4zjju3F34gUTKLPip9T98ow=shZY7EPe3yE8gk32Q@mail.gmail.com","subject":"Re: Git p4 sync changelist interval","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2017-06-06T07:49:24Z","receivedAt":"2017-06-06T07:49:30Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 6 June 2017 at 08:00, Luke Diamand <luke@diamand.org> wrote:\n> On 6 June 2017 at 00:29, Luke Diamand <luke@diamand.org> wrote:\n>> On 5 June 2017 at 19:50, Андрей Ефанов <1134togo@gmail.com> wrote:\n>>> 2017-06-04 14:09 GMT+03:00 Luke Diamand <luke@diamand.org>:\n>>>>\n>>>>\n>>>> >\n>>>> > The problem, as I see it, is that before syncing changes in the given\n>>>> > range, p4 task does not sync to cl1 version of the repo, and applies\n>>>> > commits to the empty repository.\n>>>> > Is it a bug or my misunderstanding of how git p4 should work?\n>>>>\n>>>> Possibly I'm misunderstanding what you're doing! Can you give a\n>>>> sequence of steps to show the problem?\n>>>\n>>> What I meant is:\n>>>\n>>> 1. Create p4 depot\n>>> 2. Add first.file (CL 2)\n>>> 3. Add second.file (at CL 3)\n>>> 4. Add third.file (at CL 4)\n>>> 5. Modify first.file (at CL 5)\n>>> 4. git-p4 clone //depot@3,5\n>>>\n>>> In this case first.file, will not be represented in the repository.\n>>\n>> Hmmm, it's not working right for me. Although in my case I seem to be\n>> missing the second file.\n>>\n>> It's fine if I don't use the revision range \"3,5\".\n>\n> It's also fine if I do:\n>\n> git p4 sync //depot@3\n> cd depot\n> git p4 rebase\n\nIt seems to be something to do with the code around line 3395 that says:\n\n    if self.changeRange == \"@all\":\n        self.changeRange = \"\"\n    elif ',' not in self.changeRange:\n\nIt's finding a lower revision number with which to later call\nimportHeadRevision(), but that only seems to be called if the revision\nrange does *not* have a \",\" in it. As a result, we never actually call\nimportHeadRevision() and so files end up missing.\n\nThe obvious fix of fishing out the \"@3\" from the \"@3,5\" revision range\nworks in this instance, but breaks some of the regression tests.\n\nLuke\n"},{"id":"321602","messageId":"CAKOu8-2mB=fcFUd86vdK+z==0bX3rUvY-VuNjQ-C6t++uik8YQ@mail.gmail.com","threadId":"46112","inReplyTo":"CAE5ih7-+EzUhjXCCOu_oELof_2X_qf5snoqUZyuRNqEu+p=ewg@mail.gmail.com","subject":"Re: Git p4 sync changelist interval","fromName":"Андрей Ефанов","fromEmail":"1134togo@gmail.com","sentAt":"2017-06-06T07:56:54Z","receivedAt":"2017-06-06T07:56:59Z","isPatch":false,"sender":{"key":"1134togo@gmail.com","avatar":"https://gravatar.com/avatar/659a8d32a27740dbaf9bd80a9d4d89e494c3fc41fd746d6fa653c81b5df91eaa?d=mp&s=160"},"body":"2017-06-06 10:49 GMT+03:00 Luke Diamand <luke@diamand.org>:\n> On 6 June 2017 at 08:00, Luke Diamand <luke@diamand.org> wrote:\n>> On 6 June 2017 at 00:29, Luke Diamand <luke@diamand.org> wrote:\n>>> On 5 June 2017 at 19:50, Андрей Ефанов <1134togo@gmail.com> wrote:\n>>>> 2017-06-04 14:09 GMT+03:00 Luke Diamand <luke@diamand.org>:\n>>>>>\n>>>>>\n>>>>> >\n>>>>> > The problem, as I see it, is that before syncing changes in the given\n>>>>> > range, p4 task does not sync to cl1 version of the repo, and applies\n>>>>> > commits to the empty repository.\n>>>>> > Is it a bug or my misunderstanding of how git p4 should work?\n>>>>>\n>>>>> Possibly I'm misunderstanding what you're doing! Can you give a\n>>>>> sequence of steps to show the problem?\n>>>>\n>>>> What I meant is:\n>>>>\n>>>> 1. Create p4 depot\n>>>> 2. Add first.file (CL 2)\n>>>> 3. Add second.file (at CL 3)\n>>>> 4. Add third.file (at CL 4)\n>>>> 5. Modify first.file (at CL 5)\n>>>> 4. git-p4 clone //depot@3,5\n>>>>\n>>>> In this case first.file, will not be represented in the repository.\n>>>\n>>> Hmmm, it's not working right for me. Although in my case I seem to be\n>>> missing the second file.\n>>>\n>>> It's fine if I don't use the revision range \"3,5\".\n>>\n>> It's also fine if I do:\n>>\n>> git p4 sync //depot@3\n>> cd depot\n>> git p4 rebase\n>\n> It seems to be something to do with the code around line 3395 that says:\n>\n>     if self.changeRange == \"@all\":\n>         self.changeRange = \"\"\n>     elif ',' not in self.changeRange:\n>\n> It's finding a lower revision number with which to later call\n> importHeadRevision(), but that only seems to be called if the revision\n> range does *not* have a \",\" in it. As a result, we never actually call\n> importHeadRevision() and so files end up missing.\n>\n> The obvious fix of fishing out the \"@3\" from the \"@3,5\" revision range\n> works in this instance, but breaks some of the regression tests.\n>\n> Luke\n\nI did the same change before and it worked for me. I'd like to find\nout if it is a bug (I think it is), a normal behavior or am I doing\nsomething wrong.\n\nSo according to what you say, it is a bug.\n\nAndrew\n"},{"id":"321607","messageId":"CAE5ih79_0XhT6Nb5WMki0kCZ_FaWSCYc5H=fZmp3esQSN-tF1w@mail.gmail.com","threadId":"46112","inReplyTo":"CAKOu8-2mB=fcFUd86vdK+z==0bX3rUvY-VuNjQ-C6t++uik8YQ@mail.gmail.com","subject":"Re: Git p4 sync changelist interval","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2017-06-06T10:54:59Z","receivedAt":"2017-06-06T10:55:06Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 6 June 2017 at 08:56, Андрей Ефанов <1134togo@gmail.com> wrote:\n>>\n>> It seems to be something to do with the code around line 3395 that says:\n>>\n>>     if self.changeRange == \"@all\":\n>>         self.changeRange = \"\"\n>>     elif ',' not in self.changeRange:\n>>\n>> It's finding a lower revision number with which to later call\n>> importHeadRevision(), but that only seems to be called if the revision\n>> range does *not* have a \",\" in it. As a result, we never actually call\n>> importHeadRevision() and so files end up missing.\n>>\n>> The obvious fix of fishing out the \"@3\" from the \"@3,5\" revision range\n>> works in this instance, but breaks some of the regression tests.\n>>\n>> Luke\n>\n> I did the same change before and it worked for me. I'd like to find\n> out if it is a bug (I think it is), a normal behavior or am I doing\n> something wrong.\n>\n> So according to what you say, it is a bug.\n\nIt's a bug!\n\nI think you can workaround it by doing:\n\n$ git p4 clone //depot@3\n$ git p4 sync\n\nI'll see if I can workout why my obvious fix caused the tests to fail.\n"}]}