{"thread":{"id":"11030","subject":"git bug/feature request","startedAt":"2007-11-27T10:27:41Z","lastAt":"2007-11-30T18:21:21Z","messageCount":22,"participants":["gapon","Benoit Sigoure","Alex Riesen","Jakub Narebski","Peter Karlsson","David Kastrup","Steven Grimm","Daniel Barkalow","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"61043","messageId":"200711271127.41161.gapon007@gmail.com","threadId":"11030","inReplyTo":null,"subject":"git bug/feature request","fromName":"gapon","fromEmail":"gapon007@gmail.com","sentAt":"2007-11-27T10:27:41Z","receivedAt":"2007-11-27T10:27:41Z","isPatch":false,"sender":{"key":"gapon007@gmail.com","avatar":null},"body":"hi all,\nfirst of all i don't know if there's a bugzilla or something similar for git - \ni have found just this email (on http://git.or.cz/ webpage).\n\ni have discovered \"weird\" behaviour of git in this scenario*:\n- user A is working in repo A\n- user B clones repo A\n- user B makes some changes, commits, pushes\n- user A makes some changes, git status (no info about new commit in his repo \nfrom user B but it's probably ok i'd say - but some of my files are marked as \nchanged and already added to index  but i haven't changed them - that's \nconfusing, isn't it?)\n- user A can commit his changes => shouldn't be there any info/message/warning \ndisplayed? it would be helpful to have here some info about \"foreign commit\" \nin the repo or something like this\n\nhmm?\n\nthanks for git, it's simply the best one!\ngapon\n\n* yes, i know that this scenario is \"incorrect\" but... it's possible and \ntherefore i think it should be somehow handled - i tried a similar one with \nhg and bzr and i like their behaviour more\n"},{"id":"61046","messageId":"7A14A564-C424-4ACC-A860-A11DCC38C9A1@lrde.epita.fr","threadId":"11030","inReplyTo":"200711271127.41161.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Benoit Sigoure","fromEmail":"tsuna@lrde.epita.fr","sentAt":"2007-11-27T10:57:24Z","receivedAt":"2007-11-27T10:57:24Z","isPatch":false,"sender":{"key":"tsunanet@gmail.com","avatar":"https://avatars.githubusercontent.com/u/128281?v=4"},"body":"On Nov 27, 2007, at 11:27 AM, gapon wrote:\n\n> * yes, i know that this scenario is \"incorrect\" but... it's  \n> possible and\n> therefore i think it should be somehow handled - i tried a similar  \n> one with\n> hg and bzr and i like their behaviour more\n\n\nWould you mind describing the behavior of hg and bzr in this case?\n\nI was also bitten by this \"feature\" of Git.  Until I decided to put a  \nbare repo in between and push my commits there.\n\n-- \nBenoit Sigoure aka Tsuna\nEPITA Research and Development Laboratory\n"},{"id":"61048","messageId":"200711271216.25283.gapon007@gmail.com","threadId":"11030","inReplyTo":"7A14A564-C424-4ACC-A860-A11DCC38C9A1@lrde.epita.fr","subject":"Re: git bug/feature request","fromName":"gapon","fromEmail":"gapon007@gmail.com","sentAt":"2007-11-27T11:16:25Z","receivedAt":"2007-11-27T11:16:25Z","isPatch":false,"sender":{"key":"gapon007@gmail.com","avatar":null},"body":"bzr:\nwhile pushing, bzr tries to merge into the current working copy (of A)\n-> all changes are applied or conflicts occure\n\nhg:\nwhile pushing, neither merge nor info message, but new head (branch) is \ncreated in repo A - so then in A you can commit your changes but it's \ndifferent head (repo A has more heads, use hg heads to list them)\nbtw i filed and enhancement for hg, to let user know that there are more heads \nin the repo (you have to use hg log or hg heads to discover that someone else \nhas pushed into your repo and hg merge to merge them)\n\ngapon\n\n\nDne úterý 27 listopadu 2007 Benoit Sigoure napsal(a):\n> On Nov 27, 2007, at 11:27 AM, gapon wrote:\n> > * yes, i know that this scenario is \"incorrect\" but... it's\n> > possible and\n> > therefore i think it should be somehow handled - i tried a similar\n> > one with\n> > hg and bzr and i like their behaviour more\n>\n> Would you mind describing the behavior of hg and bzr in this case?\n>\n> I was also bitten by this \"feature\" of Git.  Until I decided to put a\n> bare repo in between and push my commits there.\n"},{"id":"61050","messageId":"81b0412b0711270321q6f70554at177ade878448b9fc@mail.gmail.com","threadId":"11030","inReplyTo":"200711271127.41161.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-11-27T11:21:35Z","receivedAt":"2007-11-27T11:21:35Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 27/11/2007, gapon <gapon007@gmail.com> wrote:\n> hi all,\n> first of all i don't know if there's a bugzilla or something similar for git -\n> i have found just this email (on http://git.or.cz/ webpage).\n>\n> i have discovered \"weird\" behaviour of git in this scenario*:\n> - user A is working in repo A\n> - user B clones repo A\n> - user B makes some changes, commits, pushes\n> - user A makes some changes, git status (no info about new commit in his repo\n> from user B but it's probably ok i'd say - but some of my files are marked as\n> changed and already added to index  but i haven't changed them - that's\n> confusing, isn't it?)\n> - user A can commit his changes => shouldn't be there any info/message/warning\n> displayed? it would be helpful to have here some info about \"foreign commit\"\n> in the repo or something like this\n\nIf you share a repository with someone else, you better use different\nbranches. What's happened is that user B changed the branch the\nuser A was working on (strictly speaking, the B-user changed the\nreference A-user used as HEAD at the moment).\n\nJust have the B-user push his/hers changes on something else,\nnot the master of the parent repository. For instance, B-user can\nadd a \"push\"-line to his origin remote which redirects its pushes\nsomewhere else:\n\n  git config remote.origin.push 'refs/heads/*:refs/heads/B-user/*'\n\nOr just use a dedicated shared repo where no one works in.\nSee also Documentation/config.txt, and the man page of git-push.\n"},{"id":"61052","messageId":"figv47$926$1@ger.gmane.org","threadId":"11030","inReplyTo":"200711271127.41161.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-27T11:30:16Z","receivedAt":"2007-11-27T11:30:16Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"gapon wrote:\n\n> hi all,\n> first of all i don't know if there's a bugzilla or something similar\n> for git - i have found just this email (on http://git.or.cz/ webpage).\n\nThere isn't any bug tracker for git. Use git mailing list for bug\nreports and feature requests.\n\n> i have discovered \"weird\" behaviour of git in this scenario*:\n> - user A is working in repo A\n> - user B clones repo A\n> - user B makes some changes, commits, pushes\n\nDo not push into checked out branch!\n\n> - user A makes some changes, git status (no info about new commit\n>   in his repo from user B but it's probably ok i'd say - but some\n>   of my files are marked as changed and already added to index\n>   but i haven't changed them - that's confusing, isn't it?)\n> - user A can commit his changes => shouldn't be there any\n>   info/message/warning displayed? it would be helpful to have\n>   here some info about \"foreign commit\" in the repo or something\n>   like this \n\nPerhaps there should. There was some idea and even preliminary\nimplementation of BASE check, but IIRC it was deemed too complicated,\nand encouraging wrong workflow.\n\nBesides, even with the check, pushing into checked out branch can quite\neasily lead either to loosing (or at least vanishing) some history,\nor problems with pushing.\n\n> * yes, i know that this scenario is \"incorrect\" but... it's possible and \n>   therefore i think it should be somehow handled - i tried a similar one\n>   with hg and bzr and i like their behaviour more\n\nIIRC we strongly discourage in documentation to push into checked out\nbranch. Either use bare repository for communication (it allows for\nexample for got for \"ideal patch series\" by rewriting history _before\npublishing (pushing)_ and for communication with more than one\nchosen developer), or push into _remotes_, not into heads.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"61054","messageId":"200711271231.51270.gapon007@gmail.com","threadId":"11030","inReplyTo":"81b0412b0711270321q6f70554at177ade878448b9fc@mail.gmail.com","subject":"Re: git bug/feature request","fromName":"gapon","fromEmail":"gapon007@gmail.com","sentAt":"2007-11-27T11:31:51Z","receivedAt":"2007-11-27T11:31:51Z","isPatch":false,"sender":{"key":"gapon007@gmail.com","avatar":null},"body":"as i wrote in my first email - i know that this is not \"correct\" scenario (i \ndon't and won't use it anywhere) - but the git's behaviour is in such case \nconfusing, at least for me\njust for clarification - my email wasn't about how to push or create shared \nrepository - it was just about what i have discovered while playing with \ndifferent scms\n\ngapon\n\n\nDne úterý 27 listopadu 2007 Alex Riesen napsal(a):\n> On 27/11/2007, gapon <gapon007@gmail.com> wrote:\n> > hi all,\n> > first of all i don't know if there's a bugzilla or something similar for\n> > git - i have found just this email (on http://git.or.cz/ webpage).\n> >\n> > i have discovered \"weird\" behaviour of git in this scenario*:\n> > - user A is working in repo A\n> > - user B clones repo A\n> > - user B makes some changes, commits, pushes\n> > - user A makes some changes, git status (no info about new commit in his\n> > repo from user B but it's probably ok i'd say - but some of my files are\n> > marked as changed and already added to index  but i haven't changed them\n> > - that's confusing, isn't it?)\n> > - user A can commit his changes => shouldn't be there any\n> > info/message/warning displayed? it would be helpful to have here some\n> > info about \"foreign commit\" in the repo or something like this\n>\n> If you share a repository with someone else, you better use different\n> branches. What's happened is that user B changed the branch the\n> user A was working on (strictly speaking, the B-user changed the\n> reference A-user used as HEAD at the moment).\n>\n> Just have the B-user push his/hers changes on something else,\n> not the master of the parent repository. For instance, B-user can\n> add a \"push\"-line to his origin remote which redirects its pushes\n> somewhere else:\n>\n>   git config remote.origin.push 'refs/heads/*:refs/heads/B-user/*'\n>\n> Or just use a dedicated shared repo where no one works in.\n> See also Documentation/config.txt, and the man page of git-push.\n"},{"id":"61058","messageId":"fih0cd$d31$1@ger.gmane.org","threadId":"11030","inReplyTo":"200711271216.25283.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-27T11:51:41Z","receivedAt":"2007-11-27T11:51:41Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[Cc: git@vger.kernel.org, gapon <gapon007@gmail.com>, \n Benoit Sigoure <tsuna@lrde.epita.fr>]\n\nCould you _please_ do not toppost?\n\ngapon wrote:\n\n> Dne úterý 27 listopadu 2007 Benoit Sigoure napsal(a):\n>> On Nov 27, 2007, at 11:27 AM, gapon wrote:\n>> > * yes, i know that this scenario is \"incorrect\" but... it's\n>> > possible and\n>> > therefore i think it should be somehow handled - i tried a similar\n>> > one with\n>> > hg and bzr and i like their behaviour more\n>>\n>> Would you mind describing the behavior of hg and bzr in this case?\n[...]\n>\n> bzr:\n> while pushing, bzr tries to merge into the current working copy (of A)\n> -> all changes are applied or conflicts occure\n\nThat's wrong, wrong, WRONG! What to do in the case of conflicts?\nWhan you pull, you can resolve them, as they are on your local side,\nbut when you push you cannot do that.\n\n> hg:\n> while pushing, neither merge nor info message, but new head (branch) is \n> created in repo A - so then in A you can commit your changes but it's \n> different head (repo A has more heads, use hg heads to list them)\n> btw i filed and enhancement for hg, to let user know that there are more heads \n> in the repo (you have to use hg log or hg heads to discover that someone else \n> has pushed into your repo and hg merge to merge them) \n\nThat is also wrong: how do you decide name of new branch then, and\nwoundn't this lead to proliferation of branches?\n\nYou can do the same with git, but you have to specify new branch name\nin repo A, or just configure remote in repo B.\n\nBTW. how do you want for user A (which might be not at terminal, or might\nbe not logged in, or might use some application using terminal, or might\nuse multiple [virtual] terminals, or...) to be informed?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"61064","messageId":"200711271350.38468.gapon007@gmail.com","threadId":"11030","inReplyTo":"fih0cd$d31$1@ger.gmane.org","subject":"Re: git bug/feature request","fromName":"gapon","fromEmail":"gapon007@gmail.com","sentAt":"2007-11-27T12:50:38Z","receivedAt":"2007-11-27T12:50:38Z","isPatch":false,"sender":{"key":"gapon007@gmail.com","avatar":null},"body":"Dne úterý 27 listopadu 2007 Jakub Narebski napsal(a):\n> [Cc: git@vger.kernel.org, gapon <gapon007@gmail.com>,\n>  Benoit Sigoure <tsuna@lrde.epita.fr>]\n>\n> Could you _please_ do not toppost?\n\nsure, no problem ;)\n>\n> gapon wrote:\n> > Dne úterý 27 listopadu 2007 Benoit Sigoure napsal(a):\n> >> On Nov 27, 2007, at 11:27 AM, gapon wrote:\n> >> > * yes, i know that this scenario is \"incorrect\" but... it's\n> >> > possible and\n> >> > therefore i think it should be somehow handled - i tried a similar\n> >> > one with\n> >> > hg and bzr and i like their behaviour more\n> >>\n> >> Would you mind describing the behavior of hg and bzr in this case?\n>\n> [...]\n>\n> > bzr:\n> > while pushing, bzr tries to merge into the current working copy (of A)\n> > -> all changes are applied or conflicts occure\n>\n> That's wrong, wrong, WRONG! What to do in the case of conflicts?\n> Whan you pull, you can resolve them, as they are on your local side,\n> but when you push you cannot do that.\n\ni agree - i didn't say that it's correct behaviour - i just said that i like \nit more than git's one\n>\n> > hg:\n> > while pushing, neither merge nor info message, but new head (branch) is\n> > created in repo A - so then in A you can commit your changes but it's\n> > different head (repo A has more heads, use hg heads to list them)\n> > btw i filed and enhancement for hg, to let user know that there are more\n> > heads in the repo (you have to use hg log or hg heads to discover that\n> > someone else has pushed into your repo and hg merge to merge them)\n>\n> That is also wrong: how do you decide name of new branch then, and\n> woundn't this lead to proliferation of branches?\n\ni don't agree that it's wrong - in the hg log all you see is that the commit \nfrom repo B has different parent - that's all\nif hg status (or similar) printed some info about this situation it would be \nenough i would say - but just my opinion/feeling of course\n>\n> You can do the same with git, but you have to specify new branch name\n> in repo A, or just configure remote in repo B.\n\nhow can i do it in repo A? i know how to configure repo B but i didn't know \nthat i can do it for repo B (or better for all \"B\" repos)\n>\n> BTW. how do you want for user A (which might be not at terminal, or might\n> be not logged in, or might use some application using terminal, or might\n> use multiple [virtual] terminals, or...) to be informed?\n\nquite easily i would say - while doing git status or git commit or so - it \ndoesn't matter if one uses terminal or gui - just let user know that \nsomething has changed in his repo\nas i wrote earlier - it's confusing (at least for me) that git marks any files \nas changed (i haven't changed any file) and more, it adds them to the index\n"},{"id":"61066","messageId":"81b0412b0711270503s7e69be3bn151cfa58b8067f35@mail.gmail.com","threadId":"11030","inReplyTo":"200711271231.51270.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-11-27T13:03:44Z","receivedAt":"2007-11-27T13:03:44Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 27/11/2007, gapon <gapon007@gmail.com> wrote:\n> as i wrote in my first email - i know that this is not \"correct\" scenario (i\n> don't and won't use it anywhere) - but the git's behaviour is in such case\n> confusing, at least for me\n> just for clarification - my email wasn't about how to push or create shared\n> repository - it was just about what i have discovered while playing with\n> different scms\n\nWell... It is known problem, for one. That user B of yours, did he just cloned\nuser A's repo?\n\nWhat I suspect is a change in how git-clone setups the cloned repo\ncould have taken care of it. We could either setup push-configuration\nso that it just does not work (and let user change to his preference),\nor somehow figure out where the pushed references can safely land\nand put that in the cloned repo configuration (that is \"SOMEHOW\",\nI afraid. Absolutely no idea what could that be).\n"},{"id":"61068","messageId":"200711271431.21516.jnareb@gmail.com","threadId":"11030","inReplyTo":"200711271350.38468.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-27T13:31:21Z","receivedAt":"2007-11-27T13:31:21Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Dnia wtorek 27. listopada 2007, gapon napisał(a):\n> Dne úterý 27 listopadu 2007 Jakub Narebski napsal(a):\n>> gapon wrote:\n\n>>> bzr:\n>>> while pushing, bzr tries to merge into the current working copy (of A)\n>>> -> all changes are applied or conflicts occure\n>>\n>> That's wrong, wrong, WRONG! What to do in the case of conflicts?\n>> Whan you pull, you can resolve them, as they are on your local side,\n>> but when you push you cannot do that.\n> \n> i agree - i didn't say that it's correct behaviour - i just said that i like \n> it more than git's one\n\nI think it is just wrong and it is hardly any other be worse.\nBy the way, don't current git _refuse_ to update checked out branch?\n\n>>> hg:\n>>> while pushing, neither merge nor info message, but new head (branch) is\n>>> created in repo A - so then in A you can commit your changes but it's\n>>> different head (repo A has more heads, use hg heads to list them)\n[...]\n>> You can do the same with git, but you have to specify new branch name\n>> in repo A, or just configure remote in repo B.\n> \n> how can i do it in repo A? i know how to configure repo B but i didn't know \n> that i can do it for repo B (or better for all \"B\" repos)\n\ngit-clone sets up repo B (the clone) for one direction of transfer,\nfrom repo A (cloned repo) to repo B (the clone). If you want to push\nto repo A, you should configure repo B to do so.\n\nSee also comments below.\n\n>> BTW. how do you want for user A (which might be not at terminal, or might\n>> be not logged in, or might use some application using terminal, or might\n>> use multiple [virtual] terminals, or...) to be informed?\n> \n> quite easily i would say - while doing git status or git commit or so - it \n> doesn't matter if one uses terminal or gui - just let user know that \n> something has changed in his repo\n\nThere was an idea, and even preliminary implementation in 'pu' branch\n(proposed updates) to have BASE extension in the index (or in refs,\nI don't remember exactly: search the archives), and check when committing\nif for example push didn't change the repository, didin't advance current\nchecked out branch under our feet so to say. This allowed for the behavior\nyou want.\n\nIt was abandoned, for the following reasons as far as I know.\n\nFirst, there are legitimate situations, created by current user, where\nbranch (HEAD) changes: reset, amend, checkout -m, etc. It would be hard\nto avoid annoing false positives (false alarms).\n\nSecond, it was complicated to do correctly, as it affected quite a bit\nof git codebase.\n\nThird, it encourages a wrong (CVS braindamage inspired) workflow. The last\nthing you want when committing changes is to have to resolve some\nconflicts, and/or check if [automatic] conflict resolution is correct.\nBlind merging is a bad, bad idea.\n\n> as i wrote earlier - it's confusing (at least for me) that git marks any files \n> as changed (i haven't changed any file) and more, it adds them to the index\n\nYou are welcome to ressurect BASE extension to index file :-)\n\n-- \nJakub Narebski\nPoland\n"},{"id":"61069","messageId":"200711271438.57950.jnareb@gmail.com","threadId":"11030","inReplyTo":"200711271431.21516.jnareb@gmail.com","subject":"Re: git bug/feature request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-27T13:38:57Z","receivedAt":"2007-11-27T13:38:57Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jakub Narebski wrote:\n\n> git-clone sets up repo B (the clone) for one direction of transfer,\n> from repo A (cloned repo) to repo B (the clone). If you want to push\n> to repo A, you should configure repo B to do so.\n> \n> See also comments below.\n\nWhat I forgot to add that git encourages \"with integrator\" workflows:\neither send requests to pull to project maintainer, or send patches\n(which allow peer review of them) to maintainer, perhaps via public\nproject mailing list.\n\nYou can do \"centralized repository\" or \"peer to peer\" aka \"star\ntopology\" workflows, but it is not optimized for those workflows;\nyou have to work a bit harder.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"61071","messageId":"200711271445.47695.gapon007@gmail.com","threadId":"11030","inReplyTo":"81b0412b0711270503s7e69be3bn151cfa58b8067f35@mail.gmail.com","subject":"Re: git bug/feature request","fromName":"gapon","fromEmail":"gapon007@gmail.com","sentAt":"2007-11-27T13:45:47Z","receivedAt":"2007-11-27T13:45:47Z","isPatch":false,"sender":{"key":"gapon007@gmail.com","avatar":null},"body":"Dne úterý 27 listopadu 2007 Alex Riesen napsal(a):\n> On 27/11/2007, gapon <gapon007@gmail.com> wrote:\n> > as i wrote in my first email - i know that this is not \"correct\" scenario\n> > (i don't and won't use it anywhere) - but the git's behaviour is in such\n> > case confusing, at least for me\n> > just for clarification - my email wasn't about how to push or create\n> > shared repository - it was just about what i have discovered while\n> > playing with different scms\n>\n> Well... It is known problem, for one. That user B of yours, did he just\n> cloned user A's repo?\n\nyes, i can paste here all the scenario step by step if you want\n>\n> What I suspect is a change in how git-clone setups the cloned repo\n> could have taken care of it. We could either setup push-configuration\n> so that it just does not work (and let user change to his preference),\n> or somehow figure out where the pushed references can safely land\n> and put that in the cloned repo configuration (that is \"SOMEHOW\",\n> I afraid. Absolutely no idea what could that be).\n\nhard to say what to do, what is correct - now i would say that i like hg \nbehaviour the most - but i can be wrong of course; the only purpose of this \ndiscussion is that i have found out (by accident ;) \"weird\" behaviour of git \nin such situation - and because git is definitely my most favorite scm i \nwanted to report bug/feature/whatever\n\nthanks for all your comments guys\n"},{"id":"61073","messageId":"200711271506.14980.gapon007@gmail.com","threadId":"11030","inReplyTo":"200711271431.21516.jnareb@gmail.com","subject":"Re: git bug/feature request","fromName":"gapon","fromEmail":"gapon007@gmail.com","sentAt":"2007-11-27T14:06:14Z","receivedAt":"2007-11-27T14:06:14Z","isPatch":false,"sender":{"key":"gapon007@gmail.com","avatar":null},"body":"Dne úterý 27 listopadu 2007 Jakub Narebski napsal(a):\n> Dnia wtorek 27. listopada 2007, gapon napisał(a):\n> > Dne úterý 27 listopadu 2007 Jakub Narebski napsal(a):\n> >> gapon wrote:\n> >>> bzr:\n> >>> while pushing, bzr tries to merge into the current working copy (of A)\n> >>> -> all changes are applied or conflicts occure\n> >>\n> >> That's wrong, wrong, WRONG! What to do in the case of conflicts?\n> >> Whan you pull, you can resolve them, as they are on your local side,\n> >> but when you push you cannot do that.\n> >\n> > i agree - i didn't say that it's correct behaviour - i just said that i\n> > like it more than git's one\n>\n> I think it is just wrong and it is hardly any other be worse.\n> By the way, don't current git _refuse_ to update checked out branch?\n\nwhat do you mean exactly? i will try it\n>\n> >>> hg:\n> >>> while pushing, neither merge nor info message, but new head (branch) is\n> >>> created in repo A - so then in A you can commit your changes but it's\n> >>> different head (repo A has more heads, use hg heads to list them)\n>\n> [...]\n>\n> >> You can do the same with git, but you have to specify new branch name\n> >> in repo A, or just configure remote in repo B.\n> >\n> > how can i do it in repo A? i know how to configure repo B but i didn't\n> > know that i can do it for repo B (or better for all \"B\" repos)\n>\n> git-clone sets up repo B (the clone) for one direction of transfer,\n> from repo A (cloned repo) to repo B (the clone). If you want to push\n> to repo A, you should configure repo B to do so.\n>\n> See also comments below.\n>\n> >> BTW. how do you want for user A (which might be not at terminal, or\n> >> might be not logged in, or might use some application using terminal, or\n> >> might use multiple [virtual] terminals, or...) to be informed?\n> >\n> > quite easily i would say - while doing git status or git commit or so -\n> > it doesn't matter if one uses terminal or gui - just let user know that\n> > something has changed in his repo\n>\n> There was an idea, and even preliminary implementation in 'pu' branch\n> (proposed updates) to have BASE extension in the index (or in refs,\n> I don't remember exactly: search the archives), and check when committing\n> if for example push didn't change the repository, didin't advance current\n> checked out branch under our feet so to say. This allowed for the behavior\n> you want.\n>\n> It was abandoned, for the following reasons as far as I know.\n>\n> First, there are legitimate situations, created by current user, where\n> branch (HEAD) changes: reset, amend, checkout -m, etc. It would be hard\n> to avoid annoing false positives (false alarms).\n>\n> Second, it was complicated to do correctly, as it affected quite a bit\n> of git codebase.\n>\n> Third, it encourages a wrong (CVS braindamage inspired) workflow. The last\n> thing you want when committing changes is to have to resolve some\n> conflicts, and/or check if [automatic] conflict resolution is correct.\n> Blind merging is a bad, bad idea.\n>\n> > as i wrote earlier - it's confusing (at least for me) that git marks any\n> > files as changed (i haven't changed any file) and more, it adds them to\n> > the index\n>\n> You are welcome to ressurect BASE extension to index file :-)\n\njakub, thanks for explanation - now it's clear that it's not easy to handle \nsuch case... unfortunately\n"},{"id":"61079","messageId":"Pine.LNX.4.64.0711271531110.1011@ds9.cixit.se","threadId":"11030","inReplyTo":"200711271127.41161.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Peter Karlsson","fromEmail":"peter@softwolves.pp.se","sentAt":"2007-11-27T14:35:19Z","receivedAt":"2007-11-27T14:35:19Z","isPatch":false,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"gapon:\n\n> i have discovered \"weird\" behaviour of git in this scenario*:\n\nYeah, I have run into it several times myself, and that is being both\nuser A and B at the same time. The problem seems to be that git allows\nyou to push into a repository which has a check-out, causing it to\nchange states in a subtle way. That's just plain broken.\n\nGit should either handle it somehow (perhaps by forcing the push into a\nnew branch, which the pushee needs name), or just plainly refuse to\npush into a repository with a check-out.\n\nI have learned to work around this problem by always pulling between my\nrepositories, not pulling. I could probably have worked around it by\nhaving a master repository that is bare, but I have found that\ndifficult because I am tracking an upstream non-Git repository, so to\npush and pull changes from that, I need a repository where I can have a\ncheck-out.\n\n> * yes, i know that this scenario is \"incorrect\" but... it's possible\n> and therefore i think it should be somehow handled - i tried a\n> similar one with hg and bzr and i like their behaviour more\n\nYeah. It's even more irritating that recovering from the error state is\ndifficult as well.\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"61081","messageId":"85prxvda7z.fsf@lola.goethe.zz","threadId":"11030","inReplyTo":"Pine.LNX.4.64.0711271531110.1011@ds9.cixit.se","subject":"Re: git bug/feature request","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-11-27T14:38:56Z","receivedAt":"2007-11-27T14:38:56Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Peter Karlsson <peter@softwolves.pp.se> writes:\n\n> I have learned to work around this problem by always pulling between\n> my repositories, not pulling.\n\nUhm...\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"},{"id":"61088","messageId":"fihc5u$mbs$1@ger.gmane.org","threadId":"11030","inReplyTo":"Pine.LNX.4.64.0711271531110.1011@ds9.cixit.se","subject":"Re: git bug/feature request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-27T15:13:03Z","receivedAt":"2007-11-27T15:13:03Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Peter Karlsson wrote:\n\n> gapon:\n> \n>> i have discovered \"weird\" behaviour of git in this scenario*:\n> \n> Yeah, I have run into it several times myself, and that is being both\n> user A and B at the same time. The problem seems to be that git allows\n> you to push into a repository which has a check-out, causing it to\n> change states in a subtle way. That's just plain broken.\n> \n> Git should either handle it somehow (perhaps by forcing the push into a\n> new branch, which the pushee needs name), or just plainly refuse to\n> push into a repository with a check-out.\n\nI thought that modern git refuses to push into checked out branch\n(in HEAD) in non-bare repositories. In shared repositories default\nis to deny non-fastforwards, by the way.\n\n> I have learned to work around this problem by always pulling between my\n> repositories, not pushing.\n\nYou can simply push to remotes, allowing other person to merge\non other side.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"61099","messageId":"81b0412b0711270836g775796c0mfeb76191dc78762d@mail.gmail.com","threadId":"11030","inReplyTo":"200711271445.47695.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-11-27T16:36:12Z","receivedAt":"2007-11-27T16:36:12Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 27/11/2007, gapon <gapon007@gmail.com> wrote:\n> > Well... It is known problem, for one. That user B of yours, did he just\n> > cloned user A's repo?\n>\n> yes, i can paste here all the scenario step by step if you want\n\nNo, thanks. It is easy to reproduce\n"},{"id":"61117","messageId":"FA6B0BE9-FC43-4298-932F-627826ADE18F@midwinter.com","threadId":"11030","inReplyTo":"fihc5u$mbs$1@ger.gmane.org","subject":"Re: git bug/feature request","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-11-27T19:49:57Z","receivedAt":"2007-11-27T19:49:57Z","isPatch":false,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"On Nov 27, 2007, at 7:13 AM, Jakub Narebski wrote:\n> I thought that modern git refuses to push into checked out branch\n> (in HEAD) in non-bare repositories.\n\nIt doesn't -- otherwise the \"update the working copy when a push to  \nthe current branch comes in\" update hook scripts that some of us use  \nwouldn't work, and they do work at the moment. (Before anyone warns me  \nof the dangers of that: the hook only runs in a shared repo that no  \nhuman is allowed to modify, so the working copy is always a clean  \nversion of HEAD and thus is safe to update.)\n\n-Steve\n"},{"id":"61118","messageId":"Pine.LNX.4.64.0711271514180.5349@iabervon.org","threadId":"11030","inReplyTo":"FA6B0BE9-FC43-4298-932F-627826ADE18F@midwinter.com","subject":"Re: git bug/feature request","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-11-27T20:19:42Z","receivedAt":"2007-11-27T20:19:42Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 27 Nov 2007, Steven Grimm wrote:\n\n> On Nov 27, 2007, at 7:13 AM, Jakub Narebski wrote:\n> >I thought that modern git refuses to push into checked out branch\n> >(in HEAD) in non-bare repositories.\n> \n> It doesn't -- otherwise the \"update the working copy when a push to the\n> current branch comes in\" update hook scripts that some of us use wouldn't\n> work, and they do work at the moment. (Before anyone warns me of the dangers\n> of that: the hook only runs in a shared repo that no human is allowed to\n> modify, so the working copy is always a clean version of HEAD and thus is safe\n> to update.)\n\nIt could require the working copy to be a clean version of HEAD, and, in \nthis case, update it. Then it would always be kept consistent one way or \nthe other, without consistency depending on the use of a hook. (This is \nlike how a pre-refs/remotes/ pull into a checked-out origin was handled, \nand it seemed reliable there)\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"61119","messageId":"Pine.LNX.4.64.0711271519450.5349@iabervon.org","threadId":"11030","inReplyTo":"200711271127.41161.gapon007@gmail.com","subject":"Re: git bug/feature request","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-11-27T20:34:52Z","receivedAt":"2007-11-27T20:34:52Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 27 Nov 2007, gapon wrote:\n\n> hi all,\n> first of all i don't know if there's a bugzilla or something similar for git - \n> i have found just this email (on http://git.or.cz/ webpage).\n> \n> i have discovered \"weird\" behaviour of git in this scenario*:\n> - user A is working in repo A\n> - user B clones repo A\n> - user B makes some changes, commits, pushes\n> - user A makes some changes, git status (no info about new commit in his repo \n> from user B but it's probably ok i'd say - but some of my files are marked as \n> changed and already added to index  but i haven't changed them - that's \n> confusing, isn't it?)\n> - user A can commit his changes => shouldn't be there any info/message/warning \n> displayed? it would be helpful to have here some info about \"foreign commit\" \n> in the repo or something like this\n\nThis is kind of a fundamentally crazy thing to do; it's like a CVS user \ncommitting to somebody else's working directory instead of to the central \nrepository. As you might expect, the system is confused because the info \nof what version is checked out is changed without the checked-out files \ngetting changed. This should probably be kept from happening in some \nfashion, not reported to the user after the fact.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"61194","messageId":"Pine.LNX.4.64.0711281429520.17280@ds9.cixit.se","threadId":"11030","inReplyTo":"85prxvda7z.fsf@lola.goethe.zz","subject":"Re: git bug/feature request","fromName":"Peter Karlsson","fromEmail":"peter@softwolves.pp.se","sentAt":"2007-11-28T13:30:13Z","receivedAt":"2007-11-28T13:30:13Z","isPatch":false,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"David Kastrup:\n\n> > I have learned to work around this problem by always pulling between\n> > my repositories, not pulling.\n> Uhm...\n\n\"...not *pushing*\", obviously. Sorry :-)\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"61514","messageId":"20071130182121.GC30048@efreet.light.src","threadId":"11030","inReplyTo":"figv47$926$1@ger.gmane.org","subject":"Re: git bug/feature request","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-11-30T18:21:21Z","receivedAt":"2007-11-30T18:21:21Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Tue, Nov 27, 2007 at 12:30:16 +0100, Jakub Narebski wrote:\n> gapon wrote:\n> \n> > hi all,\n> > first of all i don't know if there's a bugzilla or something similar\n> > for git - i have found just this email (on http://git.or.cz/ webpage).\n> \n> There isn't any bug tracker for git. Use git mailing list for bug\n> reports and feature requests.\n> \n> > i have discovered \"weird\" behaviour of git in this scenario*:\n> > - user A is working in repo A\n> > - user B clones repo A\n> > - user B makes some changes, commits, pushes\n> \n> Do not push into checked out branch!\n\nPush is the only non-local operation, that could break the checked out state,\nright? Than it should be possible to add a check that a push is trying to\nchange the checked-out ref and detach the HEAD if so.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"}]}