{"thread":{"id":"48191","subject":"[OT] how does \"git review --setup\" figure out my username?","startedAt":"2018-03-31T19:25:37Z","lastAt":"2018-03-31T20:10:37Z","messageCount":4,"participants":["Robert P. J. Day","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"343544","messageId":"alpine.LFD.2.21.1803311453250.21368@localhost.localdomain","threadId":"48191","inReplyTo":null,"subject":"[OT] how does \"git review --setup\" figure out my username?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2018-03-31T19:04:38Z","receivedAt":"2018-03-31T19:25:37Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"\n  (technically not a git question, but i kind of need to know the\nanswer to this quickly as i'm writing some documentation and this is\nsomething i have to explain.)\n\n  i cloned a repository (hyperledger fabric) which has a top-level\n.gitreview file:\n\n  [gerrit]\n  host=gerrit.hyperledger.org\n  port=29418\n  project=fabric\n\nand, as i read it, if i want to configure to use gerrit, an initial\ninvocation of \"git review --setup\" should do that for me, which it\nappears to do, as it adds the following to .git/config:\n\n  [remote \"gerrit\"]\n        url = ssh://rpjday@gerrit.hyperledger.org:29418/fabric\n        fetch = +refs/heads/*:refs/remotes/gerrit/*\n\nand copies over the commit-msg hook. so far, so good.\n\n  but from where does it figure out the username (rpjday) to use when\nconfiguring that remote? i have no gerrit configuration in my\n.gitconfig file. however, i have configured gerrit at the hyperledger\nend to use my SSH key, which is associated with my linux foundation ID\n(rpjday) that i registered to start using that repo.\n\n  is that where it gets the username from?\n\nrday\n"},{"id":"343545","messageId":"CACBZZX7wQChuEQeBHQzgg-XsMmmryB4qBXT9K4HxwxaSNe4UWg@mail.gmail.com","threadId":"48191","inReplyTo":"alpine.LFD.2.21.1803311453250.21368@localhost.localdomain","subject":"Re: [OT] how does \"git review --setup\" figure out my username?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-31T19:37:28Z","receivedAt":"2018-03-31T19:37:54Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Mar 31, 2018 at 9:04 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n>\n>   (technically not a git question, but i kind of need to know the\n> answer to this quickly as i'm writing some documentation and this is\n> something i have to explain.)\n>\n>   i cloned a repository (hyperledger fabric) which has a top-level\n> .gitreview file:\n>\n>   [gerrit]\n>   host=gerrit.hyperledger.org\n>   port=29418\n>   project=fabric\n>\n> and, as i read it, if i want to configure to use gerrit, an initial\n> invocation of \"git review --setup\" should do that for me, which it\n> appears to do, as it adds the following to .git/config:\n>\n>   [remote \"gerrit\"]\n>         url = ssh://rpjday@gerrit.hyperledger.org:29418/fabric\n>         fetch = +refs/heads/*:refs/remotes/gerrit/*\n>\n> and copies over the commit-msg hook. so far, so good.\n>\n>   but from where does it figure out the username (rpjday) to use when\n> configuring that remote? i have no gerrit configuration in my\n> .gitconfig file. however, i have configured gerrit at the hyperledger\n> end to use my SSH key, which is associated with my linux foundation ID\n> (rpjday) that i registered to start using that repo.\n>\n>   is that where it gets the username from?\n\nI've never used gerrit, but from my skimming of\nhttps://www.mediawiki.org/wiki/Gerrit/git-review#Setting_up_git-review\nand https://www.mediawiki.org/wiki/Gerrit/Tutorial#Configuring_git-review\nit seems (to me) to say that it simply tries if your local loginname\nworks on the remote. Is rpjday your loginname on this system?\n"},{"id":"343546","messageId":"alpine.LFD.2.21.1803311555500.23345@localhost.localdomain","threadId":"48191","inReplyTo":"CACBZZX7wQChuEQeBHQzgg-XsMmmryB4qBXT9K4HxwxaSNe4UWg@mail.gmail.com","subject":"Re: [OT] how does \"git review --setup\" figure out my username?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2018-03-31T19:56:36Z","receivedAt":"2018-03-31T19:56:48Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"On Sat, 31 Mar 2018, Ævar Arnfjörð Bjarmason wrote:\n\n> On Sat, Mar 31, 2018 at 9:04 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n> >\n> >   (technically not a git question, but i kind of need to know the\n> > answer to this quickly as i'm writing some documentation and this is\n> > something i have to explain.)\n> >\n> >   i cloned a repository (hyperledger fabric) which has a top-level\n> > .gitreview file:\n> >\n> >   [gerrit]\n> >   host=gerrit.hyperledger.org\n> >   port=29418\n> >   project=fabric\n> >\n> > and, as i read it, if i want to configure to use gerrit, an initial\n> > invocation of \"git review --setup\" should do that for me, which it\n> > appears to do, as it adds the following to .git/config:\n> >\n> >   [remote \"gerrit\"]\n> >         url = ssh://rpjday@gerrit.hyperledger.org:29418/fabric\n> >         fetch = +refs/heads/*:refs/remotes/gerrit/*\n> >\n> > and copies over the commit-msg hook. so far, so good.\n> >\n> >   but from where does it figure out the username (rpjday) to use when\n> > configuring that remote? i have no gerrit configuration in my\n> > .gitconfig file. however, i have configured gerrit at the hyperledger\n> > end to use my SSH key, which is associated with my linux foundation ID\n> > (rpjday) that i registered to start using that repo.\n> >\n> >   is that where it gets the username from?\n>\n> I've never used gerrit, but from my skimming of\n> https://www.mediawiki.org/wiki/Gerrit/git-review#Setting_up_git-review\n> and\n> https://www.mediawiki.org/wiki/Gerrit/Tutorial#Configuring_git-review\n> it seems (to me) to say that it simply tries if your local loginname\n> works on the remote. Is rpjday your loginname on this system?\n\n  yes, but it's just a fluke that i used the same user name in both\nplaces ... what if i hadn't? which one would it have selected?\n\nrday"},{"id":"343547","messageId":"877epsvweh.fsf@evledraar.gmail.com","threadId":"48191","inReplyTo":"alpine.LFD.2.21.1803311555500.23345@localhost.localdomain","subject":"Re: [OT] how does \"git review --setup\" figure out my username?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-31T20:10:30Z","receivedAt":"2018-03-31T20:10:37Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sat, Mar 31 2018, Robert P. J. Day wrote:\n\n> On Sat, 31 Mar 2018, Ævar Arnfjörð Bjarmason wrote:\n>\n>> On Sat, Mar 31, 2018 at 9:04 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n>> >\n>> >   (technically not a git question, but i kind of need to know the\n>> > answer to this quickly as i'm writing some documentation and this is\n>> > something i have to explain.)\n>> >\n>> >   i cloned a repository (hyperledger fabric) which has a top-level\n>> > .gitreview file:\n>> >\n>> >   [gerrit]\n>> >   host=gerrit.hyperledger.org\n>> >   port=29418\n>> >   project=fabric\n>> >\n>> > and, as i read it, if i want to configure to use gerrit, an initial\n>> > invocation of \"git review --setup\" should do that for me, which it\n>> > appears to do, as it adds the following to .git/config:\n>> >\n>> >   [remote \"gerrit\"]\n>> >         url = ssh://rpjday@gerrit.hyperledger.org:29418/fabric\n>> >         fetch = +refs/heads/*:refs/remotes/gerrit/*\n>> >\n>> > and copies over the commit-msg hook. so far, so good.\n>> >\n>> >   but from where does it figure out the username (rpjday) to use when\n>> > configuring that remote? i have no gerrit configuration in my\n>> > .gitconfig file. however, i have configured gerrit at the hyperledger\n>> > end to use my SSH key, which is associated with my linux foundation ID\n>> > (rpjday) that i registered to start using that repo.\n>> >\n>> >   is that where it gets the username from?\n>>\n>> I've never used gerrit, but from my skimming of\n>> https://www.mediawiki.org/wiki/Gerrit/git-review#Setting_up_git-review\n>> and\n>> https://www.mediawiki.org/wiki/Gerrit/Tutorial#Configuring_git-review\n>> it seems (to me) to say that it simply tries if your local loginname\n>> works on the remote. Is rpjday your loginname on this system?\n>\n>   yes, but it's just a fluke that i used the same user name in both\n> places ... what if i hadn't? which one would it have selected?\n\nSeems like a fairly common case, especially as gerrit tends to be used\nin Big Corp setups where your username is the same.\n\nAccording to the docs I linked to it'll ask you if it doesn't happen to\nmatch, but as I've said never used it, and that may be wrong.\n"}]}