{"thread":{"id":"38580","subject":"Lift --stdout restriction for using reachability bitmap in pack-objects?","startedAt":"2015-02-17T10:07:36Z","lastAt":"2015-02-19T00:09:22Z","messageCount":5,"participants":["Duy Nguyen","Jeff King","Kyle J. McKay"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"256190","messageId":"CACsJy8AC5ZcsB2_qS4k-+6fJt2_e7m=o8C9UAEcywh=P_4HXAw@mail.gmail.com","threadId":"38580","inReplyTo":null,"subject":"Lift --stdout restriction for using reachability bitmap in pack-objects?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-02-17T10:07:36Z","receivedAt":"2015-02-17T10:07:36Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Commit 6b8fda2 (pack-objects: use bitmaps when packing objects -\n2013-12-21) turns off reachability bitmap optimization if --stdout is\nnot specified. I wonder if we could lift this restriction?\n\nMy use case is debugging pack-objects in gdb (repeatedly) where this\noptimization could really save time. But specifying --stdout would\nclutter gdb interface.. I don't know this code well enough to judge,\nbut I think the worst thing is we don't write .idx file out (maybe\nbecause it would involve a lot more work).\n-- \nDuy\n"},{"id":"256192","messageId":"20150217101344.GA5343@peff.net","threadId":"38580","inReplyTo":"CACsJy8AC5ZcsB2_qS4k-+6fJt2_e7m=o8C9UAEcywh=P_4HXAw@mail.gmail.com","subject":"Re: Lift --stdout restriction for using reachability bitmap in pack-objects?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-02-17T10:13:44Z","receivedAt":"2015-02-17T10:13:44Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 17, 2015 at 05:07:36PM +0700, Duy Nguyen wrote:\n\n> Commit 6b8fda2 (pack-objects: use bitmaps when packing objects -\n> 2013-12-21) turns off reachability bitmap optimization if --stdout is\n> not specified. I wonder if we could lift this restriction?\n\nI'm not sure what else would break if we did. For instance, would\nbitmaps kick in when doing the \"Counting objects\" phase of \"git repack\n-ad\". And if so, what would the resulting pack look like?\n\nSo I'm not opposed to it in principle, but I suspect there's some\ncleanup work to be done. But...\n\n> My use case is debugging pack-objects in gdb (repeatedly) where this\n> optimization could really save time. But specifying --stdout would\n> clutter gdb interface.. I don't know this code well enough to judge,\n> but I think the worst thing is we don't write .idx file out (maybe\n> because it would involve a lot more work).\n\nIf the only reason is for gdb, then perhaps:\n\n  set args pack-objects --stdout </dev/null >/dev/null\n\nin gdb would help?\n\n-Peff\n"},{"id":"256193","messageId":"CACsJy8C=MC2xVbkXE-RBcLtcn0yEX4iqBLjgOw+M0iK5n-Kyhw@mail.gmail.com","threadId":"38580","inReplyTo":"20150217101344.GA5343@peff.net","subject":"Re: Lift --stdout restriction for using reachability bitmap in pack-objects?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-02-17T10:36:30Z","receivedAt":"2015-02-17T10:36:30Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Feb 17, 2015 at 5:13 PM, Jeff King <peff@peff.net> wrote:\n> If the only reason is for gdb, then perhaps:\n>\n>   set args pack-objects --stdout </dev/null >/dev/null\n>\n> in gdb would help?\n\nRight. I used \"gdb --args command >/dev/null\" instead. Stupid\nquestion. Sorry for the noise.\n-- \nDuy\n"},{"id":"256194","messageId":"20150217104228.GA26301@peff.net","threadId":"38580","inReplyTo":"CACsJy8C=MC2xVbkXE-RBcLtcn0yEX4iqBLjgOw+M0iK5n-Kyhw@mail.gmail.com","subject":"Re: Lift --stdout restriction for using reachability bitmap in pack-objects?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-02-17T10:42:29Z","receivedAt":"2015-02-17T10:42:29Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 17, 2015 at 05:36:30PM +0700, Duy Nguyen wrote:\n\n> On Tue, Feb 17, 2015 at 5:13 PM, Jeff King <peff@peff.net> wrote:\n> > If the only reason is for gdb, then perhaps:\n> >\n> >   set args pack-objects --stdout </dev/null >/dev/null\n> >\n> > in gdb would help?\n> \n> Right. I used \"gdb --args command >/dev/null\" instead. Stupid\n> question. Sorry for the noise.\n\nI've made the same mistake myself many times. I really wish gdb would\ninteract over /dev/tty by default. The perl debugger does this, and I\nfind it quite handy. But I've never managed to make gdb do it. Maybe\nthere is an option I've missed[1].\n\nThe downside of what approach, though, is that you cannot restart the\nprogram reliably from within the debugger (it cannot know how to\nre-set-up the descriptors). So you have to quit and restart, which loses\nany breakpoints, etc.\n\n-Peff\n\n[1] Having written that, I'm not sure I ever tried a script that does\n    something like:\n\n      program=$1; shift\n      exec 3<&0\n      exec 4>&1\n      gdb </dev/tty >/dev/tty -ex \"set args <&3 >&4 gdb $*\" \"$program\"\n\n    I think that would work, but it does screw up quoting/whitespace in\n    your arguments.\n"},{"id":"256325","messageId":"59A24487-0FAC-4E02-B019-8EBCD9306A47@gmail.com","threadId":"38580","inReplyTo":"20150217104228.GA26301@peff.net","subject":"Re: Lift --stdout restriction for using reachability bitmap in pack-objects?","fromName":"Kyle J. McKay","fromEmail":"mackyle@gmail.com","sentAt":"2015-02-19T00:09:22Z","receivedAt":"2015-02-19T00:09:22Z","isPatch":false,"sender":{"key":"mackyle@gmail.com","avatar":"https://avatars.githubusercontent.com/u/813346?v=4"},"body":"On Feb 17, 2015, at 02:42, Jeff King wrote:\n\n> On Tue, Feb 17, 2015 at 05:36:30PM +0700, Duy Nguyen wrote:\n>\n>> On Tue, Feb 17, 2015 at 5:13 PM, Jeff King <peff@peff.net> wrote:\n>>> If the only reason is for gdb, then perhaps:\n>>>\n>>>  set args pack-objects --stdout </dev/null >/dev/null\n>>>\n>>> in gdb would help?\n>>\n>> Right. I used \"gdb --args command >/dev/null\" instead. Stupid\n>> question. Sorry for the noise.\n>\n> I've made the same mistake myself many times. I really wish gdb would\n> interact over /dev/tty by default. The perl debugger does this, and I\n> find it quite handy. But I've never managed to make gdb do it. Maybe\n> there is an option I've missed[1].\n\nYou may want to try cgdb.  It is a curses front-end to gdb.  I almost  \nnever run bare gdb anymore.  It has a source file pane (no more line- \nby-line), a gdb pane and, although a bit clumsy, a TTY pane (not shown  \nin the screen shot) that you can interact with the debuggee with.   \nIt's been around for a while, so debian-derived distros can usually  \njust `apt-get install cgdb`.  There's a screen shot available [1].\n\n-Kyle\n\n[1] http://cgdb.github.io/\n"}]}