{"thread":{"id":"20699","subject":"git svn pointing at svn branch instead of trunk?","startedAt":"2009-08-22T18:40:50Z","lastAt":"2009-08-30T20:30:39Z","messageCount":5,"participants":["skillzero@gmail.com","Eric Wong","Daniele Segato"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"121522","messageId":"2729632a0908221140p532a3c29k90af7b4cbd25d65e@mail.gmail.com","threadId":"20699","inReplyTo":null,"subject":"git svn pointing at svn branch instead of trunk?","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-08-22T18:40:50Z","receivedAt":"2009-08-22T18:40:50Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"When I used git svn to clone a repository, it ended up pointing master\nat a tag in svn instead of trunk. For example, git svn info shows the\nURL for the tag instead of trunk. git log master also shows the most\nrecent commit is the creation of that tag in svn, but then the next\ncommit is the most recent commit to trunk. It's like it's mixing\nthings from the tag with things from trunk. The most recent commit in\nsvn was to create the tag that master is now pointing to in case that\nmatters.\n\nIs there something in the svn repository that might cause this? What's\nthe correct way to reset what git svn thinks master should point to?\nAnd how should I get rid of the commit on master that created the tag\nwithout messing up git svn (e.g. can I just git reset or will that\nconfuse git svn later?).\n"},{"id":"121526","messageId":"20090822204627.GA22484@dcvr.yhbt.net","threadId":"20699","inReplyTo":"2729632a0908221140p532a3c29k90af7b4cbd25d65e@mail.gmail.com","subject":"Re: git svn pointing at svn branch instead of trunk?","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-08-22T20:46:27Z","receivedAt":"2009-08-22T20:46:27Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"skillzero@gmail.com wrote:\n> When I used git svn to clone a repository, it ended up pointing master\n> at a tag in svn instead of trunk. For example, git svn info shows the\n> URL for the tag instead of trunk. git log master also shows the most\n> recent commit is the creation of that tag in svn, but then the next\n> commit is the most recent commit to trunk. It's like it's mixing\n> things from the tag with things from trunk. The most recent commit in\n> svn was to create the tag that master is now pointing to in case that\n> matters.\n\nHi,\n\nSo you have something like this?\n\n----------trunk\n              \\\n               \\-> tag\n\nIt looks like it's mixed but that's because trunk is an ancestor of your\ntag, so the majority of commits (see git-svn-id:) look like they're from\ntrunk except the latest git-svn-id: which should have the URL of the tag\nin it.  So in short, everything here is OK.\n\n> Is there something in the svn repository that might cause this? What's\n> the correct way to reset what git svn thinks master should point to?\n> And how should I get rid of the commit on master that created the tag\n> without messing up git svn (e.g. can I just git reset or will that\n> confuse git svn later?).\n\nI changed this recently in b186a261b1f7ec1fbda8c5f6d84595f3a7716d92\ngit svn used to always pick the newest change in the entire SVN repo\nto point master to, now it'll attempt to find \"trunk\" to be master.\n\nYou can git reset anything on your master without affecting git svn.\n\nIf you have commits on master, just cherry pick them to a new branch\nthat's based off trunk and then reset master to be that new branch.\n\n-- \nEric Wong\n"},{"id":"121530","messageId":"2729632a0908221512v7d7af188h28d11a4bc8f092fc@mail.gmail.com","threadId":"20699","inReplyTo":"20090822204627.GA22484@dcvr.yhbt.net","subject":"Re: git svn pointing at svn branch instead of trunk?","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-08-22T22:12:01Z","receivedAt":"2009-08-22T22:12:01Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"On Sat, Aug 22, 2009 at 1:46 PM, Eric Wong<normalperson@yhbt.net> wrote:\n\n> So you have something like this?\n>\n> ----------trunk\n>              \\\n>               \\-> tag\n>\n> It looks like it's mixed but that's because trunk is an ancestor of your\n> tag, so the majority of commits (see git-svn-id:) look like they're from\n> trunk except the latest git-svn-id: which should have the URL of the tag\n> in it.  So in short, everything here is OK.\n\nYes, that's what I see: most of the commits have a /trunk URL except\nthe last one has a /tags/TagX URL.\n\nWhen the next commit happens on master (I don't have svn commit access\non the svn repo to try it myself), will git svn automatically track\nmaster->trunk again? Or is there something I need to change to tell it\n\"master tracks svn's /trunk\"? I normally do git svn fetch and git svn\nrebase (while on master, I do all my own commits on a separate\nbranch).\n\n> I changed this recently in b186a261b1f7ec1fbda8c5f6d84595f3a7716d92\n> git svn used to always pick the newest change in the entire SVN repo\n> to point master to, now it'll attempt to find \"trunk\" to be master.\n\nThanks, I'll build that and try it out. That sounds like what was confusing me.\n"},{"id":"121537","messageId":"20090823025101.GA22562@dcvr.yhbt.net","threadId":"20699","inReplyTo":"2729632a0908221512v7d7af188h28d11a4bc8f092fc@mail.gmail.com","subject":"Re: git svn pointing at svn branch instead of trunk?","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-08-23T02:51:01Z","receivedAt":"2009-08-23T02:51:01Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"skillzero@gmail.com wrote:\n> On Sat, Aug 22, 2009 at 1:46 PM, Eric Wong<normalperson@yhbt.net> wrote:\n> \n> > So you have something like this?\n> >\n> > ----------trunk\n> >              \\\n> >               \\-> tag\n> >\n> > It looks like it's mixed but that's because trunk is an ancestor of your\n> > tag, so the majority of commits (see git-svn-id:) look like they're from\n> > trunk except the latest git-svn-id: which should have the URL of the tag\n> > in it.  So in short, everything here is OK.\n> \n> Yes, that's what I see: most of the commits have a /trunk URL except\n> the last one has a /tags/TagX URL.\n> \n> When the next commit happens on master (I don't have svn commit access\n> on the svn repo to try it myself), will git svn automatically track\n> master->trunk again? Or is there something I need to change to tell it\n> \"master tracks svn's /trunk\"? I normally do git svn fetch and git svn\n> rebase (while on master, I do all my own commits on a separate\n> branch).\n\nYou need to reset your master to trunk so it knows to track trunk\ninstead of tags/TagX\n\n-- \nEric Wong\n"},{"id":"122135","messageId":"1251664239.31273.11.camel@localhost","threadId":"20699","inReplyTo":"2729632a0908221140p532a3c29k90af7b4cbd25d65e@mail.gmail.com","subject":"Re: git svn pointing at svn branch instead of trunk?","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-08-30T20:30:39Z","receivedAt":"2009-08-30T20:30:39Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"Il giorno sab, 22/08/2009 alle 11.40 -0700, skillzero@gmail.com ha\nscritto:\n> When I used git svn to clone a repository, it ended up pointing master\n> at a tag in svn instead of trunk. For example, git svn info shows the\n> URL for the tag instead of trunk. git log master also shows the most\n> recent commit is the creation of that tag in svn, but then the next\n> commit is the most recent commit to trunk. It's like it's mixing\n> things from the tag with things from trunk. The most recent commit in\n> svn was to create the tag that master is now pointing to in case that\n> matters.\n\nI had the same problem a while ago.\n\nWhen git-svn is done cloning you find yourself in the \"master\" branch\n(check by executing git branch) and it's content is the last svn-commit.\nIf the last svn commit is a tag or in a branch you'll end up in that\ntag/branch\n\n> Is there something in the svn repository that might cause this? What's\n> the correct way to reset what git svn thinks master should point to?\n> And how should I get rid of the commit on master that created the tag\n> without messing up git svn (e.g. can I just git reset or will that\n> confuse git svn later?).\n\nexecute:\ngit branch -r\n\nit will list all the remote branches:\n\nusually one will be \"trunk\"\n\nif you now execute:\n\ngit reset --hard remotes/trunk\n\nit will reset your current local branch (master) to the remote trunk and\nwill start to truck that remote branch (trunk)\n\nI'm a git newbie, so if i said something wrong I hope someone will\ncorrect me.\n\nCheers,\nDaniele\n"}]}