{"thread":{"id":"28873","subject":"BUG. Git config pager when --edit","startedAt":"2011-11-07T13:26:52Z","lastAt":"2011-11-08T07:08:00Z","messageCount":9,"participants":["Alexey Shumkin","Frans Klaver","Emily","Konstantin Khomoutov","Jeff King","Emily Ren","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"179034","messageId":"20111107172652.0faade61@ashu.dyn.rarus.ru","threadId":"28873","inReplyTo":null,"subject":"BUG. Git config pager when --edit","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2011-11-07T13:26:52Z","receivedAt":"2011-11-07T13:26:52Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"Hello!\n\nI've found an annoying bug.\nWhen I wanna review my config I run\n$ git config --list\n\nWhen I wanna edit config I run\n$ git config --edit [--global]\n\nAs far as my config is large enough to be paged I set pager.config=less\nsetting. But since that moment when I run\n$ git config --edit\nI get \nVim: Warning: Output is not to a terminal\nAnd some messed config output\n\nThe same happens if to run\n$ vim .git/config | less\n\nCan anybody skilled enough fix it? :)\n"},{"id":"179035","messageId":"CAH6sp9Ox+6p4RkjCZ0j3tXG9F4u7SPuwbSrOWmLSXic9DxSKiQ@mail.gmail.com","threadId":"28873","inReplyTo":"20111107172652.0faade61@ashu.dyn.rarus.ru","subject":"Re: BUG. Git config pager when --edit","fromName":"Frans Klaver","fromEmail":"fransklaver@gmail.com","sentAt":"2011-11-07T13:43:41Z","receivedAt":"2011-11-07T13:43:41Z","isPatch":false,"sender":{"key":"fransklaver@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1876483?v=4"},"body":"Hi,\n\nOn Mon, Nov 7, 2011 at 2:26 PM, Alexey Shumkin <Alex.Crezoff@gmail.com> wrote:\n\n> As far as my config is large enough to be paged I set pager.config=less\n> setting. But since that moment when I run\n> $ git config --edit\n> I get\n> Vim: Warning: Output is not to a terminal\n> And some messed config output\n>\n> The same happens if to run\n> $ vim .git/config | less\n\nSo git is trying to tell vim to pipe its output to less. vim can't do\nthat because it needs a terminal, as it's the only way vim is usable.\n\nShould pager.config then only be used with --list?\n"},{"id":"179037","messageId":"8B3D19E0-2181-4E9C-943F-CA26A399E0D9@gmail.com","threadId":"28873","inReplyTo":"20111107172652.0faade61@ashu.dyn.rarus.ru","subject":"how to merge sub directory or file?","fromName":"Emily","fromEmail":"lingyan.ren@gmail.com","sentAt":"2011-11-07T14:54:18Z","receivedAt":"2011-11-07T14:54:18Z","isPatch":false,"sender":{"key":"lingyan.ren@gmail.com","avatar":null},"body":"Hi,\n\nI have two git projects A and B, content of B is subset of A. For example, Project  A and B's tree are as below:\n\nA\n--- dir1\n--- dir2\n--- dir3\n       |---file1\n       |---dir4\n       |---dir5\n--- dir6\n--- dir7\n\nB\n--- dir1\n--- dir3\n      |--- file1\n      |--- dir4\n\nWhen there's new changes in project A, how can I merge them to project B without changing B's directory structure?\n\nYour help will be highly appreciated.\n\nThanks,\nEmily\n"},{"id":"179038","messageId":"20111107193708.6cf2ae81.kostix@domain007.com","threadId":"28873","inReplyTo":"8B3D19E0-2181-4E9C-943F-CA26A399E0D9@gmail.com","subject":"Re: how to merge sub directory or file?","fromName":"Konstantin Khomoutov","fromEmail":"flatworm@users.sourceforge.net","sentAt":"2011-11-07T15:37:08Z","receivedAt":"2011-11-07T15:37:08Z","isPatch":false,"sender":{"key":"flatworm@users.sourceforge.net","avatar":null},"body":"On Mon, 7 Nov 2011 22:54:18 +0800\nEmily <lingyan.ren@gmail.com> wrote:\n\n> I have two git projects A and B, content of B is subset of A. For\n> example, Project  A and B's tree are as below:\n[...]\n> When there's new changes in project A, how can I merge them to\n> project B without changing B's directory structure?\n> \n> Your help will be highly appreciated.\nSubtree merging maybe?\nSee http://progit.org/book/ch6-7.html\n"},{"id":"179045","messageId":"20111107164250.GC27055@sigill.intra.peff.net","threadId":"28873","inReplyTo":"CAH6sp9Ox+6p4RkjCZ0j3tXG9F4u7SPuwbSrOWmLSXic9DxSKiQ@mail.gmail.com","subject":"Re: BUG. Git config pager when --edit","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-11-07T16:42:50Z","receivedAt":"2011-11-07T16:42:50Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 07, 2011 at 02:43:41PM +0100, Frans Klaver wrote:\n\n> > As far as my config is large enough to be paged I set pager.config=less\n> > setting. But since that moment when I run\n> > $ git config --edit\n> > I get\n> > Vim: Warning: Output is not to a terminal\n> > And some messed config output\n> >\n> > The same happens if to run\n> > $ vim .git/config | less\n> \n> So git is trying to tell vim to pipe its output to less. vim can't do\n> that because it needs a terminal, as it's the only way vim is usable.\n> \n> Should pager.config then only be used with --list?\n\nYes, but it can't, because it is not the config command, but the git\nwrapper that respects \"pager.config\". We have similar issues with\nsetting \"pager.tag\" (you want it for listing, but not for tag creation)\nand others.\n\nI should probably polish and submit the patch here:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/182238/focus=182475\n\n-Peff\n"},{"id":"293759","messageId":"7vpqh327ds.fsf@alter.siamese.dyndns.org","threadId":"28873","inReplyTo":"20111107164250.GC27055@sigill.intra.peff.net","subject":"Re: BUG. Git config pager when --edit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-11-07T17:02:23Z","receivedAt":"2011-11-07T17:02:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I should probably polish and submit the patch here:\n>\n>   http://thread.gmane.org/gmane.comp.version-control.git/182238/focus=182475\n\nI was actually hoping that you won't go that route, but the route to push\nfurther to decide/spawn pager as late as possible. Clearly no sane person\nwould want to run --edit subcommand under pager and \"pager.config = less\"\n"},{"id":"179051","messageId":"20111107171800.GA3621@sigill.intra.peff.net","threadId":"28873","inReplyTo":"7vpqh327ds.fsf@alter.siamese.dyndns.org","subject":"Re: BUG. Git config pager when --edit","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-11-07T17:18:00Z","receivedAt":"2011-11-07T17:18:00Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 07, 2011 at 09:02:23AM -0800, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > I should probably polish and submit the patch here:\n> >\n> >   http://thread.gmane.org/gmane.comp.version-control.git/182238/focus=182475\n> \n> I was actually hoping that you won't go that route, but the route to push\n> further to decide/spawn pager as late as possible. Clearly no sane person\n> would want to run --edit subcommand under pager and \"pager.config = less\"\n> should just be ignored in such a case.\n\nThe problem with that is that it dumps the responsibility for running\nthe pager to every subcommand. For builtins, we can have a flag that\nsays \"respect the pager.log config\" or \"foo will handle this itself;\ndon't respect pager.tag\".\n\nBut what about externals? If \"pager.stash\" does nothing in git.c, and\nleaves it to \"git-stash.sh\" to start the pager if and when it's\nappropriate, then what about my personal \"git-foo\" that I drop into my\nPATH? Now I can't use \"config.foo\" without carrying code to do so in my\nexternal command.\n\nMaybe that's an OK tradeoff. But it's more of a pain for existing\nscripts, and it's not backwards compatible. What do you think?\n\n-Peff\n"},{"id":"179073","messageId":"op.v4lfxck60aolir@keputer.lokaal","threadId":"28873","inReplyTo":"20111107171800.GA3621@sigill.intra.peff.net","subject":"Re: BUG. Git config pager when --edit","fromName":"Frans Klaver","fromEmail":"fransklaver@gmail.com","sentAt":"2011-11-07T20:45:02Z","receivedAt":"2011-11-07T20:45:02Z","isPatch":false,"sender":{"key":"fransklaver@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1876483?v=4"},"body":"On Mon, 07 Nov 2011 18:18:00 +0100, Jeff King <peff@peff.net> wrote:\n\n>> I was actually hoping that you won't go that route, but the route to  \n>> push\n>> further to decide/spawn pager as late as possible. Clearly no sane  \n>> person\n>> would want to run --edit subcommand under pager and \"pager.config =  \n>> less\"\n>> should just be ignored in such a case.\n>\n> The problem with that is that it dumps the responsibility for running\n> the pager to every subcommand. For builtins, we can have a flag that\n> says \"respect the pager.log config\" or \"foo will handle this itself;\n> don't respect pager.tag\".\n>\n> But what about externals? If \"pager.stash\" does nothing in git.c, and\n> leaves it to \"git-stash.sh\" to start the pager if and when it's\n> appropriate, then what about my personal \"git-foo\" that I drop into my\n> PATH? Now I can't use \"config.foo\" without carrying code to do so in my\n> external command.\n>\n> Maybe that's an OK tradeoff. But it's more of a pain for existing\n> scripts, and it's not backwards compatible. What do you think?\n\nFor both cases there's something to say. In any new design I might dump  \nthe responsibility on the external, but I would prefer to keep the  \ndecision logic centralized. But as I understand, removing the  \nresponsibility from git.c is going to require a whole bunch of other  \nchanges to get the pager functional again in the scripts. So if there is a  \nsomewhat decent way to be sure about whether or not to use the pager (i.e.  \nno editing) in git.c, why not keep it there? If, on the other hand, the  \ncode is going to turn out to be a big hack, I'd say move it out.\n\nFrans\n"},{"id":"179126","messageId":"CAP_m3yKehN1-KtMCVxKdu2ca59GzYE0w2X2=UhH2X9PgzYiMAg@mail.gmail.com","threadId":"28873","inReplyTo":"20111107193708.6cf2ae81.kostix@domain007.com","subject":"Re: how to merge sub directory or file?","fromName":"Emily Ren","fromEmail":"lingyan.ren@gmail.com","sentAt":"2011-11-08T07:08:00Z","receivedAt":"2011-11-08T07:08:00Z","isPatch":false,"sender":{"key":"lingyan.ren@gmail.com","avatar":null},"body":"Hi Kon,\n\nThank you !  I tried that method, it failed on read-tree because\nB/dir3 already exists, Cannot bind.\n\n$ git read-tree --prefix=dir3 -u A:dir3\nerror: Entry 'dir3/file1' overlaps with 'dir3/file1'.  Cannot bind.\n\nAnd my case is that not all A's sub direcotries are in B.\nFor example, in A's dir3, there are file1, dir4 and dir5. But in B's\ndir3, only file1 and dir4 exist, there's no dir5. How to handle this\ncase ?\n\nThanks,\nEmily\n\nOn Mon, Nov 7, 2011 at 11:37 PM, Konstantin Khomoutov\n<flatworm@users.sourceforge.net> wrote:\n>\n> On Mon, 7 Nov 2011 22:54:18 +0800\n> Emily <lingyan.ren@gmail.com> wrote:\n>\n> > I have two git projects A and B, content of B is subset of A. For\n> > example, Project  A and B's tree are as below:\n> [...]\n> > When there's new changes in project A, how can I merge them to\n> > project B without changing B's directory structure?\n> >\n> > Your help will be highly appreciated.\n> Subtree merging maybe?\n> See http://progit.org/book/ch6-7.html\n"}]}