git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH 0/3] meson: wire up gitk and git-gui
Date: Tue, 2 Sep 2025 15:00:40 +0200	[thread overview]
Message-ID: <aLbqeL1X5CajH-Z8@pks.im> (raw)
In-Reply-To: <xmqqsehencem.fsf@gitster.g>

On Mon, Aug 25, 2025 at 05:40:17PM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > If this is proving to be a blocker we can also change upstream to not be
> > a separate project.
> 
> What do "upstream" refer to in this sentence?  Meson?
> 
> If you are talking about "gitk" and/or "git-gui", then such an
> alternative version of these patches would not change the picture an
> iota, wrt "the limitation of the tool should not force the sources
> that might consider using the tool to pay the price---which might be
> proving to be a blocker", no?

gitk/git-gui in this case.

> Not that I am saying it _is_ a blocker.  But the above sounds like
> making things worse for no gain, so I must be misunderstanding what
> you meant X-<.
> 
> So, ... confused.

So, to hopefully alleviate the confusion, there's two ways to include a
certain directory into Meson:

  - `subdir()` includes directories at arbitrary locations. The
    directory is treated as part of the project that calls `subdir()`.
    This is mostly done to segregate the project into multiple different
    components to keep things more maintainable.

  - `subproject()` includes directories in a specific location. The
    difference is that these are treated as separate projects, so there
    is a certain boundary between the top-level project and its
    subproject. Things done in the subproject won't taint anything in
    the superproject.

Right now I'm using `subproject()`, which has the effect that both gitk
and git-gui can be compiled standalone with Meson, but also as part of
the Git project. It does have the limitation though that the project
must be in a specific directory.

What I was trying to say is that we could convert the build instructions
of gitk and git-gui to not be standalone projects anymore. This would
mean that we can include the subdirectory from any arbitrary location,
but they cannot be built standalone without Git anymore.

Using `subproject()` is a much better fit for our specific use case,
even though we have to move things around. I'm not particularly fond of
this limitation, but I haven't found a better way to achieve this until
now.

So yes, it's a limitation we get from Meson. But it's easy to work
around this limitation by moving the projects into the "subprojects",
which is a one-time cost, only. I've said for a long time anyway that I
think our top-level directory could use some cleanup to make things a
bit more discoverable for new contributors, e.g. by move all the code
files into a "lib/" folder. So that's probably part of why I don't see
this refactoring as a huge downside, even if it is working around a
limitation.

Patrick

  reply	other threads:[~2025-09-02 13:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19  8:18 [PATCH 0/3] meson: wire up gitk and git-gui Patrick Steinhardt
2025-08-19  8:18 ` [PATCH 1/3] git-gui: move into "subprojects/" Patrick Steinhardt
2025-08-19  9:36   ` Karthik Nayak
2025-08-19  8:18 ` [PATCH 2/3] gitk: " Patrick Steinhardt
2025-08-20  5:49   ` [PATCH] doc/gitk: update reference to the external project Johannes Sixt
2025-08-20  6:16     ` [PATCH v2] " Johannes Sixt
2025-08-20 15:34       ` Junio C Hamano
2025-08-19  8:18 ` [PATCH 3/3] meson: wire up gitk and git-gui Patrick Steinhardt
2025-08-19  9:40   ` Karthik Nayak
2025-08-24 17:25     ` Patrick Steinhardt
2025-08-19 15:49 ` [PATCH 0/3] " Junio C Hamano
2025-08-24 17:25   ` Patrick Steinhardt
2025-08-26  0:40     ` Junio C Hamano
2025-09-02 13:00       ` Patrick Steinhardt [this message]
2025-08-19 22:25 ` Ramsay Jones
2025-08-24 17:25   ` Patrick Steinhardt

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=aLbqeL1X5CajH-Z8@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    /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).