All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] doc: simplify baseband features matrix
From: Morten Brørup @ 2022-01-05 20:12 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: nipun.gupta, hemant.agrawal, gakhil, nicolas.chautru
In-Reply-To: <20220105174016.103538-1-thomas@monjalon.net>

> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Wednesday, 5 January 2022 18.40
> 
> The "feature" BBDEV API is useless as all baseband drivers
> must implement it by definition.
> 
> The non-implemented features should not be marked with "N".
> Keeping them blank is clearer to read in the resulting matrix.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  doc/guides/bbdevs/features/acc100.ini        | 1 -
>  doc/guides/bbdevs/features/default.ini       | 1 -
>  doc/guides/bbdevs/features/fpga_5gnr_fec.ini | 1 -
>  doc/guides/bbdevs/features/fpga_lte_fec.ini  | 1 -
>  doc/guides/bbdevs/features/la12xx.ini        | 4 ----
>  doc/guides/bbdevs/features/null.ini          | 1 -
>  doc/guides/bbdevs/features/turbo_sw.ini      | 1 -
>  7 files changed, 10 deletions(-)
> 
> diff --git a/doc/guides/bbdevs/features/acc100.ini
> b/doc/guides/bbdevs/features/acc100.ini
> index 642cd48818..61a31065e1 100644
> --- a/doc/guides/bbdevs/features/acc100.ini
> +++ b/doc/guides/bbdevs/features/acc100.ini
> @@ -11,4 +11,3 @@ LDPC Encoder (5G)      = Y
>  LLR/HARQ Compression   = Y
>  External DDR Access    = Y
>  HW Accelerated         = Y
> -BBDEV API              = Y
> diff --git a/doc/guides/bbdevs/features/default.ini
> b/doc/guides/bbdevs/features/default.ini
> index 5fe267a625..494be5e400 100644
> --- a/doc/guides/bbdevs/features/default.ini
> +++ b/doc/guides/bbdevs/features/default.ini
> @@ -13,4 +13,3 @@ LDPC Encoder (5G)      =
>  LLR/HARQ Compression   =
>  External DDR Access    =
>  HW Accelerated         =
> -BBDEV API              =
> diff --git a/doc/guides/bbdevs/features/fpga_5gnr_fec.ini
> b/doc/guides/bbdevs/features/fpga_5gnr_fec.ini
> index 7a0b8d4e75..66c9139409 100644
> --- a/doc/guides/bbdevs/features/fpga_5gnr_fec.ini
> +++ b/doc/guides/bbdevs/features/fpga_5gnr_fec.ini
> @@ -8,4 +8,3 @@ LDPC Decoder (5G)      = Y
>  LDPC Encoder (5G)      = Y
>  External DDR Access    = Y
>  HW Accelerated         = Y
> -BBDEV API              = Y
> diff --git a/doc/guides/bbdevs/features/fpga_lte_fec.ini
> b/doc/guides/bbdevs/features/fpga_lte_fec.ini
> index f1cfb924a2..c3c398312b 100644
> --- a/doc/guides/bbdevs/features/fpga_lte_fec.ini
> +++ b/doc/guides/bbdevs/features/fpga_lte_fec.ini
> @@ -7,4 +7,3 @@
>  Turbo Decoder (4G)     = Y
>  Turbo Encoder (4G)     = Y
>  HW Accelerated         = Y
> -BBDEV API              = Y
> diff --git a/doc/guides/bbdevs/features/la12xx.ini
> b/doc/guides/bbdevs/features/la12xx.ini
> index 0aec5eecb6..70c11990b7 100644
> --- a/doc/guides/bbdevs/features/la12xx.ini
> +++ b/doc/guides/bbdevs/features/la12xx.ini
> @@ -4,10 +4,6 @@
>  ; Refer to default.ini for the full list of available PMD features.
>  ;
>  [Features]
> -Turbo Decoder (4G)     = N
> -Turbo Encoder (4G)     = N
>  LDPC Decoder (5G)      = Y
>  LDPC Encoder (5G)      = Y
> -LLR/HARQ Compression   = N
>  HW Accelerated         = Y
> -BBDEV API              = Y
> diff --git a/doc/guides/bbdevs/features/null.ini
> b/doc/guides/bbdevs/features/null.ini
> index d9bbda9cf0..50648cdecb 100644
> --- a/doc/guides/bbdevs/features/null.ini
> +++ b/doc/guides/bbdevs/features/null.ini
> @@ -4,4 +4,3 @@
>  ; Refer to default.ini for the full list of available PMD features.
>  ;
>  [Features]
> -BBDEV API              = Y
> diff --git a/doc/guides/bbdevs/features/turbo_sw.ini
> b/doc/guides/bbdevs/features/turbo_sw.ini
> index 2c7075e212..1d908d3ceb 100644
> --- a/doc/guides/bbdevs/features/turbo_sw.ini
> +++ b/doc/guides/bbdevs/features/turbo_sw.ini
> @@ -8,4 +8,3 @@ Turbo Decoder (4G)     = Y
>  Turbo Encoder (4G)     = Y
>  LDPC Decoder (5G)      = Y
>  LDPC Encoder (5G)      = Y
> -BBDEV API              = Y
> --
> 2.34.1
> 

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply

* Re: [PATCH] Revert "clk: Detect failure to set defaults"
From: Sean Anderson @ 2022-01-05 20:11 UTC (permalink / raw)
  To: Tom Rini, Marek Vasut; +Cc: u-boot, Peng Fan, Simon Glass, Mark Kettenis, lukma
In-Reply-To: <20220105193708.GC2773246@bill-the-cat>

On 1/5/22 2:37 PM, Tom Rini wrote:
> On Wed, Jan 05, 2022 at 08:35:19PM +0100, Marek Vasut wrote:
>> On 1/1/22 22:41, Sean Anderson wrote:
>>> Hi Marek,
>>
>> Hi,
>>
>>> Please CC clock maintainers for future patches.
>>
>> btw. I'm surprised the commit 92f1e9a4b31c0bf0f4f61ab823a6a88657323646 has
>> zero reviews/acks from clock maintainers.

At the time, I reviewed it. However, I was also not a clock maintainer
at that point, and my RB was not picked up when Simon sent v2.

Ultimately the original problem was that errors when assigning clocks
automatically were generally not reported. The only way to detect them
was to verify that the clocks were configured correctly after the fact.
My attempt to address this was [2].

[1] https://lore.kernel.org/u-boot/e9eea30a-970b-7d70-267f-520071b483f1@gmail.com/
[2] https://lore.kernel.org/u-boot/20210409021313.433558-2-seanga2@gmail.com/

>>> On 1/1/22 1:51 PM, Marek Vasut wrote:
>>>> This reverts commit 92f1e9a4b31c0bf0f4f61ab823a6a88657323646.
>>>> The aforementioned patch causes massive breakage on all platforms which
>>>> have 'assigned-clock' DT property in their DT which references any clock
>>>> that are not supported by the platform clock driver. That can easily
>>>> happen either in SPL, or because the clock driver is reduced. Currently
>>>> it seems all iMX8M are affected and fail to boot altogether.
>>>>
>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>> Cc: Peng Fan <peng.fan@oss.nxp.com>
>>>> Cc: Simon Glass <sjg@chromium.org>
>>>> ---
>>>>    drivers/clk/clk-uclass.c | 6 +-----
>>>>    1 file changed, 1 insertion(+), 5 deletions(-)
>>>>
>>>> diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
>>>> index f2d26427543..094b1abf13c 100644
>>>> --- a/drivers/clk/clk-uclass.c
>>>> +++ b/drivers/clk/clk-uclass.c
>>>> @@ -846,17 +846,13 @@ void devm_clk_put(struct udevice *dev, struct
>>>> clk *clk)
>>>>    int clk_uclass_post_probe(struct udevice *dev)
>>>>    {
>>>> -    int ret;
>>>> -
>>>>        /*
>>>>         * when a clock provider is probed. Call clk_set_defaults()
>>>>         * also after the device is probed. This takes care of cases
>>>>         * where the DT is used to setup default parents and rates
>>>>         * using assigned-clocks
>>>>         */
>>>> -    ret = clk_set_defaults(dev, CLK_DEFAULTS_POST);
>>>> -    if (ret)
>>>> -        return log_ret(ret);
>>>> +    clk_set_defaults(dev, CLK_DEFAULTS_POST);
>>>>        return 0;
>>>>    }
>>>>
>>>
>>> See [1] for previous discussion. For more background,
>>>
>>> - Device trees for i.MX are sync'd with Linux.
>>> - General clock assignments may live in the clock-controller node,
>>
>> clock assignments can be anywhere, even in non-clock-controller nodes.

Sure, but since those assignments are made only when the device is
probed, it is generally safe to assume that they are necessary for the
device to function. This is opposed to assignments in the clock node,
which may be OK to ignore (as long as the system functions properly).

>>>     including those which U-Boot does not implement, but which Linux does.
>>>     It's OK to not set up these clocks, but U-Boot doesn't know that and
>>>     fails.
>>>
>>> We don't necessarily need to revert this commit, but we do need a way to
>>> say "it's OK not to set the defaults, since we can function without
>>> them". Tom suggested doing this in the clock driver last time. I think a
>>> Kconfig or a device tree property would work, perhaps something like
>>> 'u-boot,clock-defaults-optional'.
>>
>> We didn't need custom DT properties before, Linux doesn't need them either,
>> so that approach seems wrong.
>>
>> If the clock driver could say "skip unimplemented clock, because I don't
>> implement them and that is OK", that sounds like the right approach.
>>
>> Unless the 2022.01 release should be completely broken for a lot of
>> platforms, I would propose we revert the clock uclass patch now and re-add
>> it right after the release, so we would not roll out a completely broken
>> release and would have more time to fix this properly.
> 
> It'll be no more broken than v2021.10 was for whatever platforms have
> problems here, yes?  Since that's what has the problematic commit.

I agree with Marek here. We knew this broke boards before v2021.10 was
released, but it was not reverted for that release. We should not make
the same mistake again.
Reviewed-by: Sean Anderson <seanga2@gmail.com>

[3] https://lore.kernel.org/u-boot/dbde2b83044ce9f3e8c360e9ddce0fa8db16f8ef.camel@nedap.com/

^ permalink raw reply

* Re: [PATCH v5 2/5] initramfs: add INITRAMFS_PRESERVE_MTIME Kconfig option
From: David Disseldorp @ 2022-01-05 20:10 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Martin Wilck, viro, willy
In-Reply-To: <20211213232007.26851-3-ddiss@suse.de>

On Tue, 14 Dec 2021 00:20:05 +0100, David Disseldorp wrote:

> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -17,6 +17,8 @@
...
> -static void __init dir_add(const char *name, time64_t mtime)
> -{
> -	struct dir_entry *de = kmalloc(sizeof(struct dir_entry), GFP_KERNEL);
> -	if (!de)
> -		panic_show_mem("can't allocate dir_entry buffer");
> -	INIT_LIST_HEAD(&de->list);
> -	de->name = kstrdup(name, GFP_KERNEL);
> -	de->mtime = mtime;
> -	list_add(&de->list, &dir_list);
> -}
...
> --- /dev/null
> +++ b/init/initramfs_mtime.h
...
> +static void __init dir_add(const char *name, time64_t mtime)
> +{
> +	struct dir_entry *de = kmalloc(sizeof(struct dir_entry), GFP_KERNEL);
> +	if (!de)
> +		panic("can't allocate dir_entry buffer");
> +	INIT_LIST_HEAD(&de->list);
> +	de->name = kstrdup(name, GFP_KERNEL);
> +	de->mtime = mtime;
> +	list_add(&de->list, &dir_list);
> +}

I might as well fix the unhandled kstrdup() failure, rather than copying
it here. I'll post another round which allocates the "name" buffer via
the dir_entry kmalloc() call.

^ permalink raw reply

* Re: [PATCH v4] receive-pack.c: consolidate find header logic
From: Junio C Hamano @ 2022-01-05 20:10 UTC (permalink / raw)
  To: John Cai via GitGitGadget; +Cc: git, John Cai
In-Reply-To: <pull.1125.v4.git.git.1641396098056.gitgitgadget@gmail.com>

"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:

>     Changes since v4:
>     
>      * added NEEDSWORK block detailing what needs to be done to clean up
>        find_header_mem
> ...
>       -	while (line) {
>      ++	/*
>      ++	 * NEEDSWORK: Between line[0] and msg[len], there may not be a LF nor NUL
>      ++	 * at all, and strchrnul() will scan beyond the range we were given
>      ++	 * Make this operation safer and abide by the contract to only read up to len.
>      ++	 */

This sounds unnecessarily alarming.  Can't we also explain that the
current callers are safe?

^ permalink raw reply

* Re: [PATCH net-next] net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets
From: Richard Cochran @ 2022-01-05 20:10 UTC (permalink / raw)
  To: Miroslav Lichvar; +Cc: netdev, Yangbo Lu
In-Reply-To: <20220105103326.3130875-1-mlichvar@redhat.com>

On Wed, Jan 05, 2022 at 11:33:26AM +0100, Miroslav Lichvar wrote:
> When multiple sockets using the SOF_TIMESTAMPING_BIND_PHC flag received
> a packet with a hardware timestamp (e.g. multiple PTP instances in
> different PTP domains using the UDPv4/v6 multicast or L2 transport),
> the timestamps received on some sockets were corrupted due to repeated
> conversion of the same timestamp (by the same or different vclocks).
> 
> Fix ptp_convert_timestamp() to not modify the shared skb timestamp
> and return the converted timestamp as a ktime_t instead. If the
> conversion fails, return 0 to not confuse the application with
> timestamps corresponding to an unexpected PHC.

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply

* [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: clean up i915_drv.h
From: Patchwork @ 2022-01-05 20:10 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx
In-Reply-To: <cover.1641411696.git.jani.nikula@intel.com>

== Series Details ==

Series: drm/i915: clean up i915_drv.h
URL   : https://patchwork.freedesktop.org/series/98515/
State : failure

== Summary ==

Applying: drm/i915: split out i915_getparam.h from i915_drv.h
Applying: drm/i915: split out i915_cmd_parser.h from i915_drv.h
Applying: drm/i915: split out i915_gem_evict.h from i915_drv.h
Applying: drm/i915: split out gem/i915_gem_userptr.h from i915_drv.h
Applying: drm/i915: split out gem/i915_gem_tiling.h from i915_drv.h
Applying: drm/i915: split out i915_gem.h declarations from i915_drv.h
Applying: drm/i915: split out i915_gem_internal.h from i915_drv.h
error: sha1 information is lacking or useless (drivers/gpu/drm/i915/i915_drv.h).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0007 drm/i915: split out i915_gem_internal.h from i915_drv.h
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



^ permalink raw reply

* Re: [PATCH net-next] testptp: set pin function before other requests
From: Richard Cochran @ 2022-01-05 20:09 UTC (permalink / raw)
  To: Miroslav Lichvar; +Cc: netdev, Vladimir Oltean
In-Reply-To: <20220105152506.3256026-1-mlichvar@redhat.com>

On Wed, Jan 05, 2022 at 04:25:06PM +0100, Miroslav Lichvar wrote:
> When the -L option of the testptp utility is specified with other
> options (e.g. -p to enable PPS output), the user probably wants to
> apply it to the pin configured by the -L option.
> 
> Reorder the code to set the pin function before other function requests
> to avoid confusing users.

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply

* Re: [PATCH] drm/msm/dp: Fix a potential double free in an error handling path
From: Stephen Boyd @ 2022-01-05 20:09 UTC (permalink / raw)
  To: Christophe JAILLET, airlied, bjorn.andersson, daniel,
	quic_abhinavk, quic_khsieh, robdclark, sean
  Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
	kernel-janitors
In-Reply-To: <6fd20c8779d6b03a5b54509af25b478049482087.1640531508.git.christophe.jaillet@wanadoo.fr>

Quoting Christophe JAILLET (2021-12-26 07:14:05)
> 'dp_bridge' is devm_alloc'ed, so there is no need to free it explicitly or
> there will be a double free().
>
> Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply

* Re: [PATCH] drm/msm/dp: Fix a potential double free in an error handling path
From: Stephen Boyd @ 2022-01-05 20:09 UTC (permalink / raw)
  To: Christophe JAILLET, airlied, bjorn.andersson, daniel,
	quic_abhinavk, quic_khsieh, robdclark, sean
  Cc: linux-arm-msm, kernel-janitors, freedreno, linux-kernel,
	dri-devel
In-Reply-To: <6fd20c8779d6b03a5b54509af25b478049482087.1640531508.git.christophe.jaillet@wanadoo.fr>

Quoting Christophe JAILLET (2021-12-26 07:14:05)
> 'dp_bridge' is devm_alloc'ed, so there is no need to free it explicitly or
> there will be a double free().
>
> Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply

* Re: [PATCH 2/2] selftests: tpm: add async space test with noneexisting handle
From: Jarkko Sakkinen @ 2022-01-05 20:07 UTC (permalink / raw)
  To: Tadeusz Struk; +Cc: Shuah Khan, linux-integrity, linux-kselftest, linux-kernel
In-Reply-To: <20211229050655.2030-2-tstruk@gmail.com>

On Tue, 2021-12-28 at 21:06 -0800, Tadeusz Struk wrote:
> Add a test for tpm2 spaces in async mode that checks if
                 ~~~~
I would rather speak about adding a test case for /dev/tpmrm0.

> the code handles invalid handles correctly.
> 
> Cc: Jarkko Sakkinen <jarkko@kernel.org>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: <linux-integrity@vger.kernel.org>
> Cc: <linux-kselftest@vger.kernel.org>
> Cc: <linux-kernel@vger.kernel.org>
> Signed-off-by: Tadeusz Struk <tstruk@gmail.com>
> ---
>  tools/testing/selftests/tpm2/tpm2_tests.py | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/tools/testing/selftests/tpm2/tpm2_tests.py
> b/tools/testing/selftests/tpm2/tpm2_tests.py
> index 9d764306887b..b373b0936e40 100644
> --- a/tools/testing/selftests/tpm2/tpm2_tests.py
> +++ b/tools/testing/selftests/tpm2/tpm2_tests.py
> @@ -302,3 +302,19 @@ class AsyncTest(unittest.TestCase):
>          log.debug("Calling get_cap in a NON_BLOCKING mode")
>          async_client.get_cap(tpm2.TPM2_CAP_HANDLES,
> tpm2.HR_LOADED_SESSION)
>          async_client.close()
> +
> +    def test_flush_invlid_context(self):
> +        log = logging.getLogger(__name__)
> +        log.debug(sys._getframe().f_code.co_name)
> +
> +        async_client = tpm2.Client(tpm2.Client.FLAG_SPACE |
> tpm2.Client.FLAG_NONBLOCK)
> +        log.debug("Calling flush_context passing in an invalid
> handle ")
> +        handle = 0x80123456
> +        rc = 0
> +        try:
> +            async_client.flush_context(handle)
> +        except OSError as e:
> +            rc = e.errno
> +
> +        self.assertEqual(rc, 22)
> +        async_client.close()

BR,
Jarkko

^ permalink raw reply

* [linux-5.4 test] 167609: tolerable FAIL - PUSHED
From: osstest service owner @ 2022-01-05 20:07 UTC (permalink / raw)
  To: xen-devel

flight 167609 linux-5.4 real [real]
flight 167613 linux-5.4 real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/167609/
http://logs.test-lab.xenproject.org/osstest/logs/167613/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-arm64-arm64-libvirt-raw 17 guest-start/debian.repeat fail pass in 167613-retest

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-libvirt-raw 18 guest-start.2       fail in 167613 like 167562
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 167562
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 167562
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 167562
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 167562
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 167562
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 167562
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 167562
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 167562
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 167562
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 167562
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 167562
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 167562
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-seattle  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-seattle  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-cubietruck 15 migrate-support-check        fail never pass
 test-armhf-armhf-xl-cubietruck 16 saverestore-support-check    fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                047dedaa38ce703d3c6a6b0fae180c85a5220cdb
baseline version:
 linux                4ca2eaf1d477ce4316989b22e765fb915652b86e

Last test of basis   167562  2021-12-29 23:41:00 Z    6 days
Testing same since   167609  2022-01-05 11:41:52 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Adrian Hunter <adrian.hunter@intel.com>
  Aleksander Jan Bajkowski <olek2@wp.pl>
  Alexey Makhalov <amakhalov@vmware.com>
  Arnaldo Carvalho de Melo <acme@redhat.com>
  Christophe JAILLET <christophe.jaillet@wanadoo.fr>
  Chunfeng Yun <chunfeng.yun@mediatek.com>
  Coco Li <lixiaoyan@google.com>
  Dan Carpenter <dan.carpenter@oracle.com>
  David S. Miller <davem@davemloft.net>
  Dmitry Torokhov <dmitry.torokhov@gmail.com>
  Dmitry V. Levin <ldv@altlinux.org>
  Dmitry Vyukov <dvyukov@google.com>
  Florian Fainelli <f.fainelli@gmail.com>
  Gal Pressman <gal@nvidia.com>
  Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  Guenter Roeck <linux@roeck-us.net>
  Hans de Goede <hdegoede@redhat.com>
  Heiko Carstens <hca@linux.ibm.com>
  Jackie Liu <liuyun01@kylinos.cn>
  Jakub Kicinski <kuba@kernel.org>
  Jens Wiklander <jens.wiklander@linaro.org>
  Jianguo Wu <wujianguo@chinatelecom.cn>
  Jiasheng Jiang <jiasheng@iscas.ac.cn>
  Jiri Kosina <jkosina@suse.cz>
  Jon Hunter <jonathanh@nvidia.com>
  Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
  Leo L. Schwab <ewhac@ewhac.org>
  Linux Kernel Functional Testing <lkft@linaro.org>
  Martin K. Petersen <martin.petersen@oracle.com>
  Mathias Nyman <mathias.nyman@linux.intel.com>
  Matthias-Christian Ott <ott@mirix.org>
  Miaoqian Lin <linmq006@gmail.com>
  Mike Rapoport <rppt@linux.ibm.com>
  Muchun Song <songmuchun@bytedance.com>
  Namhyung Kim <namhyung@kernel.org>
  Paul Moore <paul@paul-moore.com>
  Pavel Skripkin <paskripkin@gmail.com>
  Saeed Mahameed <saeedm@nvidia.com>
  Samuel Čavoj <samuel@cavoj.net>
  Sasha Levin <sashal@kernel.org>
  Shannon Nelson <snelson@pensando.io>
  Shuah Khan <skhan@linuxfoundation.org>
  Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
  Takashi Iwai <tiwai@suse.de>
  Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
  Todd Kjos <tkjos@google.com>
  Tom Rix <trix@redhat.com>
  Vincent Pelletier <plr.vincent@gmail.com>
  Wang Qing <wangqing@vivo.com>
  Wei Yongjun <weiyongjun1@huawei.com>
  Wolfram Sang <wsa@kernel.org>
  wujianguo <wujianguo@chinatelecom.cn>
  Xin Long <lucien.xin@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-armhf-armhf-xl-cubietruck                               pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-arm64-arm64-xl-seattle                                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   4ca2eaf1d477..047dedaa38ce  047dedaa38ce703d3c6a6b0fae180c85a5220cdb -> tested/linux-5.4


^ permalink raw reply

* Re: [PATCH v5 1/2] name-rev: deprecate --stdin in favor of --annotate-stdin
From: Junio C Hamano @ 2022-01-05 20:07 UTC (permalink / raw)
  To: John Cai via GitGitGadget; +Cc: git, Johannes Schindelin, John Cai
In-Reply-To: <7c5fb10d87c4b807567db0ed83f987487532c7c1.1641356439.git.gitgitgadget@gmail.com>

"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:

> +	altogether.
> ++
> +For example:
> ++
> +--
> +	$ cat sample.txt
> +
> +	An abbreviated revision 2ae0a9cb82 will not be substituted.
> +	The full name after substitution is 2ae0a9cb8298185a94e5998086f380a355dd8907,
> +	while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
> +
> +	$ git name-rev --annotate-stdin <sample.txt
> +
> +	An abbreviated revision 2ae0a9cb82 will not be substituted.
> +	The full name after substitution is 2ae0a9cb8298185a94e5998086f380a355dd8907 (master),
> +	while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
> +
> +	$ git name-rev --name-only --annotate-stdin <sample.txt
> +
> +	An abbreviated revision 2ae0a9cb82 will not be substituted.
> +	The full name after substitution is master,
> +	while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
> +--

I compared the output from the earlier ones with this one; the way
the displayed sample was shown in the previous rounds looked better,
at least in HTML pages.  The earlier ones used "listingblock" in
which the sample is contained in a <pre>formatted <code> block, but
this one ends up in a series of one-<div>-per-paragraph.

> -	if (transform_stdin) {
> -		char buffer[2048];
> +	if (annotate_stdin) {
> +		struct strbuf sb = STRBUF_INIT;

This will break the compilation at this step.

^ permalink raw reply

* Re: [PATCH v6 0/5] Allow guest access to EFI confidential computing secret area
From: Dr. David Alan Gilbert @ 2022-01-05 20:07 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Dov Murik, Brijesh Singh, Tom Lendacky, linux-efi, Ashish Kalra,
	Ard Biesheuvel, James Morris, Serge E. Hallyn, Andi Kleen,
	Greg KH, Andrew Scull, Dave Hansen, James Bottomley,
	Tobin Feldman-Fitzthum, Jim Cadden, Daniele Buono, linux-coco,
	linux-security-module, linux-kernel
In-Reply-To: <YdXq9t75aYLJfb69@zn.tnic>

* Borislav Petkov (bp@suse.de) wrote:
> On Wed, Jan 05, 2022 at 11:43:25AM +0000, Dr. David Alan Gilbert wrote:
> > There's more than one type of dance;
> 
> So Brijesh and I talked about this a bit yesterday. There's all kinds of
> dances...
> 
> > this partially varies depending on the system (SEV/TDX etc)
> 
> By "SEV" I guess you mean pre-SNP because SNP attestation is reportedly
> much better.
> 
> TDX I'm being told is not interested in something like that atm. I guess
> they wanna do something different wrt attestation.

I thought I saw something in their patch series where they also had a
secret that got passed down from EFI?  As I remember they had it with an
ioctl and something; but it felt to me if it would be great if it was
shared.

> So what we're talking about here is pre-SNP attestation, AFAICT.
> 
> > and also depends on how you depend to boot your VM (separate kernel
> > or VM disk). Also it's important to note that when the dance happens
> > varies - in SEV and SEV-ES this happens before the guest executes any
> > code. So at the end of the dance, the guest owner hands over that
> > secret - but only then does the geust start booting;
> 
> Right.
> 
> > that secret has to go somewhere to be used by something later. For
> > example, something might pull out that key and use it to decrypt a
> > disk that then has other secrets on it (e.g. your ssh key).
> 
> That is the other example I heard about.
> 
> So, to sum up: this looks like part of a pre-SNP attestation flow, i.e.,
> for SEV and SEV-ES guests.

Yeh. SNP is a whole different question.

> Follow-up question: is this going to be used by other cloud vendors too?
> Or am I gonna get another implementation of sharing secrets with a guest
> which is just a little bit different but sender #2 can't use this one
> because raisins?
> 
> Because that would not be good.
> 
> So, is this what cloud vendors using SEV/-ES guests would like to use
> and what they all agree upon?

I'd love to hear from those other cloud vendors; I've not been able to
find any detail on how their SEV(-ES) systems actually work.

However, this aims to be just a comms mechanism to pass that secret;
so it's pretty low down in the stack and is there for them to use -
hopefully it's general enough.
(An interesting question is what exactly gets passed in this key and
what it means).

All the contentious stuff I've seen seems to be further up the stack - like
who does the attestation and where they get the secrets and how they
know what a valid measurement looks like.

Dave

> Thx.
> 
> -- 
> Regards/Gruss,
>     Boris.
> 
> SUSE Software Solutions Germany GmbH, GF: Ivo Totev, HRB 36809, AG Nürnberg
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


^ permalink raw reply

* Re: [PATCH] vfio/pci: Generate more relevant log messages for reset failures
From: Alex Williamson @ 2022-01-05 20:05 UTC (permalink / raw)
  To: alex.williamson, qemu-devel; +Cc: kraxel
In-Reply-To: <164141253308.4193016.17283187574468953902.stgit@omen>


Sorry for the dupe and fat-fingering MST's email, please reply to the
other thread at 164141259622.4193261.8252690438434562107.stgit@omen.
Thanks,

Alex



^ permalink raw reply

* Re: [PATCH v2 1/2] tpm: Fix error handling in async work
From: Jarkko Sakkinen @ 2022-01-05 20:05 UTC (permalink / raw)
  To: Tadeusz Struk, jarkko
  Cc: Jason Gunthorpe, linux-integrity, stable, linux-kernel
In-Reply-To: <20211229050655.2030-1-tstruk@gmail.com>

On Tue, 2021-12-28 at 21:06 -0800, Tadeusz Struk wrote:
> When an invalid (non existing) handle is used in a tpm command,
                                                     ~~~
                                                     TPM

> that uses the resource manager interface (/dev/tpmrm0) the resource
> manager tries to load it from its internal cache, but fails and
> returns an -EINVAL error to the caller. The async handler doesn't
> handle these error cases currently and the condition in the poll
> handler never returns mask with EPOLLIN set.
> The result is that the poll call blocks and the application gets
> stuck
> until the user_read_timer wakes it up after 120 sec.
> Make sure that error conditions also contribute to the poll mask
> so that a correct error code could passed back to the caller.

I'm not sure what "making sure" means.

> 
> Cc: Jarkko Sakkinen <jarkko@kernel.org>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: <linux-integrity@vger.kernel.org>
> Cc: <stable@vger.kernel.org>
> Cc: <linux-kernel@vger.kernel.org>
> Fixes: 9e1b74a63f77 ("tpm: add support for nonblocking operation")
> Signed-off-by: Tadeusz Struk <tstruk@gmail.com>
> ---
> Changes in v2:
> - Updated commit message with better problem description.
> - Fixed typeos.
> ---
>  drivers/char/tpm/tpm-dev-common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm-dev-common.c
> b/drivers/char/tpm/tpm-dev-common.c
> index c08cbb306636..fe2679f84cb6 100644
> --- a/drivers/char/tpm/tpm-dev-common.c
> +++ b/drivers/char/tpm/tpm-dev-common.c
> @@ -69,7 +69,7 @@ static void tpm_dev_async_work(struct work_struct
> *work)
>         ret = tpm_dev_transmit(priv->chip, priv->space, priv-
> >data_buffer,
>                                sizeof(priv->data_buffer));
>         tpm_put_ops(priv->chip);
> -       if (ret > 0) {
> +       if (ret != 0) {

What if ret < 0?

You should explain this change in the commit message. Also, consider
adding an inline comment.

>                 priv->response_length = ret;
>                 mod_timer(&priv->user_read_timer, jiffies + (120 *
> HZ));
>         }

BR,
Jarkko

^ permalink raw reply

* RE: [RFC] eal: remove size for eal_set_runtime_dir
From: Morten Brørup @ 2022-01-05 20:04 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev
In-Reply-To: <20220105180153.73311-1-stephen@networkplumber.org>

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, 5 January 2022 19.02
> 
> The size argument to eal_set_runtime_dir is useless and was
> being used incorrectly in strlcpy. It worked only because
> all callers passed PATH_MAX which is same as sizeof the destination
> runtime_dir.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Suggested-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>  lib/eal/common/eal_common_config.c | 7 ++-----
>  lib/eal/common/eal_private.h       | 4 +---
>  lib/eal/freebsd/eal.c              | 2 +-
>  lib/eal/linux/eal.c                | 2 +-
>  4 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/eal/common/eal_common_config.c
> b/lib/eal/common/eal_common_config.c
> index 1c4c4dd585d0..62a9d7a198db 100644
> --- a/lib/eal/common/eal_common_config.c
> +++ b/lib/eal/common/eal_common_config.c
> @@ -29,12 +29,9 @@ rte_eal_get_runtime_dir(void)
>  }
> 
>  int
> -eal_set_runtime_dir(char *run_dir, size_t size)
> +eal_set_runtime_dir(const char *run_dir)
>  {
> -	size_t str_size;
> -
> -	str_size = strlcpy(runtime_dir, run_dir, size);
> -	if (str_size >= size) {
> +	if (strlcpy(runtime_dir, run_dir, PATH_MAX) >= PATH_MAX) {
>  		RTE_LOG(ERR, EAL, "Runtime directory string too long\n");
>  		return -1;
>  	}
> diff --git a/lib/eal/common/eal_private.h
> b/lib/eal/common/eal_private.h
> index 36bcc0b5a492..734f1f334b69 100644
> --- a/lib/eal/common/eal_private.h
> +++ b/lib/eal/common/eal_private.h
> @@ -681,13 +681,11 @@ eal_mem_set_dump(void *virt, size_t size, bool
> dump);
>   *
>   * @param run_dir
>   *   The new runtime directory path of DPDK
> - * @param size
> - *   The size of the new runtime directory path in bytes.
>   * @return
>   *   0 on success, (-1) on failure.
>   */
>  int
> -eal_set_runtime_dir(char *run_dir, size_t size);
> +eal_set_runtime_dir(const char *run_dir);
> 
>  /**
>   * Get the internal configuration structure.
> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> index a1cd2462db1b..503e276dc27f 100644
> --- a/lib/eal/freebsd/eal.c
> +++ b/lib/eal/freebsd/eal.c
> @@ -123,7 +123,7 @@ eal_create_runtime_dir(void)
>  		return -1;
>  	}
> 
> -	if (eal_set_runtime_dir(run_dir, sizeof(run_dir)))
> +	if (eal_set_runtime_dir(run_dir))
>  		return -1;
> 
>  	return 0;
> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
> index 80ffe1c7f9d8..a73ff75f65c9 100644
> --- a/lib/eal/linux/eal.c
> +++ b/lib/eal/linux/eal.c
> @@ -135,7 +135,7 @@ eal_create_runtime_dir(void)
>  		return -1;
>  	}
> 
> -	if (eal_set_runtime_dir(run_dir, sizeof(run_dir)))
> +	if (eal_set_runtime_dir(run_dir))
>  		return -1;
> 
>  	return 0;
> --
> 2.30.2
> 

Reviewed-by: Morten Brørup<mb@smartsharesystems.com>


^ permalink raw reply

* Re: [PATCH] ext4/033: test EXT4_IOC_RESIZE_FS by calling the ioctl directly
From: Theodore Ts'o @ 2022-01-05 20:02 UTC (permalink / raw)
  To: guan, fstests, Ext4 Developers List, Eric Whitney
In-Reply-To: <20220105160619.r66lacgq7b7ucyuk@zlang-mailbox>

On Thu, Jan 06, 2022 at 12:06:19AM +0800, Zorro Lang wrote:
> > This patch looks good to me, I just want to ask if we'd better to try to include
> > ext2fs/ext2fs.h at here? And of course, check it in configure.ac.
> > The EXT4_IOC_RESIZE_FS looks like defined in ext2fs/ext2_fs.h which comes from
> > e2fsprogs-devel package. I can't find this definition from kernel-hearders package.
> > As you're the expert of this part, please correct me if it's wrong :)

We're not depending on ext2fs/ext2_fs.h and hence the e2fsprogs-devel
(or libext2fs-dev package if you're using Debian/Ubuntu) anywhere else
in the xfstests-dev.  It's not like the code points for
EXT4_IOC_RESIZE_FS are going to change, so we just use constructs
like:

#ifndef EXT4_IOC_RESIZE_FS
#define EXT4_IOC_RESIZE_FS           _IOW('f', 16, __u64)
#endif

in xfstests-dev/src/*.c as needed.

There's no real upside in adding a dependency which makes it harder
for developers to compile xfstests.  (Trivia note: I created
xfstests-bld several years ago because back then, Debian didn't
include some of the internal header files from xfsprogs which xfstests
needed.)

Cheers,

						- Ted

^ permalink raw reply

* [PATCH v5 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"
From: Jean-Noël Avila via GitGitGadget @ 2022-01-05 20:02 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Sixt, Ævar Arnfjörð Bjarmason,
	René Scharfe, Jean-Noël Avila, Jean-Noël Avila
In-Reply-To: <pull.1088.v5.git.1641412944.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 ref-filter.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ref-filter.c b/ref-filter.c
index adbcc680812..f7a2f17bfd9 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -841,7 +841,7 @@ static void if_then_else_handler(struct ref_formatting_stack **stack)
 	struct if_then_else *if_then_else = (struct if_then_else *)cur->at_end_data;
 
 	if (!if_then_else->then_atom_seen)
-		die(_("format: %%(if) atom used without a %%(then) atom"));
+		die(_("format: %%(%s) atom used without a %%(%s) atom"), "if", "then");
 
 	if (if_then_else->else_atom_seen) {
 		/*
@@ -907,7 +907,7 @@ static int then_atom_handler(struct atom_value *atomv, struct ref_formatting_sta
 	if (cur->at_end == if_then_else_handler)
 		if_then_else = (struct if_then_else *)cur->at_end_data;
 	if (!if_then_else)
-		return strbuf_addf_ret(err, -1, _("format: %%(then) atom used without an %%(if) atom"));
+		return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "then", "if");
 	if (if_then_else->then_atom_seen)
 		return strbuf_addf_ret(err, -1, _("format: %%(then) atom used more than once"));
 	if (if_then_else->else_atom_seen)
@@ -943,9 +943,9 @@ static int else_atom_handler(struct atom_value *atomv, struct ref_formatting_sta
 	if (prev->at_end == if_then_else_handler)
 		if_then_else = (struct if_then_else *)prev->at_end_data;
 	if (!if_then_else)
-		return strbuf_addf_ret(err, -1, _("format: %%(else) atom used without an %%(if) atom"));
+		return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "else", "if");
 	if (!if_then_else->then_atom_seen)
-		return strbuf_addf_ret(err, -1, _("format: %%(else) atom used without a %%(then) atom"));
+		return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "else", "then");
 	if (if_then_else->else_atom_seen)
 		return strbuf_addf_ret(err, -1, _("format: %%(else) atom used more than once"));
 	if_then_else->else_atom_seen = 1;
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH v5 09/11] i18n: factorize "--foo outside a repository"
From: Jean-Noël Avila via GitGitGadget @ 2022-01-05 20:02 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Sixt, Ævar Arnfjörð Bjarmason,
	René Scharfe, Jean-Noël Avila, Jean-Noël Avila
In-Reply-To: <pull.1088.v5.git.1641412944.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 apply.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/apply.c b/apply.c
index cabcdbe425a..5cd369d5736 100644
--- a/apply.c
+++ b/apply.c
@@ -136,7 +136,7 @@ int check_apply_state(struct apply_state *state, int force_apply)
 		return error(_("options '%s' and '%s' cannot be used together"), "--reject", "--3way");
 	if (state->threeway) {
 		if (is_not_gitdir)
-			return error(_("--3way outside a repository"));
+			return error(_("'%s' outside a repository"), "--3way");
 		state->check_index = 1;
 	}
 	if (state->apply_with_reject) {
@@ -147,10 +147,10 @@ int check_apply_state(struct apply_state *state, int force_apply)
 	if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor))
 		state->apply = 0;
 	if (state->check_index && is_not_gitdir)
-		return error(_("--index outside a repository"));
+		return error(_("'%s' outside a repository"), "--index");
 	if (state->cached) {
 		if (is_not_gitdir)
-			return error(_("--cached outside a repository"));
+			return error(_("'%s' outside a repository"), "--cached");
 		state->check_index = 1;
 	}
 	if (state->ita_only && (state->check_index || is_not_gitdir))
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH v5 11/11] i18n: turn even more messages into "cannot be used together" ones
From: Jean-Noël Avila via GitGitGadget @ 2022-01-05 20:02 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Sixt, Ævar Arnfjörð Bjarmason,
	René Scharfe, Jean-Noël Avila, Jean-Noël Avila
In-Reply-To: <pull.1088.v5.git.1641412944.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Even if some of these messages are not subject to gettext i18n, this
helps bring a single style of message for a given error type.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 builtin/add.c                             |  2 +-
 builtin/am.c                              |  6 +++---
 builtin/cat-file.c                        |  2 +-
 builtin/checkout.c                        |  6 +++---
 builtin/clone.c                           |  4 ++--
 builtin/commit.c                          |  9 +++++----
 builtin/describe.c                        |  4 ++--
 builtin/rebase.c                          |  4 ++--
 builtin/reset.c                           |  2 +-
 builtin/rev-list.c                        |  2 +-
 builtin/rm.c                              |  2 +-
 builtin/stash.c                           |  2 +-
 diff.c                                    | 12 ++++++++----
 t/t2026-checkout-pathspec-file.sh         |  2 +-
 t/t2072-restore-pathspec-file.sh          |  2 +-
 t/t3601-rm-pathspec-file.sh               |  2 +-
 t/t3704-add-pathspec-file.sh              |  2 +-
 t/t3909-stash-pathspec-file.sh            |  2 +-
 t/t4209-log-pickaxe.sh                    |  4 ++--
 t/t5606-clone-options.sh                  |  2 +-
 t/t7107-reset-pathspec-file.sh            |  2 +-
 t/t7500-commit-template-squash-signoff.sh | 11 ++++++-----
 t/t7526-commit-pathspec-file.sh           |  2 +-
 23 files changed, 47 insertions(+), 41 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 067ec53d69f..84dff3e7969 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -566,7 +566,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 
 	if (pathspec_from_file) {
 		if (pathspec.nr)
-			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
+			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
 
 		parse_pathspec_file(&pathspec, PATHSPEC_ATTR,
 				    PATHSPEC_PREFER_FULL |
diff --git a/builtin/am.c b/builtin/am.c
index 8677ea2348a..68a190dd9f5 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2230,9 +2230,9 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
 	}
 
 	if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode)
-		return error(_("--show-current-patch=%s is incompatible with "
-			       "--show-current-patch=%s"),
-			     arg, valid_modes[resume->sub_mode]);
+		return error(_("options '%s=%s' and '%s=%s' "
+					   "cannot be used together"),
+					 "--show-current-patch", "--show-current-patch", arg, valid_modes[resume->sub_mode]);
 
 	resume->mode = RESUME_SHOW_PATCH;
 	resume->sub_mode = new_value;
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 86fc03242b8..d94050e6c18 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -729,7 +729,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
 	}
 
 	if (force_path && batch.enabled) {
-		error("--path=<path> incompatible with --batch");
+		error("options '--path=<path>' and '--batch' cannot be used together");
 		usage_with_options(cat_file_usage, options);
 	}
 
diff --git a/builtin/checkout.c b/builtin/checkout.c
index af5fa8228eb..eb3a69c2120 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1635,8 +1635,8 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
 	}
 
 	if ((!!opts->new_branch + !!opts->new_branch_force + !!opts->new_orphan_branch) > 1)
-		die(_("-%c, -%c and --orphan are mutually exclusive"),
-				cb_option, toupper(cb_option));
+		die(_("options '-%c', '-%c', and '%s' cannot be used together"),
+			cb_option, toupper(cb_option), "--orphan");
 
 	if (opts->overlay_mode == 1 && opts->patch_mode)
 		die(_("options '%s' and '%s' cannot be used together"), "-p", "--overlay");
@@ -1746,7 +1746,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
 
 	if (opts->pathspec_from_file) {
 		if (opts->pathspec.nr)
-			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
+			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
 
 		if (opts->force_detach)
 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--detach");
diff --git a/builtin/clone.c b/builtin/clone.c
index 13bdbe14b2f..8b79666e3a7 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -900,8 +900,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	if (option_bare) {
 		if (option_origin)
-			die(_("--bare and --origin %s options are incompatible."),
-			    option_origin);
+			die(_("options '%s' and '%s %s' cannot be used together"),
+			    "--bare", "--origin", option_origin);
 		if (real_git_dir)
 			die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir");
 		option_no_checkout = 1;
diff --git a/builtin/commit.c b/builtin/commit.c
index 49e7477747f..b9ed0374e30 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -361,7 +361,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "-a");
 
 		if (pathspec.nr)
-			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
+			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
 
 		parse_pathspec_file(&pathspec, 0,
 				    PATHSPEC_PREFER_FULL,
@@ -799,7 +799,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 
 		if (!strcmp(fixup_prefix, "amend")) {
 			if (have_option_m)
-				die(_("cannot combine -m with --fixup:%s"), fixup_message);
+				die(_("options '%s' and '%s:%s' cannot be used together"), "-m", "--fixup", fixup_message);
 			prepare_amend_commit(commit, &sb, &ctx);
 		}
 	} else if (!stat(git_path_merge_msg(the_repository), &statbuf)) {
@@ -1229,9 +1229,10 @@ static void check_fixup_reword_options(int argc, const char *argv[]) {
 			die(_("You are in the middle of a cherry-pick -- cannot reword."));
 	}
 	if (argc)
-		die(_("cannot combine reword option of --fixup with path '%s'"), *argv);
+		die(_("reword option of '%s' and path '%s' cannot be used together"), "--fixup", *argv);
 	if (patch_interactive || interactive || all || also || only)
-		die(_("reword option of --fixup is mutually exclusive with --patch/--interactive/--all/--include/--only"));
+		die(_("reword option of '%s' and '%s' cannot be used together"),
+			"--fixup", "--patch/--interactive/--all/--include/--only");
 }
 
 static int parse_and_validate_options(int argc, const char *argv[],
diff --git a/builtin/describe.c b/builtin/describe.c
index fd5ba1fc604..42159cd26bd 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -670,9 +670,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 		}
 		describe("HEAD", 1);
 	} else if (dirty) {
-		die(_("--dirty is incompatible with commit-ishes"));
+		die(_("option '%s' and commit-ishes cannot be used together"), "--dirty");
 	} else if (broken) {
-		die(_("--broken is incompatible with commit-ishes"));
+		die(_("option '%s' and commit-ishes cannot be used together"), "--broken");
 	} else {
 		while (argc-- > 0)
 			describe(*argv++, argc == 0);
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 16e6053b14a..36490d06c8a 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1460,8 +1460,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 
 		if (i >= 0) {
 			if (is_merge(&options))
-				die(_("cannot combine apply options with "
-				      "merge options"));
+				die(_("apply options and merge options "
+					  "cannot be used together"));
 			else
 				options.type = REBASE_APPLY;
 		}
diff --git a/builtin/reset.c b/builtin/reset.c
index 4779e70dfbe..b97745ee94e 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -426,7 +426,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
 
 		if (pathspec.nr)
-			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
+			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
 
 		parse_pathspec_file(&pathspec, 0,
 				    PATHSPEC_PREFER_FULL,
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index c1a3b0b3591..777558e9b06 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -676,7 +676,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
 	if (revs.count &&
 	    (revs.tag_objects || revs.tree_objects || revs.blob_objects) &&
 	    (revs.left_right || revs.cherry_mark))
-		die(_("marked counting is incompatible with --objects"));
+		die(_("marked counting and '%s' cannot be used together"), "--objects");
 
 	save_commit_buffer = (revs.verbose_header ||
 			      revs.grep_filter.pattern_list ||
diff --git a/builtin/rm.c b/builtin/rm.c
index cfdf24cf49a..127a6f0220c 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -272,7 +272,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 
 	if (pathspec_from_file) {
 		if (pathspec.nr)
-			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
+			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
 
 		parse_pathspec_file(&pathspec, 0,
 				    PATHSPEC_PREFER_CWD,
diff --git a/builtin/stash.c b/builtin/stash.c
index 3e3743fd5a3..7b1876b3e31 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1706,7 +1706,7 @@ static int push_stash(int argc, const char **argv, const char *prefix,
 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--staged");
 
 		if (ps.nr)
-			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
+			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
 
 		parse_pathspec_file(&ps, 0,
 				    PATHSPEC_PREFER_FULL | PATHSPEC_PREFIX_ORIGIN,
diff --git a/diff.c b/diff.c
index 02ce779e43a..da5fc81a543 100644
--- a/diff.c
+++ b/diff.c
@@ -4639,16 +4639,20 @@ void diff_setup_done(struct diff_options *options)
 		options->set_default(options);
 
 	if (HAS_MULTI_BITS(options->output_format & check_mask))
-		die(_("--name-only, --name-status, --check and -s are mutually exclusive"));
+		die(_("options '%s', '%s', '%s', and '%s' cannot be used together"),
+			"--name-only", "--name-status", "--check", "-s");
 
 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK))
-		die(_("options '%s', '%s', and '%s' cannot be used together"), "-G", "-S", "--find-object");
+		die(_("options '%s', '%s', and '%s' cannot be used together"),
+			"-G", "-S", "--find-object");
 
 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK))
-		die(_("-G and --pickaxe-regex are mutually exclusive, use --pickaxe-regex with -S"));
+		die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s'"),
+			"-G", "--pickaxe-regex", "--pickaxe-regex", "-S");
 
 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_ALL_OBJFIND_MASK))
-		die(_("--pickaxe-all and --find-object are mutually exclusive, use --pickaxe-all with -G and -S"));
+		die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"),
+			"--pickaxe-all", "--find-object", "--pickaxe-all", "-G", "-S");
 
 	/*
 	 * Most of the time we can say "there are changes"
diff --git a/t/t2026-checkout-pathspec-file.sh b/t/t2026-checkout-pathspec-file.sh
index 9e6b17e2d23..9c651aefbca 100755
--- a/t/t2026-checkout-pathspec-file.sh
+++ b/t/t2026-checkout-pathspec-file.sh
@@ -155,7 +155,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
 
 	test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
+	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
 
 	test_must_fail git checkout --pathspec-file-nul 2>err &&
 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err
diff --git a/t/t2072-restore-pathspec-file.sh b/t/t2072-restore-pathspec-file.sh
index af67ca7d52b..c22669b39f9 100755
--- a/t/t2072-restore-pathspec-file.sh
+++ b/t/t2072-restore-pathspec-file.sh
@@ -155,7 +155,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
 
 	test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
+	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
 
 	test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err &&
 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
diff --git a/t/t3601-rm-pathspec-file.sh b/t/t3601-rm-pathspec-file.sh
index bbed67f8ef5..a2a0c820fe3 100755
--- a/t/t3601-rm-pathspec-file.sh
+++ b/t/t3601-rm-pathspec-file.sh
@@ -67,7 +67,7 @@ test_expect_success 'error conditions' '
 	echo fileA.t >list &&
 
 	test_must_fail git rm --pathspec-from-file=list -- fileA.t 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
+	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
 
 	test_must_fail git rm --pathspec-file-nul 2>err &&
 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
diff --git a/t/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh
index 47ad96bf661..4e6b5177c93 100755
--- a/t/t3704-add-pathspec-file.sh
+++ b/t/t3704-add-pathspec-file.sh
@@ -147,7 +147,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err &&
 
 	test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
+	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
 
 	test_must_fail git add --pathspec-file-nul 2>err &&
 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
diff --git a/t/t3909-stash-pathspec-file.sh b/t/t3909-stash-pathspec-file.sh
index fde4625cfcb..dead9f18d93 100755
--- a/t/t3909-stash-pathspec-file.sh
+++ b/t/t3909-stash-pathspec-file.sh
@@ -91,7 +91,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
 
 	test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
+	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
 
 	test_must_fail git stash push --pathspec-file-nul 2>err &&
 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err
diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh
index 4f820f8597d..7f6bb27f141 100755
--- a/t/t4209-log-pickaxe.sh
+++ b/t/t4209-log-pickaxe.sh
@@ -72,12 +72,12 @@ test_expect_success 'usage' '
 	grep "cannot be used together" err &&
 
 	test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err &&
-	grep "mutually exclusive" err
+	grep "cannot be used together" err
 '
 
 test_expect_success 'usage: --pickaxe-regex' '
 	test_expect_code 128 git log -Gregex --pickaxe-regex 2>err &&
-	grep "mutually exclusive" err
+	grep "cannot be used together" err
 '
 
 test_expect_success 'usage: --no-pickaxe-regex' '
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index 3af3577af0b..8f676d6b0c0 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -46,7 +46,7 @@ test_expect_success 'disallows --bare with --origin' '
 
 	test_must_fail git clone -o foo --bare parent clone-bare-o 2>err &&
 	test_debug "cat err" &&
-	test_i18ngrep -e "--bare and --origin foo options are incompatible" err
+	test_i18ngrep -e "options .--bare. and .--origin foo. cannot be used together" err
 
 '
 
diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh
index f753e3229e2..523efbecde1 100755
--- a/t/t7107-reset-pathspec-file.sh
+++ b/t/t7107-reset-pathspec-file.sh
@@ -163,7 +163,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
 
 	test_must_fail git reset --pathspec-from-file=list -- fileA.t 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
+	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
 
 	test_must_fail git reset --pathspec-file-nul 2>err &&
 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
diff --git a/t/t7500-commit-template-squash-signoff.sh b/t/t7500-commit-template-squash-signoff.sh
index 8dd0f988129..91964653a0b 100755
--- a/t/t7500-commit-template-squash-signoff.sh
+++ b/t/t7500-commit-template-squash-signoff.sh
@@ -359,14 +359,14 @@ test_expect_success '--fixup=reword: ignores staged changes' '
 
 test_expect_success '--fixup=reword: error out with -m option' '
 	commit_for_rebase_autosquash_setup &&
-	echo "fatal: cannot combine -m with --fixup:reword" >expect &&
+	echo "fatal: options '\''-m'\'' and '\''--fixup:reword'\'' cannot be used together" >expect &&
 	test_must_fail git commit --fixup=reword:HEAD~ -m "reword commit message" 2>actual &&
 	test_cmp expect actual
 '
 
 test_expect_success '--fixup=amend: error out with -m option' '
 	commit_for_rebase_autosquash_setup &&
-	echo "fatal: cannot combine -m with --fixup:amend" >expect &&
+	echo "fatal: options '\''-m'\'' and '\''--fixup:amend'\'' cannot be used together" >expect &&
 	test_must_fail git commit --fixup=amend:HEAD~ -m "amend commit message" 2>actual &&
 	test_cmp expect actual
 '
@@ -421,8 +421,9 @@ test_expect_success 'amend! commit allows empty commit msg body with --allow-emp
 
 test_fixup_reword_opt () {
 	test_expect_success "--fixup=reword: incompatible with $1" "
-		echo 'fatal: reword option of --fixup is mutually exclusive with'\
-			'--patch/--interactive/--all/--include/--only' >expect &&
+		echo 'fatal: reword option of '\''--fixup'\'' and' \
+			''\''--patch/--interactive/--all/--include/--only'\' \
+			'cannot be used together' >expect &&
 		test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual &&
 		test_cmp expect actual
 	"
@@ -435,7 +436,7 @@ done
 
 test_expect_success '--fixup=reword: give error with pathsec' '
 	commit_for_rebase_autosquash_setup &&
-	echo "fatal: cannot combine reword option of --fixup with path '\''foo'\''" >expect &&
+	echo "fatal: reword option of '\''--fixup'\'' and path '\''foo'\'' cannot be used together" >expect &&
 	test_must_fail git commit --fixup=reword:HEAD~ -- foo 2>actual &&
 	test_cmp expect actual
 '
diff --git a/t/t7526-commit-pathspec-file.sh b/t/t7526-commit-pathspec-file.sh
index ea69e3a6ad1..ad011bb9f15 100755
--- a/t/t7526-commit-pathspec-file.sh
+++ b/t/t7526-commit-pathspec-file.sh
@@ -150,7 +150,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "options .--pathspec-from-file. and .-a. cannot be used together" err &&
 
 	test_must_fail git commit --pathspec-from-file=list -m "Commit" -- fileA.t 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
+	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
 
 	test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err &&
 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
-- 
gitgitgadget

^ permalink raw reply related

* [PATCH v5 08/11] i18n: refactor "unrecognized %(foo) argument" strings
From: Jean-Noël Avila via GitGitGadget @ 2022-01-05 20:02 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Sixt, Ævar Arnfjörð Bjarmason,
	René Scharfe, Jean-Noël Avila, Jean-Noël Avila
In-Reply-To: <pull.1088.v5.git.1641412944.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 ref-filter.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ref-filter.c b/ref-filter.c
index 7260fce31d0..adbcc680812 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -341,7 +341,7 @@ static int objectsize_atom_parser(struct ref_format *format, struct used_atom *a
 		else
 			oi.info.disk_sizep = &oi.disk_size;
 	} else
-		return strbuf_addf_ret(err, -1, _("unrecognized %%(objectsize) argument: %s"), arg);
+		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "objectsize", arg);
 	return 0;
 }
 
@@ -374,7 +374,7 @@ static int subject_atom_parser(struct ref_format *format, struct used_atom *atom
 	else if (!strcmp(arg, "sanitize"))
 		atom->u.contents.option = C_SUB_SANITIZE;
 	else
-		return strbuf_addf_ret(err, -1, _("unrecognized %%(subject) argument: %s"), arg);
+		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "subject", arg);
 	return 0;
 }
 
@@ -428,7 +428,7 @@ static int contents_atom_parser(struct ref_format *format, struct used_atom *ato
 		if (strtoul_ui(arg, 10, &atom->u.contents.nlines))
 			return strbuf_addf_ret(err, -1, _("positive value expected contents:lines=%s"), arg);
 	} else
-		return strbuf_addf_ret(err, -1, _("unrecognized %%(contents) argument: %s"), arg);
+		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "contents", arg);
 	return 0;
 }
 
@@ -440,7 +440,7 @@ static int raw_atom_parser(struct ref_format *format, struct used_atom *atom,
 	else if (!strcmp(arg, "size"))
 		atom->u.raw_data.option = RAW_LENGTH;
 	else
-		return strbuf_addf_ret(err, -1, _("unrecognized %%(raw) argument: %s"), arg);
+		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "raw", arg);
 	return 0;
 }
 
@@ -459,7 +459,7 @@ static int oid_atom_parser(struct ref_format *format, struct used_atom *atom,
 		if (atom->u.oid.length < MINIMUM_ABBREV)
 			atom->u.oid.length = MINIMUM_ABBREV;
 	} else
-		return strbuf_addf_ret(err, -1, _("unrecognized argument '%s' in %%(%s)"), arg, atom->name);
+		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), atom->name, arg);
 	return 0;
 }
 
@@ -531,7 +531,7 @@ static int align_atom_parser(struct ref_format *format, struct used_atom *atom,
 		else if ((position = parse_align_position(s)) >= 0)
 			align->position = position;
 		else {
-			strbuf_addf(err, _("unrecognized %%(align) argument: %s"), s);
+			strbuf_addf(err, _("unrecognized %%(%s) argument: %s"), "align", s);
 			string_list_clear(&params, 0);
 			return -1;
 		}
@@ -557,7 +557,7 @@ static int if_atom_parser(struct ref_format *format, struct used_atom *atom,
 	} else if (skip_prefix(arg, "notequals=", &atom->u.if_then_else.str)) {
 		atom->u.if_then_else.cmp_status = COMPARE_UNEQUAL;
 	} else
-		return strbuf_addf_ret(err, -1, _("unrecognized %%(if) argument: %s"), arg);
+		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "if", arg);
 	return 0;
 }
 
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH v5 06/11] i18n: factorize "--foo requires --bar" and the like
From: Jean-Noël Avila via GitGitGadget @ 2022-01-05 20:02 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Sixt, Ævar Arnfjörð Bjarmason,
	René Scharfe, Jean-Noël Avila, Jean-Noël Avila
In-Reply-To: <pull.1088.v5.git.1641412944.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

They are all replaced by "the option '%s' requires '%s'", which is a
new string but replaces 17 previous unique strings.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 archive.c                         | 2 +-
 builtin/add.c                     | 4 ++--
 builtin/checkout.c                | 2 +-
 builtin/commit.c                  | 2 +-
 builtin/fast-export.c             | 2 +-
 builtin/index-pack.c              | 2 +-
 builtin/log.c                     | 2 +-
 builtin/reset.c                   | 4 ++--
 builtin/rm.c                      | 2 +-
 builtin/stash.c                   | 2 +-
 builtin/worktree.c                | 2 +-
 fetch-pack.c                      | 2 +-
 http-fetch.c                      | 4 ++--
 revision.c                        | 2 +-
 t/t2026-checkout-pathspec-file.sh | 2 +-
 t/t2072-restore-pathspec-file.sh  | 2 +-
 t/t3601-rm-pathspec-file.sh       | 2 +-
 t/t3704-add-pathspec-file.sh      | 2 +-
 t/t3909-stash-pathspec-file.sh    | 2 +-
 t/t7107-reset-pathspec-file.sh    | 2 +-
 t/t7526-commit-pathspec-file.sh   | 2 +-
 21 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/archive.c b/archive.c
index 78d35467008..d571249cf39 100644
--- a/archive.c
+++ b/archive.c
@@ -577,7 +577,7 @@ static int parse_archive_args(int argc, const char **argv,
 	if (remote)
 		die(_("Unexpected option --remote"));
 	if (exec)
-		die(_("Option --exec can only be used together with --remote"));
+		die(_("the option '%s' requires '%s'"), "--exec", "--remote");
 	if (output)
 		die(_("Unexpected option --output"));
 	if (is_remote && args->extra_files.nr)
diff --git a/builtin/add.c b/builtin/add.c
index 4b2754345ad..067ec53d69f 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -541,7 +541,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		die(_("options '%s' and '%s' cannot be used together"), "-A", "-u");
 
 	if (!show_only && ignore_missing)
-		die(_("Option --ignore-missing can only be used together with --dry-run"));
+		die(_("the option '%s' requires '%s'"), "--ignore-missing", "--dry-run");
 
 	if (chmod_arg && ((chmod_arg[0] != '-' && chmod_arg[0] != '+') ||
 			  chmod_arg[1] != 'x' || chmod_arg[2]))
@@ -573,7 +573,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 				    PATHSPEC_SYMLINK_LEADING_PATH,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	if (require_pathspec && pathspec.nr == 0) {
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 73f5a6fbfa1..af5fa8228eb 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1758,7 +1758,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
 				    0,
 				    prefix, opts->pathspec_from_file, opts->pathspec_file_nul);
 	} else if (opts->pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	opts->pathspec.recursive = 1;
diff --git a/builtin/commit.c b/builtin/commit.c
index 067c795ca4b..49e7477747f 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -367,7 +367,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
 				    PATHSPEC_PREFER_FULL,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	if (!pathspec.nr && (also || (only && !allow_empty &&
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 1f8fe7b3ac1..f4d9aa1e8d1 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -1254,7 +1254,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
 		usage_with_options (fast_export_usage, options);
 
 	if (anonymized_seeds.cmpfn && !anonymize)
-		die(_("--anonymize-map without --anonymize does not make sense"));
+		die(_("the option '%s' requires '%s'"), "--anonymize-map", "--anonymize");
 
 	if (refspecs_list.nr) {
 		int i;
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 30ce2ac746d..3c2e6aee3cc 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1845,7 +1845,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
 	if (!pack_name && !from_stdin)
 		usage(index_pack_usage);
 	if (fix_thin_pack && !from_stdin)
-		die(_("--fix-thin cannot be used without --stdin"));
+		die(_("the option '%s' requires '%s'"), "--fix-thin", "--stdin");
 	if (from_stdin && !startup_info->have_repository)
 		die(_("--stdin requires a git repository"));
 	if (from_stdin && hash_algo)
diff --git a/builtin/log.c b/builtin/log.c
index 74b41db1cee..ded042f3e01 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -2112,7 +2112,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	if (creation_factor < 0)
 		creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT;
 	else if (!rdiff_prev)
-		die(_("--creation-factor requires --range-diff"));
+		die(_("the option '%s' requires '%s'"), "--creation-factor", "--range-diff");
 
 	if (rdiff_prev) {
 		if (!cover_letter && total != 1)
diff --git a/builtin/reset.c b/builtin/reset.c
index 248998fd6fa..4779e70dfbe 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -432,7 +432,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 				    PATHSPEC_PREFER_FULL,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid);
@@ -490,7 +490,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 		    _(reset_type_names[reset_type]));
 
 	if (intent_to_add && reset_type != MIXED)
-		die(_("-N can only be used with --mixed"));
+		die(_("the option '%s' requires '%s'"), "-N", "--mixed");
 
 	prepare_repo_settings(the_repository);
 	the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/rm.c b/builtin/rm.c
index 3d0967cdc11..cfdf24cf49a 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -278,7 +278,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 				    PATHSPEC_PREFER_CWD,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	if (!pathspec.nr)
diff --git a/builtin/stash.c b/builtin/stash.c
index 4d793bd0b52..3e3743fd5a3 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1712,7 +1712,7 @@ static int push_stash(int argc, const char **argv, const char *prefix,
 				    PATHSPEC_PREFER_FULL | PATHSPEC_PREFIX_ORIGIN,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
diff --git a/builtin/worktree.c b/builtin/worktree.c
index ec1c59ba53c..2838254f7f2 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -505,7 +505,7 @@ static int add(int ac, const char **av, const char *prefix)
 	if (!!opts.detach + !!new_branch + !!new_branch_force > 1)
 		die(_("options '%s', '%s', and '%s' cannot be used together"), "-b", "-B", "--detach");
 	if (lock_reason && !keep_locked)
-		die(_("--reason requires --lock"));
+		die(_("the option '%s' requires '%s'"), "--reason", "--lock");
 	if (lock_reason)
 		opts.keep_locked = lock_reason;
 	else if (keep_locked)
diff --git a/fetch-pack.c b/fetch-pack.c
index 34987a2c30d..dd6ec449f2d 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -297,7 +297,7 @@ static int find_common(struct fetch_negotiator *negotiator,
 	struct packet_reader reader;
 
 	if (args->stateless_rpc && multi_ack == 1)
-		die(_("--stateless-rpc requires multi_ack_detailed"));
+		die(_("the option '%s' requires '%s'"), "--stateless-rpc", "multi_ack_detailed");
 
 	packet_reader_init(&reader, fd[0], NULL, 0,
 			   PACKET_READ_CHOMP_NEWLINE |
diff --git a/http-fetch.c b/http-fetch.c
index c7c7d391ac5..58b394cd47f 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -141,7 +141,7 @@ int cmd_main(int argc, const char **argv)
 
 	if (packfile) {
 		if (!index_pack_args.nr)
-			die(_("--packfile requires --index-pack-args"));
+			die(_("the option '%s' requires '%s'"), "--packfile", "--index-pack-args");
 
 		fetch_single_packfile(&packfile_hash, argv[arg],
 				      index_pack_args.v);
@@ -150,7 +150,7 @@ int cmd_main(int argc, const char **argv)
 	}
 
 	if (index_pack_args.nr)
-		die(_("--index-pack-args can only be used with --packfile"));
+		die(_("the option '%s' requires '%s'"), "--index-pack-args", "--packfile");
 
 	if (commits_on_stdin) {
 		commits = walker_targets_stdin(&commit_id, &write_ref);
diff --git a/revision.c b/revision.c
index d28b63a3253..13ccc6829f1 100644
--- a/revision.c
+++ b/revision.c
@@ -2884,7 +2884,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
 	if (revs->no_walk && revs->graph)
 		die(_("options '%s' and '%s' cannot be used together"), "--no-walk", "--graph");
 	if (!revs->reflog_info && revs->grep_filter.use_reflog_filter)
-		die("cannot use --grep-reflog without --walk-reflogs");
+		die(_("the option '%s' requires '%s'"), "--grep-reflog", "--walk-reflogs");
 
 	if (revs->line_level_traverse &&
 	    (revs->diffopt.output_format & ~(DIFF_FORMAT_PATCH | DIFF_FORMAT_NO_OUTPUT)))
diff --git a/t/t2026-checkout-pathspec-file.sh b/t/t2026-checkout-pathspec-file.sh
index fbe26de2f90..9e6b17e2d23 100755
--- a/t/t2026-checkout-pathspec-file.sh
+++ b/t/t2026-checkout-pathspec-file.sh
@@ -158,7 +158,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
 
 	test_must_fail git checkout --pathspec-file-nul 2>err &&
-	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err
+	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err
 '
 
 test_done
diff --git a/t/t2072-restore-pathspec-file.sh b/t/t2072-restore-pathspec-file.sh
index ad1fc0ed071..af67ca7d52b 100755
--- a/t/t2072-restore-pathspec-file.sh
+++ b/t/t2072-restore-pathspec-file.sh
@@ -158,7 +158,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
 
 	test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err &&
-	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err &&
+	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
 
 	test_must_fail git restore --pathspec-from-file=empty_list --source=HEAD^1 2>err &&
 	test_i18ngrep -e "you must specify path(s) to restore" err
diff --git a/t/t3601-rm-pathspec-file.sh b/t/t3601-rm-pathspec-file.sh
index b2a8db69afc..bbed67f8ef5 100755
--- a/t/t3601-rm-pathspec-file.sh
+++ b/t/t3601-rm-pathspec-file.sh
@@ -70,7 +70,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
 
 	test_must_fail git rm --pathspec-file-nul 2>err &&
-	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err &&
+	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
 
 	>empty_list &&
 	test_must_fail git rm --pathspec-from-file=empty_list 2>err &&
diff --git a/t/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh
index 7e17ae80229..47ad96bf661 100755
--- a/t/t3704-add-pathspec-file.sh
+++ b/t/t3704-add-pathspec-file.sh
@@ -150,7 +150,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
 
 	test_must_fail git add --pathspec-file-nul 2>err &&
-	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err &&
+	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
 
 	# This case succeeds, but still prints to stderr
 	git add --pathspec-from-file=empty_list 2>err &&
diff --git a/t/t3909-stash-pathspec-file.sh b/t/t3909-stash-pathspec-file.sh
index aae2b25f766..fde4625cfcb 100755
--- a/t/t3909-stash-pathspec-file.sh
+++ b/t/t3909-stash-pathspec-file.sh
@@ -94,7 +94,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
 
 	test_must_fail git stash push --pathspec-file-nul 2>err &&
-	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err
+	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err
 '
 
 test_done
diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh
index b211fbc0a52..f753e3229e2 100755
--- a/t/t7107-reset-pathspec-file.sh
+++ b/t/t7107-reset-pathspec-file.sh
@@ -166,7 +166,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
 
 	test_must_fail git reset --pathspec-file-nul 2>err &&
-	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err &&
+	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
 
 	test_must_fail git reset --soft --pathspec-from-file=list 2>err &&
 	test_i18ngrep -e "fatal: Cannot do soft reset with paths" err &&
diff --git a/t/t7526-commit-pathspec-file.sh b/t/t7526-commit-pathspec-file.sh
index 574cf30285c..ea69e3a6ad1 100755
--- a/t/t7526-commit-pathspec-file.sh
+++ b/t/t7526-commit-pathspec-file.sh
@@ -153,7 +153,7 @@ test_expect_success 'error conditions' '
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
 
 	test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err &&
-	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err &&
+	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
 
 	test_must_fail git commit --pathspec-from-file=empty_list --include -m "Commit" 2>err &&
 	test_i18ngrep -e "No paths with --include/--only does not make sense." err &&
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH v5 07/11] i18n: factorize "no directory given for --foo"
From: Jean-Noël Avila via GitGitGadget @ 2022-01-05 20:02 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Sixt, Ævar Arnfjörð Bjarmason,
	René Scharfe, Jean-Noël Avila, Jean-Noël Avila
In-Reply-To: <pull.1088.v5.git.1641412944.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 git.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/git.c b/git.c
index 7edafd8ecff..edda922ce6d 100644
--- a/git.c
+++ b/git.c
@@ -185,7 +185,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
 				*envchanged = 1;
 		} else if (!strcmp(cmd, "--git-dir")) {
 			if (*argc < 2) {
-				fprintf(stderr, _("no directory given for --git-dir\n" ));
+				fprintf(stderr, _("no directory given for '%s' option\n" ), "--git-dir");
 				usage(git_usage_string);
 			}
 			setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);
@@ -213,7 +213,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
 				*envchanged = 1;
 		} else if (!strcmp(cmd, "--work-tree")) {
 			if (*argc < 2) {
-				fprintf(stderr, _("no directory given for --work-tree\n" ));
+				fprintf(stderr, _("no directory given for '%s' option\n" ), "--work-tree");
 				usage(git_usage_string);
 			}
 			setenv(GIT_WORK_TREE_ENVIRONMENT, (*argv)[1], 1);
@@ -297,7 +297,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
 				*envchanged = 1;
 		} else if (!strcmp(cmd, "-C")) {
 			if (*argc < 2) {
-				fprintf(stderr, _("no directory given for -C\n" ));
+				fprintf(stderr, _("no directory given for '%s' option\n" ), "-C");
 				usage(git_usage_string);
 			}
 			if ((*argv)[1][0]) {
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH v5 05/11] i18n: tag.c factorize i18n strings
From: Jean-Noël Avila via GitGitGadget @ 2022-01-05 20:02 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Sixt, Ævar Arnfjörð Bjarmason,
	René Scharfe, Jean-Noël Avila, Jean-Noël Avila
In-Reply-To: <pull.1088.v5.git.1641412944.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 builtin/tag.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/builtin/tag.c b/builtin/tag.c
index dfdcfd37956..8f372a41078 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -483,6 +483,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 	int ret = 0;
+	const char *only_in_list = NULL;
 
 	setup_ref_filter_porcelain_msg();
 
@@ -542,15 +543,19 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 		goto cleanup;
 	}
 	if (filter.lines != -1)
-		die(_("-n option is only allowed in list mode"));
-	if (filter.with_commit)
-		die(_("--contains option is only allowed in list mode"));
-	if (filter.no_commit)
-		die(_("--no-contains option is only allowed in list mode"));
-	if (filter.points_at.nr)
-		die(_("--points-at option is only allowed in list mode"));
-	if (filter.reachable_from || filter.unreachable_from)
-		die(_("--merged and --no-merged options are only allowed in list mode"));
+		only_in_list = "-n";
+	else if (filter.with_commit)
+		only_in_list = "--contains";
+	else if (filter.no_commit)
+		only_in_list = "--no-contains";
+	else if (filter.points_at.nr)
+		only_in_list = "--points-at";
+	else if (filter.reachable_from)
+		only_in_list = "--merged";
+	else if  (filter.unreachable_from)
+		only_in_list = "--no-merged";
+	if (only_in_list)
+		die(_("the '%s' option is only allowed in list mode"), only_in_list);
 	if (cmdmode == 'd') {
 		ret = delete_tags(argv);
 		goto cleanup;
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH v5 03/11] i18n: turn "options are incompatible" into "cannot be used together"
From: Jean-Noël Avila via GitGitGadget @ 2022-01-05 20:02 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Sixt, Ævar Arnfjörð Bjarmason,
	René Scharfe, Jean-Noël Avila, Jean-Noël Avila
In-Reply-To: <pull.1088.v5.git.1641412944.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 apply.c                           |  2 +-
 archive.c                         |  2 +-
 builtin/add.c                     |  8 ++++----
 builtin/branch.c                  |  2 +-
 builtin/checkout.c                |  8 ++++----
 builtin/clone.c                   |  2 +-
 builtin/commit.c                  |  6 +++---
 builtin/describe.c                |  2 +-
 builtin/difftool.c                |  2 +-
 builtin/fast-export.c             |  2 +-
 builtin/index-pack.c              |  2 +-
 builtin/ls-files.c                |  2 +-
 builtin/merge.c                   |  4 ++--
 builtin/pack-objects.c            |  2 +-
 builtin/push.c                    |  8 ++++----
 builtin/rebase.c                  |  6 +++---
 builtin/repack.c                  |  4 ++--
 builtin/reset.c                   |  4 ++--
 builtin/rev-list.c                |  2 +-
 builtin/show-branch.c             |  4 ++--
 builtin/stash.c                   |  4 ++--
 builtin/tag.c                     |  4 ++--
 revision.c                        | 20 ++++++++++----------
 t/t2026-checkout-pathspec-file.sh |  4 ++--
 t/t2072-restore-pathspec-file.sh  |  2 +-
 t/t3431-rebase-fork-point.sh      |  2 +-
 t/t3704-add-pathspec-file.sh      |  6 +++---
 t/t3909-stash-pathspec-file.sh    |  2 +-
 t/t5606-clone-options.sh          |  2 +-
 t/t7107-reset-pathspec-file.sh    |  2 +-
 t/t7526-commit-pathspec-file.sh   |  6 +++---
 31 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/apply.c b/apply.c
index fed195250b6..cabcdbe425a 100644
--- a/apply.c
+++ b/apply.c
@@ -133,7 +133,7 @@ int check_apply_state(struct apply_state *state, int force_apply)
 	int is_not_gitdir = !startup_info->have_repository;
 
 	if (state->apply_with_reject && state->threeway)
-		return error(_("--reject and --3way cannot be used together."));
+		return error(_("options '%s' and '%s' cannot be used together"), "--reject", "--3way");
 	if (state->threeway) {
 		if (is_not_gitdir)
 			return error(_("--3way outside a repository"));
diff --git a/archive.c b/archive.c
index a3bbb091256..e85ba169088 100644
--- a/archive.c
+++ b/archive.c
@@ -581,7 +581,7 @@ static int parse_archive_args(int argc, const char **argv,
 	if (output)
 		die(_("Unexpected option --output"));
 	if (is_remote && args->extra_files.nr)
-		die(_("Options --add-file and --remote cannot be used together"));
+		die(_("options '%s' and '%s' cannot be used together"), "--add-file", "--remote");
 
 	if (!base)
 		base = "";
diff --git a/builtin/add.c b/builtin/add.c
index a010b2c325f..4b2754345ad 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -507,9 +507,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		add_interactive = 1;
 	if (add_interactive) {
 		if (show_only)
-			die(_("--dry-run is incompatible with --interactive/--patch"));
+			die(_("options '%s' and '%s' cannot be used together"), "--dry-run", "--interactive/--patch");
 		if (pathspec_from_file)
-			die(_("--pathspec-from-file is incompatible with --interactive/--patch"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
 		exit(interactive_add(argv + 1, prefix, patch_interactive));
 	}
 	if (legacy_stash_p) {
@@ -526,7 +526,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 
 	if (edit_interactive) {
 		if (pathspec_from_file)
-			die(_("--pathspec-from-file is incompatible with --edit"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--edit");
 		return(edit_patch(argc, argv, prefix));
 	}
 	argc--;
@@ -538,7 +538,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		addremove = 0; /* "-u" was given but not "-A" */
 
 	if (addremove && take_worktree_changes)
-		die(_("-A and -u are mutually incompatible"));
+		die(_("options '%s' and '%s' cannot be used together"), "-A", "-u");
 
 	if (!show_only && ignore_missing)
 		die(_("Option --ignore-missing can only be used together with --dry-run"));
diff --git a/builtin/branch.c b/builtin/branch.c
index 6c8b0fcc11f..0e93865371c 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -722,7 +722,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 	finalize_colopts(&colopts, -1);
 	if (filter.verbose) {
 		if (explicitly_enable_column(colopts))
-			die(_("--column and --verbose are incompatible"));
+			die(_("options '%s' and '%s' cannot be used together"), "--column", "--verbose");
 		colopts = 0;
 	}
 
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 79014e1cb6c..73f5a6fbfa1 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -464,10 +464,10 @@ static int checkout_paths(const struct checkout_opts *opts,
 		die(_("'%s' cannot be used with updating paths"), "--detach");
 
 	if (opts->merge && opts->patch_mode)
-		die(_("'%s' cannot be used with %s"), "--merge", "--patch");
+		die(_("options '%s' and '%s' cannot be used together"), "--merge", "--patch");
 
 	if (opts->ignore_unmerged && opts->merge)
-		die(_("'%s' cannot be used with %s"),
+		die(_("options '%s' and '%s' cannot be used together"),
 		    opts->ignore_unmerged_opt, "-m");
 
 	if (opts->new_branch)
@@ -1749,10 +1749,10 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
 			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
 
 		if (opts->force_detach)
-			die(_("--pathspec-from-file is incompatible with --detach"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--detach");
 
 		if (opts->patch_mode)
-			die(_("--pathspec-from-file is incompatible with --patch"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
 
 		parse_pathspec_file(&opts->pathspec, 0,
 				    0,
diff --git a/builtin/clone.c b/builtin/clone.c
index fb377b27657..13bdbe14b2f 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -903,7 +903,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			die(_("--bare and --origin %s options are incompatible."),
 			    option_origin);
 		if (real_git_dir)
-			die(_("--bare and --separate-git-dir are incompatible."));
+			die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir");
 		option_no_checkout = 1;
 	}
 
diff --git a/builtin/commit.c b/builtin/commit.c
index 883c16256c8..067c795ca4b 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -355,10 +355,10 @@ static const char *prepare_index(const char **argv, const char *prefix,
 
 	if (pathspec_from_file) {
 		if (interactive)
-			die(_("--pathspec-from-file is incompatible with --interactive/--patch"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
 
 		if (all)
-			die(_("--pathspec-from-file with -a does not make sense"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "-a");
 
 		if (pathspec.nr)
 			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
@@ -1193,7 +1193,7 @@ static void finalize_deferred_config(struct wt_status *s)
 		    status_format == STATUS_FORMAT_UNSPECIFIED)
 			status_format = STATUS_FORMAT_PORCELAIN;
 		else if (status_format == STATUS_FORMAT_LONG)
-			die(_("--long and -z are incompatible"));
+			die(_("options '%s' and '%s' cannot be used together"), "--long", "-z");
 	}
 
 	if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED)
diff --git a/builtin/describe.c b/builtin/describe.c
index e912ba50d7b..fd5ba1fc604 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -590,7 +590,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 	save_commit_buffer = 0;
 
 	if (longformat && abbrev == 0)
-		die(_("--long is incompatible with --abbrev=0"));
+		die(_("options '%s' and '%s' cannot be used together"), "--long", "--abbrev=0");
 
 	if (contains) {
 		struct string_list_item *item;
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 5beadc07ccd..c79fbbf67e5 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -730,7 +730,7 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
 		setenv(GIT_DIR_ENVIRONMENT, absolute_path(get_git_dir()), 1);
 		setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1);
 	} else if (dir_diff)
-		die(_("--dir-diff is incompatible with --no-index"));
+		die(_("options '%s' and '%s' cannot be used together"), "--dir-diff", "--no-index");
 
 	if (use_gui_tool + !!difftool_cmd + !!extcmd > 1)
 		die(_("options '%s', '%s', and '%s' cannot be used together"), "--gui", "--tool", "--extcmd");
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 8e2caf72819..1f8fe7b3ac1 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -1269,7 +1269,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
 		printf("feature done\n");
 
 	if (import_filename && import_filename_if_exists)
-		die(_("Cannot pass both --import-marks and --import-marks-if-exists"));
+		die(_("options '%s' and '%s' cannot be used together"), "--import-marks", "--import-marks-if-exists");
 	if (import_filename)
 		import_marks(import_filename, 0);
 	else if (import_filename_if_exists)
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index c23d01de7dc..30ce2ac746d 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1849,7 +1849,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
 	if (from_stdin && !startup_info->have_repository)
 		die(_("--stdin requires a git repository"));
 	if (from_stdin && hash_algo)
-		die(_("--object-format cannot be used with --stdin"));
+		die(_("options '%s' and '%s' cannot be used together"), "--object-format", "--stdin");
 	if (!index_name && pack_name)
 		index_name = derive_filename(pack_name, "pack", "idx", &index_name_buf);
 
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 031fef1bcaa..9c80cdae951 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -767,7 +767,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
 		 * would not make any sense with this option.
 		 */
 		if (show_stage || show_unmerged)
-			die("ls-files --with-tree is incompatible with -s or -u");
+			die(_("options '%s' and '%s' cannot be used together"), "ls-files --with-tree", "-s/-u");
 		overlay_tree_on_index(the_repository->index, with_tree, max_prefix);
 	}
 
diff --git a/builtin/merge.c b/builtin/merge.c
index 5f0476b0b76..6db961e9d34 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1396,9 +1396,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 
 	if (squash) {
 		if (fast_forward == FF_NO)
-			die(_("You cannot combine --squash with --no-ff."));
+			die(_("options '%s' and '%s' cannot be used together"), "--squash", "--no-ff.");
 		if (option_commit > 0)
-			die(_("You cannot combine --squash with --commit."));
+			die(_("options '%s' and '%s' cannot be used together"), "--squash", "--commit.");
 		/*
 		 * squash can now silently disable option_commit - this is not
 		 * a problem as it is only overriding the default, not a user
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index b36ed828d8d..ba2006f2212 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -4070,7 +4070,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 		die(_("--thin cannot be used to build an indexable pack"));
 
 	if (keep_unreachable && unpack_unreachable)
-		die(_("--keep-unreachable and --unpack-unreachable are incompatible"));
+		die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "--unpack-unreachable");
 	if (!rev_list_all || !rev_list_reflog || !rev_list_index)
 		unpack_unreachable_expiration = 0;
 
diff --git a/builtin/push.c b/builtin/push.c
index 4b026ce6c6a..359db90321c 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -589,7 +589,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 	set_push_cert_flags(&flags, push_cert);
 
 	if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
-		die(_("--delete is incompatible with --all, --mirror and --tags"));
+		die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--mirror/--tags");
 	if (deleterefs && argc < 2)
 		die(_("--delete doesn't make sense without any refs"));
 
@@ -627,18 +627,18 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 
 	if (flags & TRANSPORT_PUSH_ALL) {
 		if (tags)
-			die(_("--all and --tags are incompatible"));
+			die(_("options '%s' and '%s' cannot be used together"), "--all", "--tags");
 		if (argc >= 2)
 			die(_("--all can't be combined with refspecs"));
 	}
 	if (flags & TRANSPORT_PUSH_MIRROR) {
 		if (tags)
-			die(_("--mirror and --tags are incompatible"));
+			die(_("options '%s' and '%s' cannot be used together"), "--mirror", "--tags");
 		if (argc >= 2)
 			die(_("--mirror can't be combined with refspecs"));
 	}
 	if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR))
-		die(_("--all and --mirror are incompatible"));
+		die(_("options '%s' and '%s' cannot be used together"), "--all", "--mirror");
 
 	if (!is_empty_cas(&cas) && (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES))
 		cas.use_force_if_includes = 1;
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 34b4744e5f3..16e6053b14a 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1190,13 +1190,13 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 
 	if (keep_base) {
 		if (options.onto_name)
-			die(_("cannot combine '--keep-base' with '--onto'"));
+			die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--onto");
 		if (options.root)
-			die(_("cannot combine '--keep-base' with '--root'"));
+			die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--root");
 	}
 
 	if (options.root && options.fork_point > 0)
-		die(_("cannot combine '--root' with '--fork-point'"));
+		die(_("options '%s' and '%s' cannot be used together"), "--root", "--fork-point");
 
 	if (action != ACTION_NONE && !in_progress)
 		die(_("No rebase in progress?"));
diff --git a/builtin/repack.c b/builtin/repack.c
index 9b0be6a6ab3..b7b54781bd2 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -681,7 +681,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 
 	if (keep_unreachable &&
 	    (unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE)))
-		die(_("--keep-unreachable and -A are incompatible"));
+		die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "-A");
 
 	if (write_bitmaps < 0) {
 		if (!write_midx &&
@@ -712,7 +712,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 
 	if (geometric_factor) {
 		if (pack_everything)
-			die(_("--geometric is incompatible with -A, -a"));
+			die(_("options '%s' and '%s' cannot be used together"), "--geometric", "-A/-a");
 		init_pack_geometry(&geometry);
 		split_pack_geometry(geometry, geometric_factor);
 	}
diff --git a/builtin/reset.c b/builtin/reset.c
index b1ff699b43a..248998fd6fa 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -423,7 +423,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 
 	if (pathspec_from_file) {
 		if (patch_mode)
-			die(_("--pathspec-from-file is incompatible with --patch"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
 
 		if (pathspec.nr)
 			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
@@ -459,7 +459,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 
 	if (patch_mode) {
 		if (reset_type != NONE)
-			die(_("--patch is incompatible with --{hard,mixed,soft}"));
+			die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}");
 		trace2_cmd_mode("patch-interactive");
 		return run_add_interactive(rev, "--patch=reset", &pathspec);
 	}
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 36cb909ebaa..c1a3b0b3591 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -538,7 +538,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
 		const char *arg = argv[i];
 		if (skip_prefix(arg, "--missing=", &arg)) {
 			if (revs.exclude_promisor_objects)
-				die(_("cannot combine --exclude-promisor-objects and --missing"));
+				die(_("options '%s' and '%s' cannot be used together"), "--exclude-promisor-objects", "--missing");
 			if (parse_missing_action_value(arg))
 				break;
 		}
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index f1e8318592c..e12c5e80e3e 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -707,8 +707,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 			 *
 			 * Also --all and --remotes do not make sense either.
 			 */
-			die(_("--reflog is incompatible with --all, --remotes, "
-			      "--independent or --merge-base"));
+			die(_("options '%s' and '%s' cannot be used together"), "--reflog",
+				"--all/--remotes/--independent/--merge-base");
 	}
 
 	/* If nothing is specified, show all branches by default */
diff --git a/builtin/stash.c b/builtin/stash.c
index 18c812bbe03..4d793bd0b52 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1700,10 +1700,10 @@ static int push_stash(int argc, const char **argv, const char *prefix,
 
 	if (pathspec_from_file) {
 		if (patch_mode)
-			die(_("--pathspec-from-file is incompatible with --patch"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
 
 		if (only_staged)
-			die(_("--pathspec-from-file is incompatible with --staged"));
+			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--staged");
 
 		if (ps.nr)
 			die(_("--pathspec-from-file is incompatible with pathspec arguments"));
diff --git a/builtin/tag.c b/builtin/tag.c
index 41863c5ab77..dfdcfd37956 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -522,7 +522,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 	finalize_colopts(&colopts, -1);
 	if (cmdmode == 'l' && filter.lines != -1) {
 		if (explicitly_enable_column(colopts))
-			die(_("--column and -n are incompatible"));
+			die(_("options '%s' and '%s' cannot be used together"), "--column", "-n");
 		colopts = 0;
 	}
 	sorting = ref_sorting_options(&sorting_options);
@@ -564,7 +564,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
 	if (msg.given || msgfile) {
 		if (msg.given && msgfile)
-			die(_("only one -F or -m option is allowed."));
+			die(_("options '%s' and '%s' cannot be used together"), "-F", "-m");
 		if (msg.given)
 			strbuf_addbuf(&buf, &(msg.buf));
 		else {
diff --git a/revision.c b/revision.c
index 5390a479b30..d28b63a3253 100644
--- a/revision.c
+++ b/revision.c
@@ -2300,11 +2300,11 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 		revs->left_only = 1;
 	} else if (!strcmp(arg, "--right-only")) {
 		if (revs->left_only)
-			die("--right-only is incompatible with --left-only");
+			die(_("options '%s' and '%s' cannot be used together"), "--right-only", "--left-only");
 		revs->right_only = 1;
 	} else if (!strcmp(arg, "--cherry")) {
 		if (revs->left_only)
-			die("--cherry is incompatible with --left-only");
+			die(_("options '%s' and '%s' cannot be used together"), "--cherry", "--left-only");
 		revs->cherry_mark = 1;
 		revs->right_only = 1;
 		revs->max_parents = 1;
@@ -2313,12 +2313,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 		revs->count = 1;
 	} else if (!strcmp(arg, "--cherry-mark")) {
 		if (revs->cherry_pick)
-			die("--cherry-mark is incompatible with --cherry-pick");
+			die(_("options '%s' and '%s' cannot be used together"), "--cherry-mark", "--cherry-pick");
 		revs->cherry_mark = 1;
 		revs->limited = 1; /* needs limit_list() */
 	} else if (!strcmp(arg, "--cherry-pick")) {
 		if (revs->cherry_mark)
-			die("--cherry-pick is incompatible with --cherry-mark");
+			die(_("options '%s' and '%s' cannot be used together"), "--cherry-pick", "--cherry-mark");
 		revs->cherry_pick = 1;
 		revs->limited = 1;
 	} else if (!strcmp(arg, "--objects")) {
@@ -2524,7 +2524,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 		return opts;
 	}
 	if (revs->graph && revs->track_linear)
-		die("--show-linear-break and --graph are incompatible");
+		die(_("options '%s' and '%s' cannot be used together"), "--show-linear-break", "--graph");
 
 	return 1;
 }
@@ -2867,22 +2867,22 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
 	compile_grep_patterns(&revs->grep_filter);
 
 	if (revs->reverse && revs->reflog_info)
-		die("cannot combine --reverse with --walk-reflogs");
+		die(_("options '%s' and '%s' cannot be used together"), "--reverse", "--walk-reflogs");
 	if (revs->reflog_info && revs->limited)
 		die("cannot combine --walk-reflogs with history-limiting options");
 	if (revs->rewrite_parents && revs->children.name)
-		die("cannot combine --parents and --children");
+		die(_("options '%s' and '%s' cannot be used together"), "--parents", "--children");
 
 	/*
 	 * Limitations on the graph functionality
 	 */
 	if (revs->reverse && revs->graph)
-		die("cannot combine --reverse with --graph");
+		die(_("options '%s' and '%s' cannot be used together"), "--reverse", "--graph");
 
 	if (revs->reflog_info && revs->graph)
-		die("cannot combine --walk-reflogs with --graph");
+		die(_("options '%s' and '%s' cannot be used together"), "--walk-reflogs", "--graph");
 	if (revs->no_walk && revs->graph)
-		die("cannot combine --no-walk with --graph");
+		die(_("options '%s' and '%s' cannot be used together"), "--no-walk", "--graph");
 	if (!revs->reflog_info && revs->grep_filter.use_reflog_filter)
 		die("cannot use --grep-reflog without --walk-reflogs");
 
diff --git a/t/t2026-checkout-pathspec-file.sh b/t/t2026-checkout-pathspec-file.sh
index 9db11f86dd6..fbe26de2f90 100755
--- a/t/t2026-checkout-pathspec-file.sh
+++ b/t/t2026-checkout-pathspec-file.sh
@@ -149,10 +149,10 @@ test_expect_success 'error conditions' '
 	echo fileA.t >list &&
 
 	test_must_fail git checkout --pathspec-from-file=list --detach 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --detach" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--detach. cannot be used together" err &&
 
 	test_must_fail git checkout --pathspec-from-file=list --patch 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
 
 	test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err &&
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
diff --git a/t/t2072-restore-pathspec-file.sh b/t/t2072-restore-pathspec-file.sh
index b48345bf95f..ad1fc0ed071 100755
--- a/t/t2072-restore-pathspec-file.sh
+++ b/t/t2072-restore-pathspec-file.sh
@@ -152,7 +152,7 @@ test_expect_success 'error conditions' '
 	>empty_list &&
 
 	test_must_fail git restore --pathspec-from-file=list --patch --source=HEAD^1 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
 
 	test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err &&
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
index 4c98d99e7e8..1d0b15380ed 100755
--- a/t/t3431-rebase-fork-point.sh
+++ b/t/t3431-rebase-fork-point.sh
@@ -83,7 +83,7 @@ test_expect_success 'git rebase --fork-point with ambigous refname' '
 
 test_expect_success '--fork-point and --root both given' '
 	test_must_fail git rebase --fork-point --root 2>err &&
-	test_i18ngrep "cannot combine" err
+	test_i18ngrep "cannot be used together" err
 '
 
 test_expect_success 'rebase.forkPoint set to false' '
diff --git a/t/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh
index 5d5164d1fc6..7e17ae80229 100755
--- a/t/t3704-add-pathspec-file.sh
+++ b/t/t3704-add-pathspec-file.sh
@@ -138,13 +138,13 @@ test_expect_success 'error conditions' '
 	>empty_list &&
 
 	test_must_fail git add --pathspec-from-file=list --interactive 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
 
 	test_must_fail git add --pathspec-from-file=list --patch 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
 
 	test_must_fail git add --pathspec-from-file=list --edit 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --edit" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err &&
 
 	test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err &&
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
diff --git a/t/t3909-stash-pathspec-file.sh b/t/t3909-stash-pathspec-file.sh
index 55e050cfd4d..aae2b25f766 100755
--- a/t/t3909-stash-pathspec-file.sh
+++ b/t/t3909-stash-pathspec-file.sh
@@ -88,7 +88,7 @@ test_expect_success 'error conditions' '
 	echo fileA.t >list &&
 
 	test_must_fail git stash push --pathspec-from-file=list --patch 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
 
 	test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err &&
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index d822153e4d2..3af3577af0b 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -54,7 +54,7 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
 
 	test_must_fail git clone --bare --separate-git-dir dot-git-destiation parent clone-bare-sgd 2>err &&
 	test_debug "cat err" &&
-	test_i18ngrep -e "--bare and --separate-git-dir are incompatible" err
+	test_i18ngrep -e "options .--bare. and .--separate-git-dir. cannot be used together" err
 
 '
 
diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh
index 15ccb14f7e2..b211fbc0a52 100755
--- a/t/t7107-reset-pathspec-file.sh
+++ b/t/t7107-reset-pathspec-file.sh
@@ -160,7 +160,7 @@ test_expect_success 'error conditions' '
 	git rm fileA.t &&
 
 	test_must_fail git reset --pathspec-from-file=list --patch 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
 
 	test_must_fail git reset --pathspec-from-file=list -- fileA.t 2>err &&
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
diff --git a/t/t7526-commit-pathspec-file.sh b/t/t7526-commit-pathspec-file.sh
index dca62fc48e5..574cf30285c 100755
--- a/t/t7526-commit-pathspec-file.sh
+++ b/t/t7526-commit-pathspec-file.sh
@@ -141,13 +141,13 @@ test_expect_success 'error conditions' '
 	>empty_list &&
 
 	test_must_fail git commit --pathspec-from-file=list --interactive -m "Commit" 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
 
 	test_must_fail git commit --pathspec-from-file=list --patch -m "Commit" 2>err &&
-	test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
 
 	test_must_fail git commit --pathspec-from-file=list --all -m "Commit" 2>err &&
-	test_i18ngrep -e "--pathspec-from-file with -a does not make sense" err &&
+	test_i18ngrep -e "options .--pathspec-from-file. and .-a. cannot be used together" err &&
 
 	test_must_fail git commit --pathspec-from-file=list -m "Commit" -- fileA.t 2>err &&
 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
-- 
gitgitgadget


^ permalink raw reply related


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.