git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Lift --stdout restriction for using reachability bitmap in pack-objects?
@ 2015-02-17 10:07 Duy Nguyen
  2015-02-17 10:13 ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Duy Nguyen @ 2015-02-17 10:07 UTC (permalink / raw)
  To: Vicent Marti, Jeff King; +Cc: Git Mailing List

Commit 6b8fda2 (pack-objects: use bitmaps when packing objects -
2013-12-21) turns off reachability bitmap optimization if --stdout is
not specified. I wonder if we could lift this restriction?

My use case is debugging pack-objects in gdb (repeatedly) where this
optimization could really save time. But specifying --stdout would
clutter gdb interface.. I don't know this code well enough to judge,
but I think the worst thing is we don't write .idx file out (maybe
because it would involve a lot more work).
-- 
Duy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Lift --stdout restriction for using reachability bitmap in pack-objects?
  2015-02-17 10:07 Lift --stdout restriction for using reachability bitmap in pack-objects? Duy Nguyen
@ 2015-02-17 10:13 ` Jeff King
  2015-02-17 10:36   ` Duy Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2015-02-17 10:13 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Vicent Marti, Git Mailing List

On Tue, Feb 17, 2015 at 05:07:36PM +0700, Duy Nguyen wrote:

> Commit 6b8fda2 (pack-objects: use bitmaps when packing objects -
> 2013-12-21) turns off reachability bitmap optimization if --stdout is
> not specified. I wonder if we could lift this restriction?

I'm not sure what else would break if we did. For instance, would
bitmaps kick in when doing the "Counting objects" phase of "git repack
-ad". And if so, what would the resulting pack look like?

So I'm not opposed to it in principle, but I suspect there's some
cleanup work to be done. But...

> My use case is debugging pack-objects in gdb (repeatedly) where this
> optimization could really save time. But specifying --stdout would
> clutter gdb interface.. I don't know this code well enough to judge,
> but I think the worst thing is we don't write .idx file out (maybe
> because it would involve a lot more work).

If the only reason is for gdb, then perhaps:

  set args pack-objects --stdout </dev/null >/dev/null

in gdb would help?

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Lift --stdout restriction for using reachability bitmap in pack-objects?
  2015-02-17 10:13 ` Jeff King
@ 2015-02-17 10:36   ` Duy Nguyen
  2015-02-17 10:42     ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Duy Nguyen @ 2015-02-17 10:36 UTC (permalink / raw)
  To: Jeff King; +Cc: Vicent Marti, Git Mailing List

On Tue, Feb 17, 2015 at 5:13 PM, Jeff King <peff@peff.net> wrote:
> If the only reason is for gdb, then perhaps:
>
>   set args pack-objects --stdout </dev/null >/dev/null
>
> in gdb would help?

Right. I used "gdb --args command >/dev/null" instead. Stupid
question. Sorry for the noise.
-- 
Duy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Lift --stdout restriction for using reachability bitmap in pack-objects?
  2015-02-17 10:36   ` Duy Nguyen
@ 2015-02-17 10:42     ` Jeff King
  2015-02-19  0:09       ` Kyle J. McKay
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2015-02-17 10:42 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Vicent Marti, Git Mailing List

On Tue, Feb 17, 2015 at 05:36:30PM +0700, Duy Nguyen wrote:

> On Tue, Feb 17, 2015 at 5:13 PM, Jeff King <peff@peff.net> wrote:
> > If the only reason is for gdb, then perhaps:
> >
> >   set args pack-objects --stdout </dev/null >/dev/null
> >
> > in gdb would help?
> 
> Right. I used "gdb --args command >/dev/null" instead. Stupid
> question. Sorry for the noise.

I've made the same mistake myself many times. I really wish gdb would
interact over /dev/tty by default. The perl debugger does this, and I
find it quite handy. But I've never managed to make gdb do it. Maybe
there is an option I've missed[1].

The downside of what approach, though, is that you cannot restart the
program reliably from within the debugger (it cannot know how to
re-set-up the descriptors). So you have to quit and restart, which loses
any breakpoints, etc.

-Peff

[1] Having written that, I'm not sure I ever tried a script that does
    something like:

      program=$1; shift
      exec 3<&0
      exec 4>&1
      gdb </dev/tty >/dev/tty -ex "set args <&3 >&4 gdb $*" "$program"

    I think that would work, but it does screw up quoting/whitespace in
    your arguments.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Lift --stdout restriction for using reachability bitmap in pack-objects?
  2015-02-17 10:42     ` Jeff King
@ 2015-02-19  0:09       ` Kyle J. McKay
  0 siblings, 0 replies; 5+ messages in thread
From: Kyle J. McKay @ 2015-02-19  0:09 UTC (permalink / raw)
  To: Jeff King; +Cc: Duy Nguyen, Vicent Marti, Git Mailing List

On Feb 17, 2015, at 02:42, Jeff King wrote:

> On Tue, Feb 17, 2015 at 05:36:30PM +0700, Duy Nguyen wrote:
>
>> On Tue, Feb 17, 2015 at 5:13 PM, Jeff King <peff@peff.net> wrote:
>>> If the only reason is for gdb, then perhaps:
>>>
>>>  set args pack-objects --stdout </dev/null >/dev/null
>>>
>>> in gdb would help?
>>
>> Right. I used "gdb --args command >/dev/null" instead. Stupid
>> question. Sorry for the noise.
>
> I've made the same mistake myself many times. I really wish gdb would
> interact over /dev/tty by default. The perl debugger does this, and I
> find it quite handy. But I've never managed to make gdb do it. Maybe
> there is an option I've missed[1].

You may want to try cgdb.  It is a curses front-end to gdb.  I almost  
never run bare gdb anymore.  It has a source file pane (no more line- 
by-line), a gdb pane and, although a bit clumsy, a TTY pane (not shown  
in the screen shot) that you can interact with the debuggee with.   
It's been around for a while, so debian-derived distros can usually  
just `apt-get install cgdb`.  There's a screen shot available [1].

-Kyle

[1] http://cgdb.github.io/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-02-19  0:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-17 10:07 Lift --stdout restriction for using reachability bitmap in pack-objects? Duy Nguyen
2015-02-17 10:13 ` Jeff King
2015-02-17 10:36   ` Duy Nguyen
2015-02-17 10:42     ` Jeff King
2015-02-19  0:09       ` Kyle J. McKay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).