From: Duy Nguyen <pclouds@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC] Code reorgnization
Date: Fri, 18 Mar 2016 12:59:25 +0700 [thread overview]
Message-ID: <CACsJy8AmrdVeB95RUbVPamM7DMxFKRJ9REd0SN_oq_4HEb6E9g@mail.gmail.com> (raw)
In-Reply-To: <20160318052447.GD22327@sigill.intra.peff.net>
On Fri, Mar 18, 2016 at 12:24 PM, Jeff King <peff@peff.net> wrote:
> On Thu, Mar 17, 2016 at 06:11:36PM +0700, Duy Nguyen wrote:
>
>> Git's top directory is crowded and I think it's agreed that moving
>> test-* to t/helper is a good move. I just wanted to check if we could
>> take this opportunity (after v2.8.0) to move some other files too. I
>> propose the following new subdirs
>
> I guess I don't really see the "crowded" problem, but perhaps that is
> because I am more or less familiar with where things are in git's code
> base. I suppose if you were looking for a "utility" function, you might
> look in "util" and therefore have a smaller set of files to check.
>
> But I think we also run into the opposite problem: I am looking for some
> particular function, but I can't find it, because I am looking in "util"
> and it is in some other directory. And when files move around, it makes
> history harder to follow (maybe that is because git sucks and we need to
> make it better, but certainly I run into mild annoyances with the
> builtin/ rename when digging in history).
Yeah, for finding a particular function, I just "git grep" (or rgrep
from emacs) if I fail to locate it after the first guess. We have this
problem nowadays anyway. Besides builtin, we also have ewah, refs and
some more subdirs.
> And you have a similar problem when creating new files. Which slot do
> they go in? What if they could feasibly go into two slots?
Everything goes to topdir (or later on "src") by default and only goes
to "lib" when it's _obvious_ that it's disconnected from git (i'm
talking about the "lib/src" layout).
> So there can be friction either way. In practice I find I just use ctags
> to jump to the functions I am interested in, and I don't care that much
> about filenames.
>
> The reorganization that _would_ be more interesting to me is not files
> in directories, but rather functions in files. I wish everything were
> designed more as modules with a pair of matching ".c" and ".h" files,
> with a public interface defined in the ".h", and messier, private stuff
> in the ".c". But we have some real dumping grounds:
>
> 1. cache.h has the declarations for at least a dozen different
> modules; besides being hard to navigate, it causes more frequent
> recompilation than necessary.
>
> 2. a few of the .c files could probably be split (e.g., dir.c is where
> all of the pathspec code lives, even though that is used for much
> more than filesystem access these days).
Heh.. that's what I wanted to do (or at least discuss) after files are moved :)
> Splitting those up would _also_ introduce friction (and actually worse
> than whole-file renames, because finding code movement between files is
> an even harder / more expensive problem).
.. and this is why I did not raise it in the first mail.
> But I feel like it would buy a
> lot more in terms of code clarity, and in reducing the scope of code
> which has access to private, static interfaces.
--
Duy
prev parent reply other threads:[~2016-03-18 6:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 11:11 [RFC] Code reorgnization Duy Nguyen
2016-03-17 13:32 ` Johannes Schindelin
2016-03-17 13:35 ` Duy Nguyen
2016-03-17 16:21 ` Junio C Hamano
2016-03-17 17:00 ` Thomas Adam
2016-03-17 17:48 ` Junio C Hamano
2016-03-17 18:37 ` Stefan Beller
2016-03-17 19:10 ` Junio C Hamano
2016-03-17 21:03 ` Pranit Bauva
2016-03-17 21:43 ` John Keeping
2016-03-17 21:49 ` Junio C Hamano
2016-03-18 0:28 ` Duy Nguyen
2016-03-18 5:24 ` Jeff King
2016-03-18 5:59 ` Duy Nguyen [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACsJy8AmrdVeB95RUbVPamM7DMxFKRJ9REd0SN_oq_4HEb6E9g@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.
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).