git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Gargi Sharma <gs051095@gmail.com>
Cc: git@vger.kernel.org, "Оля Тележная" <olyatelezhnaya@gmail.com>
Subject: Re: [PATCH] mru: Replace mru.[ch] with list.h implementation
Date: Sun, 12 Nov 2017 16:16:18 +0000	[thread overview]
Message-ID: <20171112161617.fhysws3idztguu23@sigill.intra.peff.net> (raw)
In-Reply-To: <CAOCi2DGYQr4jFf5ObY2buyhNJeaAPQKF8tbojn2W0b18Eo+Wgw@mail.gmail.com>

On Sun, Nov 12, 2017 at 12:49:17PM +0000, Gargi Sharma wrote:

> > Sort of a side note, but seeing these two list pointers together makes
> > me wonder what we should do with the list created by the "next" pointer.
> > It seems like there are three options:
> >
> >   1. Convert it to "struct list_head", too, for consistency.
> >
> >   2. Leave it as-is. We never delete from the list nor do any fancy
> >      manipulation, so it doesn't benefit from the reusable code.
> >
> >   3. I wonder if we could drop it entirely, and just keep a single list
> >      of packs, ordered by mru. I'm not sure if anybody actually cares
> >      about accessing them in the "original" order. That order is
> >      reverse-chronological (by prepare_packed_git()), but I think that
> >      was mostly out of a sense that recent packs would be accessed more
> >      than older ones (but having a real mru strategy replaces that
> >      anyway).
> >
> > What do you think?
> I think in the long run, it'll be easier if there is only a single
> list of packs given
> that no one needs to access the list in order.

Yeah, it's that "given..." that makes me just a little nervous that I'm
missing something.

> If we go down road 1/3, would it be better if I sent an entirely
> different patch or
> a patch series with patch 1 as removing mru[.ch] and patch 2 as removing
> next pointer from the struct?

I think you could do it as a 2-patch series like that, or you could send
the first patch now (since I think it stands on its own merits) and do
the other one later on top.

> > This matches the original code, which did the clear/re-create, resetting
> > the mru to the "original" pack order. But I do wonder if that's actually
> > necessary. Could we skip that and just add any new packs to the list?
> 
> But if we do not clear the older entries from the list, wouldn't there be a
> problem when you access packed_git_mru->next, since that will be populated
> instead of being empty? Or am I misunderstanding something here?

What I mean is that instead of clearing and re-adding all of the packs
(including any new ones we picked up by rescanning the directory), we
would _just_ add new ones to the list.

So I think we'd scrap this whole "set up the mru" preparation here and
just teach install_packed_git() to add the new pack to the MRU list.

-Peff

  reply	other threads:[~2017-11-12 16:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-11 18:06 [PATCH] mru: Replace mru.[ch] with list.h implementation Gargi Sharma
2017-11-12  9:54 ` Jeff King
2017-11-12  9:59   ` Jeff King
2017-11-12 12:49   ` Gargi Sharma
2017-11-12 16:16     ` Jeff King [this message]
2017-12-12 14:07       ` Оля Тележная
  -- strict thread matches above, loose matches on Subject: below --
2018-01-16  1:46 Gargi Sharma
2018-01-19 18:26 ` Christian Couder
2018-01-19 21:01   ` Junio C Hamano
2018-01-19 21:46 ` Jeff King
2018-01-19 23:39   ` Gargi Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171112161617.fhysws3idztguu23@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gs051095@gmail.com \
    --cc=olyatelezhnaya@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).