git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>
Cc: "GIT Mailing-list" <git@vger.kernel.org>,
	"Patrick Steinhardt" <ps@pks.im>,
	"Eli Schwartz" <eschwartz@gentoo.org>,
	"Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Subject: Re: [PATCH 3/5] meson: correct path to system config/attribute files
Date: Thu, 08 May 2025 14:48:22 -0700	[thread overview]
Message-ID: <xmqqr00y4vvd.fsf@gitster.g> (raw)
In-Reply-To: <20250508164443.1506440-4-ramsay@ramsayjones.plus.com> (Ramsay Jones's message of "Thu, 8 May 2025 17:44:37 +0100")

Ramsay Jones <ramsay@ramsayjones.plus.com> writes:

> -  '-DETC_GITATTRIBUTES="' + get_option('gitattributes') + '"',
> -  '-DETC_GITCONFIG="' + get_option('gitconfig') + '"',
> ...
> +system_attributes = get_option('gitattributes')
> +if system_attributes != ''
> +  libgit_c_args += '-DETC_GITATTRIBUTES="' + system_attributes + '"'
> +else
> +  libgit_c_args += '-DETC_GITATTRIBUTES="' + get_option('sysconfdir') + '/gitattributes"'
> +endif

Just out of curiosity (because this cannot be a regression, since
the original removed one used the same constructs).

I am guessing from the presence of double quote around the value
that these strings are not directly used to invoke the compiler
without involving any shell (in other words, you wouldn't want these
quotes if you are shoving these strings in argv[] yourself to feed
execv()).

How does the above, and get_option() in particular, cope with a
pathname that has letters with special meanings to the shell when
they appear inside double-quote pair (like backquote or backslash or
even a dollar sign)?  On the Makefile side we give VAR_SQ for a raw
variable VAR and use the latter to write something like

        -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'

to make sure we won't be broken by them.  Is Meson giving us an
equivalent to us for free by simply using get_option() here?

Thanks.

  parent reply	other threads:[~2025-05-08 21:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08 16:44 [PATCH 0/5] miscellaneous build mods (part 2) Ramsay Jones
2025-05-08 16:44 ` [PATCH 1/5] meson.build: quote the GITWEBDIR build configuration Ramsay Jones
2025-05-08 16:44   ` [PATCH 2/5] meson: correct install location of YAML.pm Ramsay Jones
2025-05-08 16:44     ` [PATCH 3/5] meson: correct path to system config/attribute files Ramsay Jones
2025-05-08 16:44       ` [PATCH 4/5] meson.build: correct setting of GIT_EXEC_PATH Ramsay Jones
2025-05-08 16:44         ` [PATCH 5/5] configure.ac: upgrade to a compilation check for sysinfo Ramsay Jones
2025-05-08 21:07           ` Eli Schwartz
2025-05-08 23:01             ` Ramsay Jones
2025-05-15 20:17               ` Eli Schwartz
2025-05-08 21:55         ` [PATCH 4/5] meson.build: correct setting of GIT_EXEC_PATH Junio C Hamano
2025-05-08 21:48       ` Junio C Hamano [this message]
2025-05-08 22:50         ` [PATCH 3/5] meson: correct path to system config/attribute files Eli Schwartz
2025-05-09  1:03           ` Junio C Hamano
2025-05-08 23:16         ` Ramsay Jones
2025-05-09  8:51       ` Patrick Steinhardt
2025-05-09 15:23         ` Ramsay Jones
2025-05-08 17:36 ` [PATCH 0/5] miscellaneous build mods (part 2) Ramsay Jones
2025-05-13 19:17 ` [PATCH v2 " Ramsay Jones
2025-05-13 19:17   ` [PATCH v2 1/5] meson.build: quote the GITWEBDIR build configuration Ramsay Jones
2025-05-13 19:17   ` [PATCH v2 2/5] meson: correct install location of YAML.pm Ramsay Jones
2025-05-13 19:17   ` [PATCH v2 3/5] meson: correct path to system config/attribute files Ramsay Jones
2025-05-14  4:36     ` Patrick Steinhardt
2025-05-15 16:42       ` Ramsay Jones
2025-05-15 17:51         ` Eli Schwartz
2025-05-15 19:53           ` Ramsay Jones
2025-05-16  5:45         ` Patrick Steinhardt
2025-05-13 19:17   ` [PATCH v2 4/5] meson.build: correct setting of GIT_EXEC_PATH Ramsay Jones
2025-06-16 22:08     ` irecca.kun
2025-05-13 19:17   ` [PATCH v2 5/5] configure.ac: upgrade to a compilation check for sysinfo Ramsay Jones
2025-05-13 20:13   ` [PATCH v2 0/5] miscellaneous build mods (part 2) Junio C Hamano
2025-05-13 20:55     ` Ramsay Jones
2025-05-16 18:48   ` [PATCH v3 " Ramsay Jones
2025-05-16 18:48     ` [PATCH v3 1/5] meson.build: quote the GITWEBDIR build configuration Ramsay Jones
2025-05-16 18:48     ` [PATCH v3 2/5] meson: correct install location of YAML.pm Ramsay Jones
2025-05-16 18:48     ` [PATCH v3 3/5] meson: correct path to system config/attribute files Ramsay Jones
2025-05-19  7:32       ` Patrick Steinhardt
2025-05-16 18:48     ` [PATCH v3 4/5] meson.build: correct setting of GIT_EXEC_PATH Ramsay Jones
2025-05-16 18:48     ` [PATCH v3 5/5] configure.ac: upgrade to a compilation check for sysinfo Ramsay Jones
2025-05-19 16:25     ` [PATCH v4 0/5] miscellaneous build mods (part 2) Ramsay Jones
2025-05-19 16:25       ` [PATCH v4 1/5] meson.build: quote the GITWEBDIR build configuration Ramsay Jones
2025-05-19 16:25       ` [PATCH v4 2/5] meson: correct install location of YAML.pm Ramsay Jones
2025-05-19 16:25       ` [PATCH v4 3/5] meson: correct path to system config/attribute files Ramsay Jones
2025-05-19 16:25       ` [PATCH v4 4/5] meson.build: correct setting of GIT_EXEC_PATH Ramsay Jones
2025-05-19 16:25       ` [PATCH v4 5/5] configure.ac: upgrade to a compilation check for sysinfo Ramsay Jones
2025-05-19 18:48       ` [PATCH v4 0/5] miscellaneous build mods (part 2) Junio C Hamano
2025-05-19 19:08         ` Patrick Steinhardt
2025-05-19 22:42           ` Ramsay Jones
2025-05-19 23:01             ` Junio C Hamano

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=xmqqr00y4vvd.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=congdanhqx@gmail.com \
    --cc=eschwartz@gentoo.org \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    --cc=ramsay@ramsayjones.plus.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.
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).