* Re: Migrate away from vger to GitHub or (on-premise) GitLab?
From: Junio C Hamano @ 2024-02-02 17:39 UTC (permalink / raw)
To: rsbecker; +Cc: git
In-Reply-To: <009601da55fa$1ecc9580$5c65c080$@nexbridge.com>
<rsbecker@nexbridge.com> writes:
> I should have qualified this with "free" NNTP. I have only been able to find
> for fee NNTP servers where I am. The search continues.
The NNTP server "nntp.lore.kernel.org" carries the mailing list
served by lore.kernel.org archives, including this list.
^ permalink raw reply
* Re: [PATCH v2 2/2] add-patch: classify '@' as a synonym for 'HEAD'
From: Junio C Hamano @ 2024-02-02 17:43 UTC (permalink / raw)
To: Ghanshyam Thakkar; +Cc: git, ps
In-Reply-To: <xmqqh6iqu73y.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> You decided to use is_rev_head() instead of user_meant_head(), so
> you'd need to update the above description to match, I think.
Having said this, I have a slight fear that normal users would
expect is_rev_head(X) to say "yes" for "master" when the current
branch is "master", though. is_head(X) would have the same
downside.
^ permalink raw reply
* RE: Migrate away from vger to GitHub or (on-premise) GitLab?
From: rsbecker @ 2024-02-02 17:50 UTC (permalink / raw)
To: 'Junio C Hamano'; +Cc: git
In-Reply-To: <xmqq1q9uu5nc.fsf@gitster.g>
On Friday, February 2, 2024 12:40 PM, Junio wrote:
>To: rsbecker@nexbridge.com
>Cc: git@vger.kernel.org
>Subject: Re: Migrate away from vger to GitHub or (on-premise) GitLab?
><rsbecker@nexbridge.com> writes:
>
>> I should have qualified this with "free" NNTP. I have only been able
>> to find for fee NNTP servers where I am. The search continues.
>
>The NNTP server "nntp.lore.kernel.org" carries the mailing list served by
>lore.kernel.org archives, including this list.
Thanks. This is sufficient for git. Appreciate it.
^ permalink raw reply
* Re: [PATCH v2 2/2] add-patch: classify '@' as a synonym for 'HEAD'
From: Ghanshyam Thakkar @ 2024-02-02 17:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, ps
In-Reply-To: <xmqqh6iqu73y.fsf@gitster.g>
On Fri Feb 2, 2024 at 10:38 PM IST, Junio C Hamano wrote:
> Ghanshyam Thakkar <shyamthakkar001@gmail.com> writes:
>
> > Currently, (checkout, reset, restore) commands correctly take '@' as a
> > synonym for 'HEAD'. However, in patch mode (-p/--patch), for both '@' and
> > 'HEAD', different prompts/messages are given by the commands mentioned
> > above. This is due to the literal and only string comparison with the word
> > 'HEAD' in run_add_p(). Synonymity between '@' and 'HEAD' is obviously
> > desired, especially since '@' already resolves to 'HEAD'.
> >
> > Therefore, make a new function user_meant_head() which takes the
> > revision string and compares it to 'HEAD' as well as '@'. However, in
> > builtin/checkout.c, there is some logic to convert all revs besides
> > 'HEAD' to hex revs due to 'diff-index', which is used in patch mode
> > machinery, not being able to handle '<a>...<b>' revs. Therefore, in
> > addition to 'HEAD', do not convert '@' as well, so it can be later
> > used in assigning patch_mode_(...)_head.
>
> In this context <a>...<b> names a single rev (not two revs) that is
> the merge base of <a> and <b>. Perhaps
I meant revs which are spelled out in the form of <a>...<b> and not the
<a> and <b> themselves. But I can see how it can be confusing. I will
change it.
> ... there is a logic to convert all command line input rev to
> the raw object name for underlying machinery (e.g., diff-index)
> that does not recognize the <a>...<b> notation, but we'd need to
> leave "HEAD" intact. Now we need to teach that "@" is a synonym
> to "HEAD" to that code, too.
>
> which may be a bit shorter.
Yeah, that is much better and clearer also.
> You decided to use is_rev_head() instead of user_meant_head(), so
> you'd need to update the above description to match, I think.
Will update.
> > - if (rev && new_branch_info->commit && strcmp(rev, "HEAD"))
> > + if (rev && new_branch_info->commit && strcmp(rev, "HEAD") &&
> > + strcmp(rev, "@"))
>
> Shouldn't this be
>
> if (rev && new_branch_info->commit && !is_rev_head(rev))
>
> instead of "HEAD" and "@" spelled out?
is_rev_head() is in add-patch.c and the above is in
builtin/checkout.c and is_rev_head() is not exported. I can also define
it in builtin/checkout.c, but this would be the only instance in that
file which will use it. So, I think it is better to just add
strcmp(rev, "@") to the if condition.
^ permalink raw reply
* Re: [PATCH v2 2/2] add-patch: classify '@' as a synonym for 'HEAD'
From: Ghanshyam Thakkar @ 2024-02-02 17:53 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, ps
In-Reply-To: <xmqqv876sqwf.fsf@gitster.g>
On Fri Feb 2, 2024 at 11:13 PM IST, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
> > You decided to use is_rev_head() instead of user_meant_head(), so
> > you'd need to update the above description to match, I think.
>
> Having said this, I have a slight fear that normal users would
> expect is_rev_head(X) to say "yes" for "master" when the current
> branch is "master", though. is_head(X) would have the same
> downside.
Yeah, user_meant_head() looks like the better pick. I'll update it.
^ permalink raw reply
* [PATCH] sparse-index: pass string length to index_file_exists()
From: Jeff Hostetler via GitGitGadget @ 2024-02-02 18:04 UTC (permalink / raw)
To: git; +Cc: Jeff Hostetler, Jeff Hostetler
From: Jeff Hostetler <jeffhostetler@github.com>
The call to index_file_exists() in the loop in expand_to_path() passes
the wrong string length. Let's fix that.
The loop in expand_to_path() searches the name-hash for each
sub-directory prefix in the provided pathname. That is, by searching
for "dir1/" then "dir1/dir2/" then "dir1/dir2/dir3/" and so on until
it finds a cache-entry representing a sparse directory.
The code creates "strbuf path_mutable" to contain the working pathname
and modifies the buffer in-place by temporarily replacing the character
following each successive "/" with NUL for the duration of the call to
index_file_exists().
It does not update the strbuf.len during this substitution.
Pass the patched length of the prefix path instead.
Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
---
sparse-index: pass string length to index_file_exists()
The call to index_file_exists() in the loop in expand_to_path() passes
the wrong string length. Let's fix that.
The loop in expand_to_path() searches the name-hash for each
sub-directory prefix in the provided pathname. That is, by searching for
"dir1/" then "dir1/dir2/" then "dir1/dir2/dir3/" and so on until it
finds a cache-entry representing a sparse directory.
The code creates "strbuf path_mutable" to contain the working pathname
and modifies the buffer in-place by temporarily replacing the character
following each successive "/" with NUL for the duration of the call to
index_file_exists().
It does not update the strbuf.len during this substitution.
Pass the patched length of the prefix path instead.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1649%2Fjeffhostetler%2Fsparse-index-string-length-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1649/jeffhostetler/sparse-index-string-length-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1649
sparse-index.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sparse-index.c b/sparse-index.c
index 1fdb07a9e69..093708f6220 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -579,8 +579,9 @@ void expand_to_path(struct index_state *istate,
replace++;
temp = *replace;
*replace = '\0';
+ substr_len = replace - path_mutable.buf;
if (index_file_exists(istate, path_mutable.buf,
- path_mutable.len, icase)) {
+ substr_len, icase)) {
/*
* We found a parent directory in the name-hash
* hashtable, because only sparse directory entries
@@ -593,7 +594,6 @@ void expand_to_path(struct index_state *istate,
}
*replace = temp;
- substr_len = replace - path_mutable.buf;
}
cleanup:
base-commit: 43c8a30d150ecede9709c1f2527c8fba92c65f40
--
gitgitgadget
^ permalink raw reply related
* Re: [PATCH] sparse-index: pass string length to index_file_exists()
From: Junio C Hamano @ 2024-02-02 18:24 UTC (permalink / raw)
To: Jeff Hostetler via GitGitGadget; +Cc: git, Jeff Hostetler
In-Reply-To: <pull.1649.git.1706897095273.gitgitgadget@gmail.com>
"Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Jeff Hostetler <jeffhostetler@github.com>
>
> The call to index_file_exists() in the loop in expand_to_path() passes
> the wrong string length. Let's fix that.
>
> The loop in expand_to_path() searches the name-hash for each
> sub-directory prefix in the provided pathname. That is, by searching
> for "dir1/" then "dir1/dir2/" then "dir1/dir2/dir3/" and so on until
> it finds a cache-entry representing a sparse directory.
>
> The code creates "strbuf path_mutable" to contain the working pathname
> and modifies the buffer in-place by temporarily replacing the character
> following each successive "/" with NUL for the duration of the call to
> index_file_exists().
>
> It does not update the strbuf.len during this substitution.
Meaning we memihash() the full pathname munged with '/' -> NUL through
to the end of the original, when we should memihash() the truncated
leading pathname. This is bad, and the ...
>
> Pass the patched length of the prefix path instead.
... fix looks quite straight-forward.
> Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
> ---
The problem description and the fix makes sense, but did you
actually see an end-user visible breakage due to this bug? I am
wondering how you found it, and if it is reasonable to have a test
demonstrate the breakage.
> sparse-index.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sparse-index.c b/sparse-index.c
> index 1fdb07a9e69..093708f6220 100644
> --- a/sparse-index.c
> +++ b/sparse-index.c
> @@ -579,8 +579,9 @@ void expand_to_path(struct index_state *istate,
> replace++;
> temp = *replace;
> *replace = '\0';
> + substr_len = replace - path_mutable.buf;
> if (index_file_exists(istate, path_mutable.buf,
> - path_mutable.len, icase)) {
> + substr_len, icase)) {
There is a break out of this loop when the condition for this "if"
statement holds, but the value of substr_len does not affect what
happens after this index_file_exists() call (correctly) computes its
result. The fix looks good.
Thanks.
> /*
> * We found a parent directory in the name-hash
> * hashtable, because only sparse directory entries
> @@ -593,7 +594,6 @@ void expand_to_path(struct index_state *istate,
> }
>
> *replace = temp;
> - substr_len = replace - path_mutable.buf;
> }
>
> cleanup:
>
> base-commit: 43c8a30d150ecede9709c1f2527c8fba92c65f40
^ permalink raw reply
* Hello question on Git for Windows 2.43.0 - GUID and/or SWID tag for this title
From: Christian Castro @ 2024-02-02 18:57 UTC (permalink / raw)
To: git@vger.kernel.org
Hello Git for Windows,
I have a question on the GUID and/or SWID tag for Git for Windows 2.43.0.
Can you tell me where in the product the GUID and/or SWID tag would be stored in Windows for Git for Windows 2.43.0?
Our scanning software has detected both 2.39.2 and 2.43.0 on the same Windows but this is not so, only 2.43.0 is installed.
This was an upgrade from 2.39.2 though so not sure if that is messed up the results somehow.
I've looked in C:\ProgramData and there are no regid folders not regid.xyz files exist for this product (for the SWID tag).
The Windows registry also does not have a GUID information for this product located under:
HKLM\Software\GitForWindows
HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1
If you've included a GUID and/or SWID tag for your product somewhere in the installation process, can you please tell me where these are stored under Windows so I can fix? I'd appreciate it.
Thank you,
Christian Castro
Sr. Systems Administrator
Office: 301-628-3551
DLHcorp.com
****WARNING**** This email message (including any attachments) are to be treated as confidential/proprietary and may contain copyrighted or other legally protected information. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this information in error, please destroy the information and notify the sender of the error. Thank you.
^ permalink raw reply
* Re: Migrate away from vger to GitHub or (on-premise) GitLab?
From: Junio C Hamano @ 2024-02-02 19:02 UTC (permalink / raw)
To: Phillip Wood; +Cc: Dragan Simic, Hans Meiser, Konstantin Ryabitsev, git
In-Reply-To: <6b34d999-3da2-42ef-bfff-37c8f592347f@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
> While there are some aspects of the documentation that require a
> familiarity with the source I don't think that is true in general. If
> someone has a suggestion to improve part of the documentation that
> they found hard to understand we should be encouraging them to
> contribute a patch. There is no doubt that there are places where our
> documentation could be improved and it is not necessary to be a C
> programmer to contribute improvements to it.
True. It is even possible to:
- have a group of document nitpickers, whose charter is to improve
the documentation by fixing spelling and grammar mistakes and
mark-up mistakes, while making sure that what the original wanted
to say is still what the updated version says.
- have a gatekeeper who makes sure that the output from the above
group is within the scope of its charter, before it is merged to
the main tree.
Then, the choice of the collaboration medium among "document
nitpickers" can be delegated to the group, as long as the quality of
their output is tightly controlled by the gatekeeper to meet the bar
of the main tree. The resulting history should be consistent with
the rest of the system when seen in "git shortlog" output, for
example.
The above is quite similar to how the l10n team works. There is a
l10n coordinator who acts as the gatekeeper for po/ hierarchy, and
l10n folks coordinate among themselves without much supervision and
review of their output on the list. We can treat the documentation
work that does not involve any knowledge of what the documentation
describes the same way.
Thanks.
^ permalink raw reply
* Re: Migrate away from vger to GitHub or (on-premise) GitLab?
From: Junio C Hamano @ 2024-02-02 19:04 UTC (permalink / raw)
To: Theodore Ts'o
Cc: rsbecker, 'Sergey Organov', 'Hans Meiser', git
In-Reply-To: <20240202161643.GD119530@mit.edu>
"Theodore Ts'o" <tytso@mit.edu> writes:
> So from an open source project perspective, which is primarily run by
> volunteers, each open source project has to make a cost-benefit
> tradeoff as far as the *project* is concerned. Individuals do not
> have a fundamental human right to contribute to a project. Hence, the
> open source project doesn't owe an obligation to spend a huge amount
> of effort supporting some kind of forge web site just because some
> potential contributors are clammoring for it. Especially if they are
> saying that they can't be bothered to follow the mailing list traffic
> because it's somehow too much.
Thanks for saying this (even though with my Devil's advocate hat on,
I am not sure how strong our "this is run by volunteers, so do not
demand" card is these days).
> (Of course, I have all of the Linux kernel mailing list flowing into
> my inbox, and have e-mail practices that can handle that load --- so
> it's hard for me to have much sympathy about people complaining that
> the e-mail load for git is too large --- compared to LKML, it's
> *nothing*. :-)
True, too. We may have enough patch traffic but not enough reviews
on them.
^ permalink raw reply
* Re: Hello question on Git for Windows 2.43.0 - GUID and/or SWID tag for this title
From: Kristoffer Haugsbakk @ 2024-02-02 19:16 UTC (permalink / raw)
To: Christian Castro; +Cc: git@vger.kernel.org
In-Reply-To: <LV8PR13MB6560538530A2A7D1C1FD89C19C422@LV8PR13MB6560.namprd13.prod.outlook.com>
Hi
On Fri, Feb 2, 2024, at 19:57, Christian Castro wrote:
> Hello Git for Windows,
>
>
> I have a question on the GUID and/or SWID tag for Git for Windows
> 2.43.0.
This is the Git For Windows repository: https://github.com/git-for-windows/git
This is the mailing list: https://groups.google.com/g/git-for-windows
Just saying that they might be more responsive there.
^ permalink raw reply
* Re: [PATCH] sparse-index: pass string length to index_file_exists()
From: Jeff Hostetler @ 2024-02-02 19:19 UTC (permalink / raw)
To: Junio C Hamano, Jeff Hostetler via GitGitGadget; +Cc: git, Jeff Hostetler
In-Reply-To: <xmqqo7cysp01.fsf@gitster.g>
On 2/2/24 1:24 PM, Junio C Hamano wrote:
> "Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> From: Jeff Hostetler <jeffhostetler@github.com>
>>
>> The call to index_file_exists() in the loop in expand_to_path() passes
>> the wrong string length. Let's fix that.
>>
>> The loop in expand_to_path() searches the name-hash for each
>> sub-directory prefix in the provided pathname. That is, by searching
>> for "dir1/" then "dir1/dir2/" then "dir1/dir2/dir3/" and so on until
>> it finds a cache-entry representing a sparse directory.
>>
>> The code creates "strbuf path_mutable" to contain the working pathname
>> and modifies the buffer in-place by temporarily replacing the character
>> following each successive "/" with NUL for the duration of the call to
>> index_file_exists().
>>
>> It does not update the strbuf.len during this substitution.
>
> Meaning we memihash() the full pathname munged with '/' -> NUL through
> to the end of the original, when we should memihash() the truncated
> leading pathname. This is bad, and the ...
>
>>
>> Pass the patched length of the prefix path instead.
>
> ... fix looks quite straight-forward.
>
>> Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
>> ---
>
> The problem description and the fix makes sense, but did you
> actually see an end-user visible breakage due to this bug? I am
> wondering how you found it, and if it is reasonable to have a test
> demonstrate the breakage.
I'm working on a bug where the fsmonitor client doesn't
invalidate the CE flags when there is a case discrepancy between
the expected and observed case on a case-insensitive file system.
(Fix due shortly.)
And I was single-stepping in the debugger inside of
`index_file_exists()` while tracking that down and noticed that the
length argument was bogus. Something like { name="dir1/", len=10 }
I don't remember if this bug caused visible problems or not. It felt
like it caused a few extra rounds of mutually-recursive calls between
`index_file_exists()` and `expand_to_path()`, but I can't say that
for certain (and I was focused on a different problem at the time).
I do have some test code in `t/helper/lazy-init-name-hash.c` that
I suppose we could extend to beat on it, but I'm not sure it is
worth it in this case.
Jeff
>
>> sparse-index.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/sparse-index.c b/sparse-index.c
>> index 1fdb07a9e69..093708f6220 100644
>> --- a/sparse-index.c
>> +++ b/sparse-index.c
>> @@ -579,8 +579,9 @@ void expand_to_path(struct index_state *istate,
>> replace++;
>> temp = *replace;
>> *replace = '\0';
>> + substr_len = replace - path_mutable.buf;
>> if (index_file_exists(istate, path_mutable.buf,
>> - path_mutable.len, icase)) {
>> + substr_len, icase)) {
>
> There is a break out of this loop when the condition for this "if"
> statement holds, but the value of substr_len does not affect what
> happens after this index_file_exists() call (correctly) computes its
> result. The fix looks good.
>
> Thanks.
>
>> /*
>> * We found a parent directory in the name-hash
>> * hashtable, because only sparse directory entries
>> @@ -593,7 +594,6 @@ void expand_to_path(struct index_state *istate,
>> }
>>
>> *replace = temp;
>> - substr_len = replace - path_mutable.buf;
>> }
>>
>> cleanup:
>>
>> base-commit: 43c8a30d150ecede9709c1f2527c8fba92c65f40
>
^ permalink raw reply
* Re: [PATCH] sparse-index: pass string length to index_file_exists()
From: Junio C Hamano @ 2024-02-02 19:30 UTC (permalink / raw)
To: Jeff Hostetler; +Cc: Jeff Hostetler via GitGitGadget, git, Jeff Hostetler
In-Reply-To: <2bae709a-18da-6ab8-2b76-032ddc045641@jeffhostetler.com>
Jeff Hostetler <git@jeffhostetler.com> writes:
> I don't remember if this bug caused visible problems or not. It felt
> like it caused a few extra rounds of mutually-recursive calls between
> `index_file_exists()` and `expand_to_path()`, but I can't say that
> for certain (and I was focused on a different problem at the time).
>
> I do have some test code in `t/helper/lazy-init-name-hash.c` that
> I suppose we could extend to beat on it, but I'm not sure it is
> worth it in this case.
Yeah, if we had a reproduction already handy that would have been a
different story, but I agree that it is not worth it.
Thanks for a fix. Queued.
^ permalink raw reply
* [PATCH 0/2] GitHub Actions update
From: Junio C Hamano @ 2024-02-02 20:39 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin
The CI jobs are getting "Node.js 16 actions are deprecated."
warnings for jobs that use checkout@v3, github-script@v6, and
download-artifact@v3.
These two patches update these jobs to use checkout@v4 and
github-script@v7, both of which are said to use Node.js 20.
download-artifact@v4 exists but it is labeled as "major changes"
with breaking changes, so I refrained from touching its use to defer
it to folks who are more experienced with its use.
Junio C Hamano (2):
GitHub Actions: update to checkout@v4
GitHub Actions: update to github-script@v7
.github/workflows/check-whitespace.yml | 2 +-
.github/workflows/coverity.yml | 2 +-
.github/workflows/main.yml | 20 ++++++++++----------
3 files changed, 12 insertions(+), 12 deletions(-)
--
2.43.0-522-g2a540e432f
^ permalink raw reply
* [PATCH 1/2] GitHub Actions: update to checkout@v4
From: Junio C Hamano @ 2024-02-02 20:39 UTC (permalink / raw)
To: git; +Cc: Oscar Dominguez
In-Reply-To: <20240202203935.1240458-1-gitster@pobox.com>
We seem to be getting "Node.js 16 actions are deprecated." warnings
for jobs that use checkout@v3. Except for the i686 containers job
that is kept at checkout@v1 [*], update to checkout@v4, which is
said to use Node.js 20.
[*] 6cf4d908 (ci(main): upgrade actions/checkout to v3, 2022-12-05)
refers to https://github.com/actions/runner/issues/2115 and
explains why container jobs are kept at checkout@v1. We may
want to check the current status of the issue and move it to the
same version as other jobs, but that is outside the scope of
this step.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
.github/workflows/check-whitespace.yml | 2 +-
.github/workflows/coverity.yml | 2 +-
.github/workflows/main.yml | 18 +++++++++---------
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
index a58e2dc8ad..a241a63428 100644
--- a/.github/workflows/check-whitespace.yml
+++ b/.github/workflows/check-whitespace.yml
@@ -19,7 +19,7 @@ jobs:
check-whitespace:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index e5532d381b..a81a7566d1 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -38,7 +38,7 @@ jobs:
COVERITY_LANGUAGE: cxx
COVERITY_PLATFORM: overridden-below
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: install minimal Git for Windows SDK
if: contains(matrix.os, 'windows')
uses: git-for-windows/setup-git-for-windows-sdk@v1
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 4d97da57ec..90973f9693 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -112,7 +112,7 @@ jobs:
group: windows-build-${{ github.ref }}
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: build
shell: bash
@@ -173,10 +173,10 @@ jobs:
group: vs-build-${{ github.ref }}
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: initialize vcpkg
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
repository: 'microsoft/vcpkg'
path: 'compat/vcbuild/vcpkg'
@@ -297,7 +297,7 @@ jobs:
runs_on_pool: ${{matrix.vector.pool}}
runs-on: ${{matrix.vector.pool}}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- run: ci/install-dependencies.sh
- run: ci/run-build-and-tests.sh
- name: print test failures
@@ -317,7 +317,7 @@ jobs:
CC: clang
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- run: ci/install-dependencies.sh
- run: ci/run-build-and-minimal-fuzzers.sh
dockerized:
@@ -342,7 +342,7 @@ jobs:
runs-on: ubuntu-latest
container: ${{matrix.vector.image}}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
if: matrix.vector.jobname != 'linux32'
- uses: actions/checkout@v1
if: matrix.vector.jobname == 'linux32'
@@ -373,7 +373,7 @@ jobs:
group: static-analysis-${{ github.ref }}
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- run: ci/install-dependencies.sh
- run: ci/run-static-analysis.sh
- run: ci/check-directional-formatting.bash
@@ -396,7 +396,7 @@ jobs:
artifact: sparse-20.04
- name: Install the current `sparse` package
run: sudo dpkg -i sparse-20.04/sparse_*.deb
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Install other dependencies
run: ci/install-dependencies.sh
- run: make sparse
@@ -411,6 +411,6 @@ jobs:
jobname: Documentation
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- run: ci/install-dependencies.sh
- run: ci/test-documentation.sh
--
2.43.0-522-g2a540e432f
^ permalink raw reply related
* [PATCH 2/2] GitHub Actions: update to github-script@v7
From: Junio C Hamano @ 2024-02-02 20:39 UTC (permalink / raw)
To: git
In-Reply-To: <20240202203935.1240458-1-gitster@pobox.com>
We seem to be getting "Node.js 16 actions are deprecated." warnings
for jobs that use github-script@v6. Update to github-script@v7,
which is said to use Node.js 20.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 90973f9693..bb857bdaf0 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -63,7 +63,7 @@ jobs:
echo "skip_concurrent=$skip_concurrent" >>$GITHUB_OUTPUT
- name: skip if the commit or tree was already tested
id: skip-if-redundant
- uses: actions/github-script@v6
+ uses: actions/github-script@v7
if: steps.check-ref.outputs.enabled == 'yes'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
--
2.43.0-522-g2a540e432f
^ permalink raw reply related
* Re: Migrate away from vger to GitHub or (on-premise) GitLab?
From: Theodore Ts'o @ 2024-02-02 21:28 UTC (permalink / raw)
To: Junio C Hamano
Cc: rsbecker, 'Sergey Organov', 'Hans Meiser', git
In-Reply-To: <xmqq5xz6sn5i.fsf@gitster.g>
On Fri, Feb 02, 2024 at 11:04:41AM -0800, Junio C Hamano wrote:
> "Theodore Ts'o" <tytso@mit.edu> writes:
>
> > So from an open source project perspective, which is primarily run by
> > volunteers, each open source project has to make a cost-benefit
> > tradeoff as far as the *project* is concerned. Individuals do not
> > have a fundamental human right to contribute to a project. Hence, the
> > open source project doesn't owe an obligation to spend a huge amount
> > of effort supporting some kind of forge web site just because some
> > potential contributors are clammoring for it. Especially if they are
> > saying that they can't be bothered to follow the mailing list traffic
> > because it's somehow too much.
>
> Thanks for saying this (even though with my Devil's advocate hat on,
> I am not sure how strong our "this is run by volunteers, so do not
> demand" card is these days).
Even though a lot of open source developers these days work for
companies, it's rare that engineers get to work on whatever they want.
More often than not, open source developeres are asked to primarily
work on features that have a tie to their employer's business goals.
Different companies might call use different corporate-speak; for
example, perhaps on e company might use "year of efficiency" or
"sharpening our focus", but the reality is that companies are asking
engineers to spend more time of features that those companies want.
What this tends to mean is that engineers have less time to do
community work --- such as code reviews --- or they have to do that
work "on their own time", e.g., late at night or on weekends. Those
of us who work as project leads, or subsystem leads for open source
projects, are trying to push back against this dynamic, because there
is always maintenance work that need to be done to keep the project
healthy, including bug scrubbing, code review, improving tests, etc.
As a Linux kernel subsystem maintainer, I am super grateful for those
who do code reviews and those who work test regressions, because in
general, that which doesn't get done by other developers ends up
getting done by the maintainers and project leads if it's going to
happen at all.
When it comes to requests like "you should migrate the project to use
some forge web site, because we can't be bothered to use e-mail, and
web interfaces are the new hotness", the entitlement that comes from
that request (which is in the subject line of this thread), can
sometimes be a bit frustrating.
Going back to the original topic of this thread, my personal
experience has been that the *vest* percentage of pull requests that I
get from github tend to be drive-by pull requests that are very low
quality, especially compared to those that I get via the mailing list.
So making a change to use a forge which might result in a larger
number of lower quality code contributions, when code review bandwidth
might be more of a bottlenck, might not be as appealing as some might
think.
- Ted
^ permalink raw reply
* Re: [PATCH v2 0/3] some unit-test Makefile polishing
From: Johannes Schindelin @ 2024-02-02 23:52 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Phillip Wood, SZEDER Gábor, Adam Dinwoodie,
Patrick Steinhardt
In-Reply-To: <xmqqh6irwtkd.fsf@gitster.g>
Hi Junio,
On Thu, 1 Feb 2024, Junio C Hamano wrote:
> https://github.com/git/git/actions/runs/7748054008 is a run of 'next'
> that is broken.
>
> https://github.com/git/git/actions/runs/7748547579 is a run of 'seen~1'
> with this topic reverted (the ps/reftable-backend topic is excluded),
> which seems to pass.
>
> Does it ring a bell, anybody?
Yes, it does ring a clear bell over here.
https://github.com/git/git/actions/runs/7748054008/job/21130098985#step:5:81
points to the culprit:
fatal: not a git repository (or any of the parent directories): .git
make: *** [../config.mak.uname:753: vcxproj] Error 128
The line 753 of that file (as can be seen at
https://github.com/git/git/blob/38aa6559b0c513d755d6d5ccf32414ed63754726/config.mak.uname#L753)
is the first statement of the `vcxproj` target, executing `update-refresh`:
vcxproj:
# Require clean work tree
git update-index -q --refresh && \
git diff-files --quiet && \
git diff-index --cached --quiet HEAD --
[...]
This means that `vcxproj` is executed. And the explanation is in
https://github.com/git/git/actions/runs/7748054008/job/21130098985#step:5:78,
which runs `make --quiet -C t 'T=<long-list-of-files>'`, crucially
_without_ specifying any Makefile rule, and the `vcxproj` rule happens to
be the first one that is defined on Windows, so it's used by default.
One workaround would be to remove the `vcxproj` rule (which by now has
been safely superseded by the CMake support we have in
`contrib/buildsystems/`).
But the safer way would be to insert these two lines at the beginning of
`t/Makefile` (cargo-culted from the top-level `Makefile`):
# The default target of this Makefile is...
all::
Ciao,
Johannes
^ permalink raw reply
* Re: [PATCH v3 04/10] sequencer: use the trailer iterator
From: Linus Arver @ 2024-02-03 0:39 UTC (permalink / raw)
To: Junio C Hamano, Linus Arver via GitGitGadget
Cc: git, Christian Couder, Emily Shaffer, Josh Steadmon,
Randall S. Becker
In-Reply-To: <owlyle840zfo.fsf@fine.c.googlers.com>
Linus Arver <linusa@google.com> writes:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> "Linus Arver via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>
>>> From: Linus Arver <linusa@google.com>
>>>
>>> Also, teach the iterator about non-trailer lines, by adding a new field
>>> called "raw" to hold both trailer and non-trailer lines. This is
>>> necessary because a "trailer block" is a list of trailer lines of at
>>> least 25% trailers (see 146245063e (trailer: allow non-trailers in
>>> trailer block, 2016-10-21)), such that it may hold non-trailer lines.
>>
>> That sounds like a task larger than something we would want in a
>> patch that focuses on another task (e.g. update sequencer not to
>> call trailer_info_get()) while at it. It seems from a casual glance
>> that the change to shortlog.c is to accomodate this change in the
>> semantics of what the iterator could return? It smells that this
>> patch does two more or less unrelated things at the same time?
>
> I think you're correct. Hopefully breaking this up will make things
> easier to review.
And now that I've broken it up locally, I can say that the change I made
to shortlog was unnecessary (shortlog already has a check to see if the
trailer key is empty) which makes the "is_trailer" check I added to it
here redundant (because non-trailer lines, which the new iterator can
iterate over, have empty keys).
Will remove the shortlog change in v4. Thanks.
^ permalink raw reply
* What's cooking in git.git (Feb 2024, #01; Fri, 2)
From: Junio C Hamano @ 2024-02-03 0:43 UTC (permalink / raw)
To: git
Here are the topics that have been cooking in my tree. Commits
prefixed with '+' are in 'next' (being in 'next' is a sign that a
topic is stable enough to be used and are candidate to be in a
future release). Commits prefixed with '-' are only in 'seen', and
aren't considered "accepted" at all and may be annotated with an URL
to a message that raises issues but they are no means exhaustive. A
topic without enough support may be discarded after a long period of
no activity (of course they can be resubmit when new interests
arise).
Copies of the source code to Git live in many repositories, and the
following is a list of the ones I push into or their mirrors. Some
repositories have only a subset of branches.
With maint, master, next, seen, todo:
git://git.kernel.org/pub/scm/git/git.git/
git://repo.or.cz/alt-git.git/
https://kernel.googlesource.com/pub/scm/git/git/
https://github.com/git/git/
https://gitlab.com/git-vcs/git/
With all the integration branches and topics broken out:
https://github.com/gitster/git/
Even though the preformatted documentation in HTML and man format
are not sources, they are published in these repositories for
convenience (replace "htmldocs" with "manpages" for the manual
pages):
git://git.kernel.org/pub/scm/git/git-htmldocs.git/
https://github.com/gitster/git-htmldocs.git/
Release tarballs are available at:
https://www.kernel.org/pub/software/scm/git/
--------------------------------------------------
[Graduated to 'master']
* ad/custom-merge-placeholder-for-symbolic-pathnames (2024-01-24) 1 commit
(merged to 'next' on 2024-01-24 at d9cf4e227d)
+ merge-ll: expose revision names to custom drivers
The labels on conflict markers for the common ancestor, our version,
and the other version are available to custom 3-way merge driver
via %S, %X, and %Y placeholders.
source: <pull.1648.v4.git.git.1706126951879.gitgitgadget@gmail.com>
* jc/coc-whitespace-fix (2024-01-23) 1 commit
(merged to 'next' on 2024-01-26 at 6fb290ad59)
+ CoC: whitespace fix
Docfix.
source: <xmqqmssvnb8d.fsf_-_@gitster.g>
* jc/ls-files-doc-update (2024-01-25) 1 commit
(merged to 'next' on 2024-01-26 at a71aeec3d3)
+ ls-files: avoid the verb "deprecate" for individual options
The documentation for the --exclude-per-directory option marked it
as deprecated, which confused readers into thinking there may be a
plan to remove it in the future, which was not our intention.
source: <xmqqjznybfp4.fsf@gitster.g>
* jc/reffiles-tests (2024-01-22) 12 commits
(merged to 'next' on 2024-01-24 at 0d1aaa6807)
+ t5312: move reffiles specific tests to t0601
+ t4202: move reffiles specific tests to t0600
+ t3903: make drop stash test ref backend agnostic
+ t1503: move reffiles specific tests to t0600
+ t1415: move reffiles specific tests to t0601
+ t1410: move reffiles specific tests to t0600
+ t1406: move reffiles specific tests to t0600
+ t1405: move reffiles specific tests to t0601
+ t1404: move reffiles specific tests to t0600
+ t1414: convert test to use Git commands instead of writing refs manually
+ remove REFFILES prerequisite for some tests in t1405 and t2017
+ t3210: move to t0601
Tests on ref API are moved around to prepare for reftable.
cf. <Za5TW-q4cKS8pNNc@tanuki>
source: <pull.1647.v2.git.git.1705695540.gitgitgadget@gmail.com>
* jk/fetch-auto-tag-following-fix (2024-01-24) 1 commit
(merged to 'next' on 2024-01-26 at d058f1511b)
+ transport-helper: re-examine object dir after fetching
Fetching via protocol v0 over Smart HTTP transport sometimes failed
to correctly auto-follow tags.
source: <20240124010056.GA2603087@coredump.intra.peff.net>
* jx/remote-archive-over-smart-http (2024-01-22) 6 commits
(merged to 'next' on 2024-01-23 at 5fa4633015)
+ transport-helper: call do_take_over() in process_connect
+ transport-helper: call do_take_over() in connect_helper
+ http-backend: new rpc-service for git-upload-archive
+ transport-helper: protocol v2 supports upload-archive
+ remote-curl: supports git-upload-archive service
+ transport-helper: no connection restriction in connect_helper
"git archive --remote=<remote>" learned to talk over the smart
http (aka stateless) transport.
source: <cover.1705841443.git.zhiyou.jx@alibaba-inc.com>
* kl/allow-working-in-dot-git-in-non-bare-repository (2024-01-20) 1 commit
(merged to 'next' on 2024-01-24 at e77b796e11)
+ setup: allow cwd=.git w/ bareRepository=explicit
The "disable repository discovery of a bare repository" check,
triggered by setting safe.bareRepository configuration variable to
'explicit', has been loosened to exclude the ".git/" directory inside
a non-bare repository from the check. So you can do "cd .git &&
git cmd" to run a Git command that works on a bare repository without
explicitly specifying $GIT_DIR now.
source: <pull.1645.git.1705709303098.gitgitgadget@gmail.com>
* pb/ci-github-skip-logs-for-broken-tests (2024-01-22) 1 commit
(merged to 'next' on 2024-01-23 at f5e3ab2092)
+ ci(github): also skip logs of broken test cases
GitHub CI update.
cf. <dbe25fff-e1d4-41f2-8f8f-c538e8c2a77e@github.com>
source: <pull.1649.git.git.1705808313306.gitgitgadget@gmail.com>
* pb/complete-log-more (2024-01-22) 4 commits
(merged to 'next' on 2024-01-24 at 081d2a92fa)
+ completion: complete missing 'git log' options
+ completion: complete --encoding
+ completion: complete --patch-with-raw
+ completion: complete missing rev-list options
The completion script (in contrib/) learned more options that can
be used with "git log".
source: <pull.1650.git.git.1705810071.gitgitgadget@gmail.com>
* rj/advice-disable-how-to-disable (2024-01-16) 2 commits
(merged to 'next' on 2024-01-23 at f456f4937d)
+ advice: allow disabling the automatic hint in advise_if_enabled()
+ Merge branch 'rj/advice-delete-branch-not-fully-merged' into rj/advice-disable-how-to-disable
All conditional "advice" messages show how to turn them off, which
becomes repetitive. Setting advice.* configuration explicitly on
now omits the instruction part.
source: <6a842ef8-b390-4739-9eef-e867d55ed5ea@gmail.com>
* rs/parse-options-with-keep-unknown-abbrev-fix (2024-01-22) 2 commits
(merged to 'next' on 2024-01-23 at a216b482cd)
+ parse-options: simplify positivation handling
+ parse-options: fully disable option abbreviation with PARSE_OPT_KEEP_UNKNOWN
"git diff --no-rename A B" did not disable rename detection but did
not trigger an error from the command line parser.
source: <579fd5bc-3bfd-427f-b22d-dab5e7e56eb2@web.de>
source: <fb3c679a-5f00-4934-b028-6b2d081cd5b2@web.de>
* sd/negotiate-trace-fix (2024-01-03) 1 commit
(merged to 'next' on 2024-01-24 at 6305853ab2)
+ push: region_leave trace for negotiate_using_fetch
Tracing fix.
source: <20240103224054.1940209-1-delmerico@google.com>
* zf/subtree-split-fix (2024-01-25) 1 commit
(merged to 'next' on 2024-01-26 at a09e02f208)
+ subtree: fix split processing with multiple subtrees present
"git subtree" (in contrib/) update.
source: <pull.1587.v6.git.1701442494319.gitgitgadget@gmail.com>
--------------------------------------------------
[New Topics]
* jc/t0091-with-unknown-git (2024-01-30) 1 commit
(merged to 'next' on 2024-01-31 at 3dfcad1b18)
+ t0091: allow test in a repository without tags
The test did not work when Git was built from a repository without
tags.
Will merge to 'master'.
source: <xmqqv87aabk3.fsf@gitster.g>
* ps/reftable-backend (2024-02-02) 3 commits
- ci: add jobs to test with the reftable backend
- refs: introduce reftable backend
- Merge branch 'ps/tests-with-ref-files-backend' into ps/reftable-backend
(this branch uses ps/tests-with-ref-files-backend.)
Integrate the reftable code into the refs framework as a backend.
Needs review.
source: <cover.1706862705.git.ps@pks.im>
* js/win32-retry-pipe-write-on-enospc (2024-01-30) 1 commit
(merged to 'next' on 2024-01-31 at 60ad589fd0)
+ win32: special-case `ENOSPC` when writing to a pipe
Update to the code that writes to pipes on Windows.
Will merge to 'master'.
source: <pull.1648.git.1706650619950.gitgitgadget@gmail.com>
* jc/make-libpath-template (2024-01-31) 2 commits
(merged to 'next' on 2024-01-31 at 559d5138bc)
+ Makefile: simplify output of the libpath_template
+ Makefile: reduce repetitive library paths
The Makefile often had to say "-L$(path) -R$(path)" that repeats
the path to the same library directory for link time and runtime.
A Makefile template is used to reduce such repetition.
Will merge to 'master'.
source: <20240131174220.4160560-1-gitster@pobox.com>
* cb/use-freebsd-13-2-at-cirrus-ci (2024-01-31) 1 commit
(merged to 'next' on 2024-01-31 at f89dc8a289)
+ ci: update FreeBSD cirrus job
Cirrus CI jobs started breaking because we specified version of
FreeBSD that is no longer available, which has been corrected.
Will merge to 'master'.
source: <20240131191325.33228-1-carenas@gmail.com>
* cc/rev-list-allow-missing-tips (2024-02-01) 3 commits
- rev-list: add --allow-missing-tips to be used with --missing=...
- t6022: fix 'even though' typo in comment
- revision: clarify a 'return NULL' in get_reference()
"git rev-list --missing=print" have learned to optionally take
"--allow-missing-tips", which allows the objects at the starting
points to be missing.
Needs review.
source: <20240201115809.1177064-1-christian.couder@gmail.com>
* ps/reftable-iteration-perf (2024-02-01) 7 commits
- reftable/reader: add comments to `table_iter_next()`
- reftable/record: don't try to reallocate ref record name
- reftable/block: swap buffers instead of copying
- reftable/pq: allocation-less comparison of entry keys
- reftable/merged: skip comparison for records of the same subiter
- reftable/merged: allocation-less dropping of shadowed records
- reftable/record: introduce function to compare records by key
The code to iterate over refs with the reftable backend has seen
some optimization.
Needs review.
source: <cover.1706782841.git.ps@pks.im>
* ps/reftable-styles (2024-02-01) 9 commits
- reftable/record: improve semantics when initializing records
- reftable/merged: refactor initialization of iterators
- reftable/merged: refactor seeking of records
- reftable/stack: use `size_t` to track stack length
- reftable/stack: use `size_t` to track stack slices during compaction
- reftable/stack: index segments with `size_t`
- reftable/stack: fix parameter validation when compacting range
- reftable: introduce macros to allocate arrays
- reftable: introduce macros to grow arrays
Code clean-up in various reftable code paths.
Needs review.
source: <cover.1706772591.git.ps@pks.im>
* pb/imap-send-wo-curl-build-fix (2024-02-01) 1 commit
- imap-send: add missing "strbuf.h" include under NO_CURL
Build fix.
Will merge to 'next'.
source: <pull.1664.git.git.1706833113569.gitgitgadget@gmail.com>
* jc/github-actions-update (2024-02-02) 1 commit
- Merge branch 'jc/maint-github-actions-update' into jc/github-actions-update
(this branch uses jc/maint-github-actions-update.)
An evil merge of the other topic to a more modern codebase.
Will merge to 'next'?
* jc/maint-github-actions-update (2024-02-02) 2 commits
- GitHub Actions: update to github-script@v7
- GitHub Actions: update to checkout@v4
(this branch is used by jc/github-actions-update.)
Squelch node.js 16 deprecation warnings from GitHub Actions CI
by updating actions/github-script and actions/checkout that use
node.js 20.
Needs review.
source: <20240202203935.1240458-1-gitster@pobox.com>
* jh/sparse-index-expand-to-path-fix (2024-02-02) 1 commit
- sparse-index: pass string length to index_file_exists()
A caller called index_file_exists() that takes a string expressed
as <ptr, length> with a wrong length, which has been corrected.
Will merge to 'next'.
source: <pull.1649.git.1706897095273.gitgitgadget@gmail.com>
--------------------------------------------------
[Cooking]
* jc/comment-style-fixes (2024-01-29) 3 commits
(merged to 'next' on 2024-01-30 at a58d48a9ce)
+ reftable/pq_test: comment style fix
+ merge-ort.c: comment style fix
+ builtin/worktree: comment style fixes
Rewrite //-comments to /* comments */ in files whose comments
prevalently use the latter.
Will merge to 'master'.
source: <20240129202839.2234084-1-gitster@pobox.com>
* jk/diff-external-with-no-index (2024-01-29) 1 commit
(merged to 'next' on 2024-01-30 at 30c3e9f91d)
+ diff: handle NULL meta-info when spawning external diff
"git diff --no-index file1 file2" segfaulted while invoking the
external diff driver, which has been corrected.
Reverted out of 'next' for now, seems to break "win test (n)" jobs.
cf. <xmqqh6irwtkd.fsf@gitster.g>
source: <20240129015708.GA1762343@coredump.intra.peff.net>
* jk/unit-tests-buildfix (2024-01-31) 3 commits
(merged to 'next' on 2024-01-31 at 00df31c4c8)
+ t/Makefile: get UNIT_TESTS list from C sources
+ Makefile: remove UNIT_TEST_BIN directory with "make clean"
+ Makefile: use mkdir_p_parent_template for UNIT_TEST_BIN
Build dependency around unit tests has been fixed.
Will merge to 'master'.
source: <20240130053714.GA165967@coredump.intra.peff.net>
* js/merge-tree-3-trees (2024-01-29) 1 commit
(merged to 'next' on 2024-01-30 at 0c77b04e59)
+ merge-tree: accept 3 trees as arguments
"git merge-tree" has learned that the three trees involved in the
3-way merge only need to be trees, not necessarily commits.
Will merge to 'master'.
source: <pull.1647.v2.git.1706474063109.gitgitgadget@gmail.com>
* jt/p4-spell-re-with-raw-string (2024-01-29) 1 commit
(merged to 'next' on 2024-01-30 at 42b03b58eb)
+ git-p4: use raw string literals for regular expressions
"git p4" update to squelch warnings from Python.
Will merge to 'master'.
source: <pull.1639.v2.git.1706312496608.gitgitgadget@gmail.com>
* kh/maintenance-use-xdg-when-it-should (2024-01-29) 1 commit
(merged to 'next' on 2024-01-30 at c449ac74bf)
+ config: add back code comment
Comment fix.
Will merge to 'master'.
source: <48d66e94ece3b763acbe933561d82157c02a5f58.1706466321.git.code@khaugsbakk.name>
* mh/credential-oauth-refresh-token-with-wincred (2024-01-29) 1 commit
- credential/wincred: store oauth_refresh_token
Teach wincred credential backend to support oauth refresh token the
same way as credential-cache and credential-libsecret backends.
Will merge to 'next'.
source: <pull.1534.v3.git.1706477103039.gitgitgadget@gmail.com>
* pb/complete-config (2024-01-29) 5 commits
- completion: add an use _ _git_compute_second_level_config_vars_for_section
- builtin/help: add --config-all-for-completion
- completion: add and use _ _git_compute_first_level_config_vars_for_section
- completion: complete 'submodule.*' config variables
- completion: add space after config variable names also in Bash 3
The command line completion script (in contrib/) learned to
complete configuration variable names better.
Needs review.
source: <pull.1660.v2.git.git.1706534881.gitgitgadget@gmail.com>
* rj/complete-reflog (2024-01-26) 4 commits
- completion: reflog show <log-options>
- completion: reflog with implicit "show"
- completion: introduce __git_find_subcommand
- completion: introduce __gitcomp_subcommand
The command line completion script (in contrib/) learned to
complete "git reflog" better.
Needs review.
source: <98daf977-dbad-4d3b-a293-6a769895088f@gmail.com>
* rj/test-with-leak-check (2024-01-29) 4 commits
(merged to 'next' on 2024-01-31 at 76e4596666)
+ t0080: mark as leak-free
+ test-lib: check for TEST_PASSES_SANITIZE_LEAK
+ t6113: mark as leak-free
+ t5332: mark as leak-free
More tests that are supposed to pass leak sanitizer are marked as such.
Will merge to 'master'.
source: <45eb0748-6415-4e52-a54f-8d4e5ad57dde@gmail.com>
* tb/pack-bitmap-drop-unused-struct-member (2024-01-29) 1 commit
(merged to 'next' on 2024-01-30 at f3749b15fc)
+ pack-bitmap: drop unused `reuse_objects`
Code clean-up.
Will merge to 'master'.
source: <0bbaf9a3591765161872fb71383263edb0c7ef83.1706328008.git.me@ttaylorr.com>
* ps/reftable-compacted-tables-permission-fix (2024-01-26) 1 commit
(merged to 'next' on 2024-01-29 at dbb06e1571)
+ reftable/stack: adjust permissions of compacted tables
Reftable bugfix.
Will merge to 'master'.
source: <a211818108053754aca002726d0206623a347952.1706263589.git.ps@pks.im>
* jc/index-pack-fsck-levels (2024-02-01) 2 commits
(merged to 'next' on 2024-02-02 at 0e4ef26aa1)
+ index-pack: --fsck-objects to take an optional argument for fsck msgs
+ index-pack: test and document --strict=<msg-id>=<severity>...
The "--fsck-objects" option of "git index-pack" now can take the
optional parameter to tweak severity of different fsck errors.
Will merge to 'master'.
source: <pull.1658.v4.git.git.1706751483.gitgitgadget@gmail.com>
* ps/reftable-multi-level-indices-fix (2024-02-01) 6 commits
- reftable: document reading and writing indices
- reftable/writer: fix writing multi-level indices
- reftable/writer: simplify writing index records
- reftable/writer: use correct type to iterate through index entries
- reftable/reader: be more careful about errors in indexed seeks
- Merge branch 'jc/reftable-core-fsync' into ps/reftable-multi-level-indices-fix
(this branch uses jc/reftable-core-fsync.)
Write multi-level indices for reftable has been corrected.
Needs review.
source: <cover.1706773842.git.ps@pks.im>
* jc/reftable-core-fsync (2024-01-30) 2 commits
(merged to 'next' on 2024-01-30 at c3a79b6172)
+ reftable/stack: fsync "tables.list" during compaction
(merged to 'next' on 2024-01-24 at cea12beddb)
+ reftable: honor core.fsync
(this branch is used by ps/reftable-multi-level-indices-fix.)
The write codepath for the reftable data learned to honor
core.fsync configuration.
Will merge to 'master'.
source: <7bdafc9bd7f53f38a24d69a563615b6ad484e1ba.1706592127.git.ps@pks.im>
* cp/unit-test-prio-queue (2024-01-22) 1 commit
(merged to 'next' on 2024-02-01 at 38aa6559b0)
+ tests: move t0009-prio-queue.sh to the new unit testing framework
Migrate priority queue test to unit testing framework.
Will merge to 'master'.
source: <pull.1642.v4.git.1705865326185.gitgitgadget@gmail.com>
* ml/log-merge-with-cherry-pick-and-other-pseudo-heads (2024-01-17) 2 commits
- revision: implement `git log --merge` also for rebase/cherry_pick/revert
- revision: ensure MERGE_HEAD is a ref in prepare_show_merge
"git log --merge" learned to pay attention to CHERRY_PICK_HEAD and
other kinds of *_HEAD pseudorefs.
Comments?
source: <xmqqzfxa9usx.fsf@gitster.g>
* kn/for-all-refs (2024-01-29) 4 commits
(merged to 'next' on 2024-01-30 at e7a9234a8b)
+ for-each-ref: avoid filtering on empty pattern
+ refs: introduce `refs_for_each_all_refs()`
+ refs: extract out `loose_fill_ref_dir_regular_file()`
+ refs: introduce `is_pseudoref()` and `is_headref()`
"git for-each-ref" filters its output with prefixes given from the
command line, but it did not honor an empty string to mean "pass
everything", which has been corrected.
Will merge to 'master'.
source: <20240129113527.607022-1-karthik.188@gmail.com>
* bk/complete-bisect (2024-01-29) 9 commits
- SQUASH???
- completion: add tests for git-bisect
- completion: bisect: recognize but do not complete view subcommand
- completion: bisect: complete log opts for visualize subcommand
- completion: log: use __git_complete_log_opts
- completion: new function __git_complete_log_opts
- completion: bisect: complete missing --first-parent and --no-checkout options
- completion: bisect: complete custom terms and related options
- completion: bisect: complete bad, new, old, and help subcommands
Command line completion support (in contrib/) has been
updated for "git bisect".
Comments?
cf. <ZaofJhHsFjRxx7a3@tanuki>
source: <20240128223447.342493-1-britton.kerin@gmail.com>
* bk/complete-dirname-for-am-and-format-patch (2024-01-12) 1 commit
- completion: dir-type optargs for am, format-patch
Command line completion support (in contrib/) has been
updated for a few commands to complete directory names where a
directory name is expected.
Needs review.
source: <d37781c3-6af2-409b-95a8-660a9b92d20b@smtp-relay.sendinblue.com>
* bk/complete-send-email (2024-01-12) 1 commit
- completion: don't complete revs when --no-format-patch
Command line completion support (in contrib/) has been taught to
avoid offering revision names as candidates to "git send-email" when
the command is used to send pre-generated files.
Needs review.
source: <a718b5ee-afb0-44bd-a299-3208fac43506@smtp-relay.sendinblue.com>
* la/trailer-api (2024-01-30) 10 commits
- trailer: introduce "template" term for readability
- trailer: delete obsolete argument handling code from API
- trailer: move arg handling to interpret-trailers.c
- trailer: prepare to move parse_trailers_from_command_line_args() to builtin
- trailer: spread usage of "trailer_block" language
- trailer: make trailer_info struct private
- sequencer: use the trailer iterator
- trailer: unify trailer formatting machinery
- trailer: move interpret_trailers() to interpret-trailers.c
- trailer: prepare to expose functions as part of API
Code clean-up.
Needs review.
cf. <xmqqa5ol409k.fsf@gitster.g>
source: <pull.1632.v3.git.1706664144.gitgitgadget@gmail.com>
* ps/tests-with-ref-files-backend (2024-01-29) 6 commits
(merged to 'next' on 2024-01-30 at 376b9c9c1b)
+ t: mark tests regarding git-pack-refs(1) to be backend specific
+ t5526: break test submodule differently
+ t1419: mark test suite as files-backend specific
+ t1302: make tests more robust with new extensions
+ t1301: mark test for `core.sharedRepository` as reffiles specific
+ t1300: make tests more robust with non-default ref backends
(this branch is used by ps/reftable-backend.)
Prepare existing tests on refs to work better with non-default
backends.
Will merge to 'master'.
source: <cover.1706525813.git.ps@pks.im>
* cp/apply-core-filemode (2023-12-26) 3 commits
- apply: code simplification
- apply: correctly reverse patch's pre- and post-image mode bits
- apply: ignore working tree filemode when !core.filemode
"git apply" on a filesystem without filemode support have learned
to take a hint from what is in the index for the path, even when
not working with the "--index" or "--cached" option, when checking
the executable bit match what is required by the preimage in the
patch.
Needs review.
source: <20231226233218.472054-1-gitster@pobox.com>
* ja/doc-placeholders-fix (2023-12-26) 2 commits
- doc: enforce placeholders in documentation
- doc: enforce dashes in placeholders
Docfix.
Will merge to 'next'.
source: <pull.1626.git.1703539287.gitgitgadget@gmail.com>
* jc/bisect-doc (2023-12-09) 1 commit
- bisect: document "terms" subcommand more fully
Doc update.
Needs review.
source: <xmqqzfyjmk02.fsf@gitster.g>
* tb/pair-chunk-expect (2023-11-10) 8 commits
- midx: read `OOFF` chunk with `pair_chunk_expect()`
- midx: read `OIDL` chunk with `pair_chunk_expect()`
- commit-graph: read `BIDX` chunk with `pair_chunk_expect()`
- commit-graph: read `GDAT` chunk with `pair_chunk_expect()`
- commit-graph: read `CDAT` chunk with `pair_chunk_expect()`
- commit-graph: read `OIDL` chunk with `pair_chunk_expect()`
- chunk-format: introduce `pair_chunk_expect()` helper
- Merge branch 'jk/chunk-bounds-more' into HEAD
Further code clean-up.
Needs review.
source: <cover.1699569246.git.me@ttaylorr.com>
* tb/path-filter-fix (2024-01-31) 16 commits
- bloom: introduce `deinit_bloom_filters()`
- commit-graph: reuse existing Bloom filters where possible
- object.h: fix mis-aligned flag bits table
- commit-graph: new Bloom filter version that fixes murmur3
- commit-graph: unconditionally load Bloom filters
- bloom: prepare to discard incompatible Bloom filters
- bloom: annotate filters with hash version
- repo-settings: introduce commitgraph.changedPathsVersion
- t4216: test changed path filters with high bit paths
- t/helper/test-read-graph: implement `bloom-filters` mode
- bloom.h: make `load_bloom_filter_from_graph()` public
- t/helper/test-read-graph.c: extract `dump_graph_info()`
- gitformat-commit-graph: describe version 2 of BDAT
- commit-graph: ensure Bloom filters are read with consistent settings
- revision.c: consult Bloom filters for root commits
- t/t4216-log-bloom.sh: harden `test_bloom_filters_not_used()`
The Bloom filter used for path limited history traversal was broken
on systems whose "char" is unsigned; update the implementation and
bump the format version to 2.
source: <cover.1706741516.git.me@ttaylorr.com>
* ak/color-decorate-symbols (2023-10-23) 7 commits
- log: add color.decorate.pseudoref config variable
- refs: exempt pseudorefs from pattern prefixing
- refs: add pseudorefs array and iteration functions
- log: add color.decorate.ref config variable
- log: add color.decorate.symbol config variable
- log: use designated inits for decoration_colors
- config: restructure color.decorate documentation
A new config for coloring.
Needs review.
source: <20231023221143.72489-1-andy.koppe@gmail.com>
* eb/hash-transition (2023-10-02) 30 commits
- t1016-compatObjectFormat: add tests to verify the conversion between objects
- t1006: test oid compatibility with cat-file
- t1006: rename sha1 to oid
- test-lib: compute the compatibility hash so tests may use it
- builtin/ls-tree: let the oid determine the output algorithm
- object-file: handle compat objects in check_object_signature
- tree-walk: init_tree_desc take an oid to get the hash algorithm
- builtin/cat-file: let the oid determine the output algorithm
- rev-parse: add an --output-object-format parameter
- repository: implement extensions.compatObjectFormat
- object-file: update object_info_extended to reencode objects
- object-file-convert: convert commits that embed signed tags
- object-file-convert: convert commit objects when writing
- object-file-convert: don't leak when converting tag objects
- object-file-convert: convert tag objects when writing
- object-file-convert: add a function to convert trees between algorithms
- object: factor out parse_mode out of fast-import and tree-walk into in object.h
- cache: add a function to read an OID of a specific algorithm
- tag: sign both hashes
- commit: export add_header_signature to support handling signatures on tags
- commit: convert mergetag before computing the signature of a commit
- commit: write commits for both hashes
- object-file: add a compat_oid_in parameter to write_object_file_flags
- object-file: update the loose object map when writing loose objects
- loose: compatibilty short name support
- loose: add a mapping between SHA-1 and SHA-256 for loose objects
- repository: add a compatibility hash algorithm
- object-names: support input of oids in any supported hash
- oid-array: teach oid-array to handle multiple kinds of oids
- object-file-convert: stubs for converting from one object format to another
Teach a repository to work with both SHA-1 and SHA-256 hash algorithms.
Needs review.
source: <878r8l929e.fsf@gmail.froward.int.ebiederm.org>
* jc/rerere-cleanup (2023-08-25) 4 commits
- rerere: modernize use of empty strbuf
- rerere: try_merge() should use LL_MERGE_ERROR when it means an error
- rerere: fix comment on handle_file() helper
- rerere: simplify check_one_conflict() helper function
Code clean-up.
Not ready to be reviewed yet.
source: <20230824205456.1231371-1-gitster@pobox.com>
^ permalink raw reply
* [RFC PATCH v2 0/6] test-tool: add unit test suite runner
From: Josh Steadmon @ 2024-02-03 0:50 UTC (permalink / raw)
To: git; +Cc: johannes.schindelin, peff, phillip.wood, gitster
In-Reply-To: <cover.1705443632.git.steadmon@google.com>
Please note: this series has been rebased onto jk/unit-tests-buildfix.
For various reasons (see discussion at [1]) we would like an alternative
to `prove` for running test suites (including the unit tests) on
Windows.
This series extends the existing `test-tool run-command testsuite` to
support running unit tests. In addition, it includes some small
cleanups:
* move t-basic out of the unit-tests directory
* don't hardcode the shell for running tests in `test-tool ... testsuite`
* don't hardcode a test name filter in `test-tool ... testsuite`
* add a test wrapper script to allow unit tests and the shell test suite
to run in a single `prove` process
Some known remaining bits of work:
* We should investigate switching the Windows CI to use `test-tool`
instead of prove. However, Windows CI seems broken on
jk/unit-tests-buildfix, and I haven't had time to determine why.
* We should determine whether it is confusing or otherwise harmful to
people's workflow to have the unit tests run in parallel with shell
tests when using prove as the default test target.
[1] https://lore.kernel.org/git/pull.1613.git.1699894837844.gitgitgadget@gmail.com/
Changes in V2:
* Patch 1: move t-basic to a test-tool subcommand rather than a new
executable under t/t0080/
* New patch 2: get the shell path from TEST_SHELL_PATH in
`test-tool run-command testsuite`
* New patch 3: remove the hardcoded filename filter in
`test-tool run-command testsuite`
* Patch 4 (previously 2): simplified now that we no longer need to add
any command-line flags to support unit tests
* Patch 5 (previously 3): avoid trying to run cmake *.pdb files by using
the unit test list built in the makefile in jk/unit-tests-buildfix.
Jeff King (1):
t/Makefile: run unit tests alongside shell tests
Josh Steadmon (5):
t0080: turn t-basic unit test into a helper
test-tool run-command testsuite: get shell from env
test-tool run-command testsuite: remove hardcoded filter
test-tool run-command testsuite: support unit tests
unit tests: add rule for running with test-tool
Makefile | 6 ++--
t/Makefile | 15 +++++++---
.../t-basic.c => helper/test-example-tap.c} | 5 ++--
t/helper/test-run-command.c | 29 +++++++++++++++----
t/helper/test-tool.c | 1 +
t/helper/test-tool.h | 1 +
t/run-test.sh | 13 +++++++++
t/t0080-unit-test-output.sh | 24 +++++++--------
8 files changed, 67 insertions(+), 27 deletions(-)
rename t/{unit-tests/t-basic.c => helper/test-example-tap.c} (95%)
create mode 100755 t/run-test.sh
Range-diff against v1:
1: a9f67ed703 < -: ---------- t0080: turn t-basic unit test into a helper
-: ---------- > 1: da756b4bfb t0080: turn t-basic unit test into a helper
-: ---------- > 2: c8448406d7 test-tool run-command testsuite: get shell from env
-: ---------- > 3: e1b89ae93e test-tool run-command testsuite: remove hardcoded filter
2: 5ecbc976e6 ! 4: b5665386b5 test-tool run-command testsuite: support unit tests
@@ Commit message
test-tool run-command testsuite: support unit tests
Teach the testsuite runner in `test-tool run-command testsuite` how to
- run unit tests, by adding two new flags:
+ run unit tests: if TEST_SHELL_PATH is not set, assume that we're running
+ the programs directly from CWD, rather than defaulting to "sh" as an
+ interpreter.
- First, "--(no-)run-in-shell" allows the test-tool to exec the unit-test
- binaries directly, rather than trying to interpret them as shell
- scripts.
-
- Second "--(no-)require-shell-test-pattern" bypasses the check that the
- test filenames match the expected t####-*.sh pattern.
-
- With these changes, you can now use test-tool to run the unit tests:
+ With this change, you can now use test-tool to run the unit tests:
$ make
$ cd t/unit-tests/bin
- $ ../../helper/test-tool run-command testsuite --no-run-in-shell \
- --no-require-shell-test-pattern
+ $ ../../helper/test-tool run-command testsuite
This should be helpful on Windows to allow running tests without
requiring Perl (for `prove`), as discussed in [1] and [2].
+ This again breaks backwards compatibility, as it is now required to set
+ TEST_SHELL_PATH properly for executing shell scripts, but again, as
+ noted in [2], there are no longer any such invocations in our codebase.
+
[1] https://lore.kernel.org/git/nycvar.QRO.7.76.6.2109091323150.59@tvgsbejvaqbjf.bet/
[2] https://lore.kernel.org/git/850ea42c-f103-68d5-896b-9120e2628686@gmx.de/
## t/helper/test-run-command.c ##
-@@ t/helper/test-run-command.c: static int task_finished(int result UNUSED,
- struct testsuite {
- struct string_list tests, failed;
- int next;
-- int quiet, immediate, verbose, verbose_log, trace, write_junit_xml;
-+ int quiet, immediate, verbose, verbose_log, trace, write_junit_xml, run_in_shell;
- };
- #define TESTSUITE_INIT { \
- .tests = STRING_LIST_INIT_DUP, \
- .failed = STRING_LIST_INIT_DUP, \
-+ .run_in_shell = 1, \
- }
-
- static int next_test(struct child_process *cp, struct strbuf *err, void *cb,
-@@ t/helper/test-run-command.c: static int next_test(struct child_process *cp, struct strbuf *err, void *cb,
- return 0;
-
- test = suite->tests.items[suite->next++].string;
-- strvec_pushl(&cp->args, "sh", test, NULL);
-+ if (suite->run_in_shell)
-+ strvec_push(&cp->args, "sh");
-+ strvec_push(&cp->args, test);
- if (suite->quiet)
- strvec_push(&cp->args, "--quiet");
- if (suite->immediate)
-@@ t/helper/test-run-command.c: static const char * const testsuite_usage[] = {
- static int testsuite(int argc, const char **argv)
- {
- struct testsuite suite = TESTSUITE_INIT;
-- int max_jobs = 1, i, ret = 0;
-+ int max_jobs = 1, i, ret = 0, require_shell_test_pattern = 1;
- DIR *dir;
- struct dirent *d;
- struct option options[] = {
-@@ t/helper/test-run-command.c: static int testsuite(int argc, const char **argv)
- OPT_BOOL('x', "trace", &suite.trace, "trace shell commands"),
- OPT_BOOL(0, "write-junit-xml", &suite.write_junit_xml,
- "write JUnit-style XML files"),
-+ OPT_BOOL(0, "run-in-shell", &suite.run_in_shell,
-+ "run programs in the suite via `sh`"),
-+ OPT_BOOL(0, "require-shell-test-pattern", &require_shell_test_pattern,
-+ "require programs to match 't####-*.sh'"),
- OPT_END()
- };
- struct run_process_parallel_opts opts = {
@@ t/helper/test-run-command.c: static int testsuite(int argc, const char **argv)
.task_finished = test_finished,
.data = &suite,
@@ t/helper/test-run-command.c: static int testsuite(int argc, const char **argv)
argc = parse_options(argc, argv, NULL, options,
testsuite_usage, PARSE_OPT_STOP_AT_NON_OPTION);
-
+@@ t/helper/test-run-command.c: static int testsuite(int argc, const char **argv)
if (max_jobs <= 0)
max_jobs = online_cpus();
+
+ /*
+ * If we run without a shell, we have to provide the relative path to
+ * the executables.
+ */
-+ if (!suite.run_in_shell)
+ suite.shell_path = getenv("TEST_SHELL_PATH");
+ if (!suite.shell_path)
+- suite.shell_path = "sh";
+ strbuf_addstr(&progpath, "./");
+ path_prefix_len = progpath.len;
dir = opendir(".");
if (!dir)
@@ t/helper/test-run-command.c: static int testsuite(int argc, const char **argv)
- while ((d = readdir(dir))) {
- const char *p = d->d_name;
-
-- if (*p != 't' || !isdigit(p[1]) || !isdigit(p[2]) ||
-- !isdigit(p[3]) || !isdigit(p[4]) || p[5] != '-' ||
-- !ends_with(p, ".sh"))
-+ if (!strcmp(p, ".") || !strcmp(p, ".."))
- continue;
-+ if (require_shell_test_pattern)
-+ if (*p != 't' || !isdigit(p[1]) || !isdigit(p[2]) ||
-+ !isdigit(p[3]) || !isdigit(p[4]) || p[5] != '-' ||
-+ !ends_with(p, ".sh"))
-+ continue;
/* No pattern: match all */
if (!argc) {
3: 5b34c851cd ! 5: f2746703d5 unit tests: add rule for running with test-tool
@@ Commit message
`make DEFAULT_UNIT_TEST_TARGET=unit-tests-test-tool unit-tests`, or by
setting DEFAULT_UNIT_TEST_TARGET in config.mak.
- NEEDS WORK: we need to exclude .pdb files generated by cmake [see
- 0df903d402 (unit-tests: do not mistake `.pdb` files for being
- executable, 2023-09-25)]
-
## Makefile ##
-@@ Makefile: $(UNIT_TEST_HELPER_PROGS): %$X: %.o $(UNIT_TEST_DIR)/test-lib.o $(GITLIBS) GIT-L
+@@ Makefile: $(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_DIR)/
.PHONY: build-unit-tests unit-tests
build-unit-tests: $(UNIT_TEST_PROGS)
@@ Makefile: $(UNIT_TEST_HELPER_PROGS): %$X: %.o $(UNIT_TEST_DIR)/test-lib.o $(GITL
$(MAKE) -C t/ unit-tests
## t/Makefile ##
+@@ t/Makefile: CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.tes
+ CHAINLINT = '$(PERL_PATH_SQ)' chainlint.pl
+ UNIT_TEST_SOURCES = $(wildcard unit-tests/t-*.c)
+ UNIT_TESTS = $(patsubst unit-tests/%.c,unit-tests/bin/%$(X),$(UNIT_TEST_SOURCES))
++UNIT_TESTS_NO_DIR = $(notdir $(UNIT_TESTS))
+
+ # `test-chainlint` (which is a dependency of `test-lint`, `test` and `prove`)
+ # checks all tests in all scripts via a single invocation, so tell individual
@@ t/Makefile: $(T):
$(UNIT_TESTS):
@echo "*** $@ ***"; $@
@@ t/Makefile: unit-tests-raw: $(UNIT_TESTS)
+ @echo "*** test-tool - unit tests **"
+ ( \
+ cd unit-tests/bin && \
-+ ../../helper/test-tool run-command testsuite --no-run-in-shell --no-require-shell-test-pattern \
++ ../../helper/test-tool$X run-command testsuite $(UNIT_TESTS_NO_DIR)\
+ )
+
pre-clean:
4: c823265f0d = 6: cd7467a7bd t/Makefile: run unit tests alongside shell tests
base-commit: 799d449105dc1f6e77fa1ebaea4f6d8bdc6537cf
--
2.43.0.594.gd9cf4e227d-goog
^ permalink raw reply
* [RFC PATCH v2 1/6] t0080: turn t-basic unit test into a helper
From: Josh Steadmon @ 2024-02-03 0:50 UTC (permalink / raw)
To: git; +Cc: johannes.schindelin, peff, phillip.wood, gitster
In-Reply-To: <cover.1706921262.git.steadmon@google.com>
While t/unit-tests/t-basic.c uses the unit-test framework added in
e137fe3b29 (unit tests: add TAP unit test framework, 2023-11-09), it is
not a true unit test in that it intentionally fails in order to exercise
various codepaths in the unit-test framework. Thus, we intentionally
exclude it when running unit tests through the various t/Makefile
targets. Instead, it is executed by t0080-unit-test-output.sh, which
verifies its output follows the TAP format expected for the various
pass, skip, or fail cases.
As such, it makes more sense for t-basic to be a helper item for
t0080-unit-test-output.sh, so let's move it to
t/helper/test-example-tap.c and adjust Makefiles as necessary.
This has the additional benefit that test harnesses seeking to run all
unit tests can find them with a simple glob of "t/unit-tests/bin/t-*",
with no exceptions needed. This will be important in a later patch where
we add support for running the unit tests via a test-tool subcommand.
Signed-off-by: Josh Steadmon <steadmon@google.com>
---
Makefile | 4 ++--
t/Makefile | 3 +--
.../t-basic.c => helper/test-example-tap.c} | 5 ++--
t/helper/test-tool.c | 1 +
t/helper/test-tool.h | 1 +
t/t0080-unit-test-output.sh | 24 +++++++++----------
6 files changed, 20 insertions(+), 18 deletions(-)
rename t/{unit-tests/t-basic.c => helper/test-example-tap.c} (95%)
diff --git a/Makefile b/Makefile
index 23723367b8..ba55d817ee 100644
--- a/Makefile
+++ b/Makefile
@@ -802,6 +802,7 @@ TEST_BUILTINS_OBJS += test-dump-split-index.o
TEST_BUILTINS_OBJS += test-dump-untracked-cache.o
TEST_BUILTINS_OBJS += test-env-helper.o
TEST_BUILTINS_OBJS += test-example-decorate.o
+TEST_BUILTINS_OBJS += test-example-tap.o
TEST_BUILTINS_OBJS += test-find-pack.o
TEST_BUILTINS_OBJS += test-fsmonitor-client.o
TEST_BUILTINS_OBJS += test-genrandom.o
@@ -1338,7 +1339,6 @@ THIRD_PARTY_SOURCES += compat/regex/%
THIRD_PARTY_SOURCES += sha1collisiondetection/%
THIRD_PARTY_SOURCES += sha1dc/%
-UNIT_TEST_PROGRAMS += t-basic
UNIT_TEST_PROGRAMS += t-mem-pool
UNIT_TEST_PROGRAMS += t-strbuf
UNIT_TEST_PROGRAMS += t-ctype
@@ -3218,7 +3218,7 @@ perf: all
.PRECIOUS: $(TEST_OBJS)
-t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
+t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o
t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) $(REFTABLE_TEST_LIB)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
diff --git a/t/Makefile b/t/Makefile
index 281f4c3534..1283c90c10 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -44,8 +44,7 @@ TINTEROP = $(sort $(wildcard interop/i[0-9][0-9][0-9][0-9]-*.sh))
CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
CHAINLINT = '$(PERL_PATH_SQ)' chainlint.pl
UNIT_TEST_SOURCES = $(wildcard unit-tests/t-*.c)
-UNIT_TEST_PROGRAMS = $(patsubst unit-tests/%.c,unit-tests/bin/%$(X),$(UNIT_TEST_SOURCES))
-UNIT_TESTS = $(sort $(filter-out unit-tests/bin/t-basic%,$(UNIT_TEST_PROGRAMS)))
+UNIT_TESTS = $(patsubst unit-tests/%.c,unit-tests/bin/%$(X),$(UNIT_TEST_SOURCES))
# `test-chainlint` (which is a dependency of `test-lint`, `test` and `prove`)
# checks all tests in all scripts via a single invocation, so tell individual
diff --git a/t/unit-tests/t-basic.c b/t/helper/test-example-tap.c
similarity index 95%
rename from t/unit-tests/t-basic.c
rename to t/helper/test-example-tap.c
index fda1ae59a6..21e4848e78 100644
--- a/t/unit-tests/t-basic.c
+++ b/t/helper/test-example-tap.c
@@ -1,4 +1,5 @@
-#include "test-lib.h"
+#include "t/unit-tests/test-lib.h"
+#include "test-tool.h"
/*
* The purpose of this "unit test" is to verify a few invariants of the unit
@@ -69,7 +70,7 @@ static void t_empty(void)
; /* empty */
}
-int cmd_main(int argc, const char **argv)
+int cmd__example_tap(int argc, const char **argv)
{
test_res = TEST(check_res = check_int(1, ==, 1), "passing test");
TEST(t_res(1), "passing test and assertion return 1");
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index 33b9501c21..bb5c04c9c0 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -29,6 +29,7 @@ static struct test_cmd cmds[] = {
{ "dump-untracked-cache", cmd__dump_untracked_cache },
{ "env-helper", cmd__env_helper },
{ "example-decorate", cmd__example_decorate },
+ { "example-tap", cmd__example_tap },
{ "find-pack", cmd__find_pack },
{ "fsmonitor-client", cmd__fsmonitor_client },
{ "genrandom", cmd__genrandom },
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index b72f07ded9..38001bd1c6 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -23,6 +23,7 @@ int cmd__dump_untracked_cache(int argc, const char **argv);
int cmd__dump_reftable(int argc, const char **argv);
int cmd__env_helper(int argc, const char **argv);
int cmd__example_decorate(int argc, const char **argv);
+int cmd__example_tap(int argc, const char **argv);
int cmd__find_pack(int argc, const char **argv);
int cmd__fsmonitor_client(int argc, const char **argv);
int cmd__genrandom(int argc, const char **argv);
diff --git a/t/t0080-unit-test-output.sh b/t/t0080-unit-test-output.sh
index 961b54b06c..83b1e3b7f5 100755
--- a/t/t0080-unit-test-output.sh
+++ b/t/t0080-unit-test-output.sh
@@ -8,50 +8,50 @@ test_expect_success 'TAP output from unit tests' '
cat >expect <<-EOF &&
ok 1 - passing test
ok 2 - passing test and assertion return 1
- # check "1 == 2" failed at t/unit-tests/t-basic.c:76
+ # check "1 == 2" failed at t/helper/test-example-tap.c:77
# left: 1
# right: 2
not ok 3 - failing test
ok 4 - failing test and assertion return 0
not ok 5 - passing TEST_TODO() # TODO
ok 6 - passing TEST_TODO() returns 1
- # todo check ${SQ}check(x)${SQ} succeeded at t/unit-tests/t-basic.c:25
+ # todo check ${SQ}check(x)${SQ} succeeded at t/helper/test-example-tap.c:26
not ok 7 - failing TEST_TODO()
ok 8 - failing TEST_TODO() returns 0
- # check "0" failed at t/unit-tests/t-basic.c:30
+ # check "0" failed at t/helper/test-example-tap.c:31
# skipping test - missing prerequisite
- # skipping check ${SQ}1${SQ} at t/unit-tests/t-basic.c:32
+ # skipping check ${SQ}1${SQ} at t/helper/test-example-tap.c:33
ok 9 - test_skip() # SKIP
ok 10 - skipped test returns 1
# skipping test - missing prerequisite
ok 11 - test_skip() inside TEST_TODO() # SKIP
ok 12 - test_skip() inside TEST_TODO() returns 1
- # check "0" failed at t/unit-tests/t-basic.c:48
+ # check "0" failed at t/helper/test-example-tap.c:49
not ok 13 - TEST_TODO() after failing check
ok 14 - TEST_TODO() after failing check returns 0
- # check "0" failed at t/unit-tests/t-basic.c:56
+ # check "0" failed at t/helper/test-example-tap.c:57
not ok 15 - failing check after TEST_TODO()
ok 16 - failing check after TEST_TODO() returns 0
- # check "!strcmp("\thello\\\\", "there\"\n")" failed at t/unit-tests/t-basic.c:61
+ # check "!strcmp("\thello\\\\", "there\"\n")" failed at t/helper/test-example-tap.c:62
# left: "\011hello\\\\"
# right: "there\"\012"
- # check "!strcmp("NULL", NULL)" failed at t/unit-tests/t-basic.c:62
+ # check "!strcmp("NULL", NULL)" failed at t/helper/test-example-tap.c:63
# left: "NULL"
# right: NULL
- # check "${SQ}a${SQ} == ${SQ}\n${SQ}" failed at t/unit-tests/t-basic.c:63
+ # check "${SQ}a${SQ} == ${SQ}\n${SQ}" failed at t/helper/test-example-tap.c:64
# left: ${SQ}a${SQ}
# right: ${SQ}\012${SQ}
- # check "${SQ}\\\\${SQ} == ${SQ}\\${SQ}${SQ}" failed at t/unit-tests/t-basic.c:64
+ # check "${SQ}\\\\${SQ} == ${SQ}\\${SQ}${SQ}" failed at t/helper/test-example-tap.c:65
# left: ${SQ}\\\\${SQ}
# right: ${SQ}\\${SQ}${SQ}
not ok 17 - messages from failing string and char comparison
- # BUG: test has no checks at t/unit-tests/t-basic.c:91
+ # BUG: test has no checks at t/helper/test-example-tap.c:92
not ok 18 - test with no checks
ok 19 - test with no checks returns 0
1..19
EOF
- ! "$GIT_BUILD_DIR"/t/unit-tests/bin/t-basic >actual &&
+ ! test-tool example-tap >actual &&
test_cmp expect actual
'
--
2.43.0.594.gd9cf4e227d-goog
^ permalink raw reply related
* [RFC PATCH v2 2/6] test-tool run-command testsuite: get shell from env
From: Josh Steadmon @ 2024-02-03 0:50 UTC (permalink / raw)
To: git; +Cc: johannes.schindelin, peff, phillip.wood, gitster
In-Reply-To: <cover.1706921262.git.steadmon@google.com>
When running tests through `test-tool run-command testsuite`, we
currently hardcode `sh` as the command interpreter. As discussed in [1],
this is incorrect, and we should be using the shell set in
TEST_SHELL_PATH instead.
Add a shell_path field in struct testsuite so that we can pass this to
the task runner callback. If this is non-null, we'll use it as the
argv[0] of the subprocess. Otherwise, we'll just execute the test
program directly.
When setting up the struct testsuite in testsuite(), use the value
of TEST_SHELL_PATH if it's set, otherwise default to `sh`.
[1] https://lore.kernel.org/git/20240123005913.GB835964@coredump.intra.peff.net/
Signed-off-by: Josh Steadmon <steadmon@google.com>
---
t/helper/test-run-command.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index c0ed8722c8..a41a54d9cb 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -65,6 +65,7 @@ struct testsuite {
struct string_list tests, failed;
int next;
int quiet, immediate, verbose, verbose_log, trace, write_junit_xml;
+ const char *shell_path;
};
#define TESTSUITE_INIT { \
.tests = STRING_LIST_INIT_DUP, \
@@ -80,7 +81,9 @@ static int next_test(struct child_process *cp, struct strbuf *err, void *cb,
return 0;
test = suite->tests.items[suite->next++].string;
- strvec_pushl(&cp->args, "sh", test, NULL);
+ if (suite->shell_path)
+ strvec_push(&cp->args, suite->shell_path);
+ strvec_push(&cp->args, test);
if (suite->quiet)
strvec_push(&cp->args, "--quiet");
if (suite->immediate)
@@ -162,6 +165,10 @@ static int testsuite(int argc, const char **argv)
if (max_jobs <= 0)
max_jobs = online_cpus();
+ suite.shell_path = getenv("TEST_SHELL_PATH");
+ if (!suite.shell_path)
+ suite.shell_path = "sh";
+
dir = opendir(".");
if (!dir)
die("Could not open the current directory");
--
2.43.0.594.gd9cf4e227d-goog
^ permalink raw reply related
* [RFC PATCH v2 3/6] test-tool run-command testsuite: remove hardcoded filter
From: Josh Steadmon @ 2024-02-03 0:50 UTC (permalink / raw)
To: git; +Cc: johannes.schindelin, peff, phillip.wood, gitster
In-Reply-To: <cover.1706921262.git.steadmon@google.com>
`test-tool run-command testsuite` currently assumes that it will only be
running the shell test suite, and therefore filters out anything that
does not match a hardcoded pattern of "t[0-9][0-9][0-9][0-9]-*.sh".
Later in this series, we'll adapt `test-tool run-command testsuite` to
also support unit tests, which do not follow the same naming conventions
as the shell tests, so this hardcoded pattern is inconvenient.
Since `testsuite` also allows specifying patterns on the command-line,
let's just remove this pattern. As noted in [1], there are no longer any
uses of `testsuite` in our codebase, it should be OK to break backwards
compatibility in this case. We also add a new filter to avoid trying to
execute "." and "..", so that users who wish to execute every test in a
directory can do so without specifying a pattern.
[1] https://lore.kernel.org/git/850ea42c-f103-68d5-896b-9120e2628686@gmx.de/
Signed-off-by: Josh Steadmon <steadmon@google.com>
---
t/helper/test-run-command.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index a41a54d9cb..e6bd792274 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -175,9 +175,7 @@ static int testsuite(int argc, const char **argv)
while ((d = readdir(dir))) {
const char *p = d->d_name;
- if (*p != 't' || !isdigit(p[1]) || !isdigit(p[2]) ||
- !isdigit(p[3]) || !isdigit(p[4]) || p[5] != '-' ||
- !ends_with(p, ".sh"))
+ if (!strcmp(p, ".") || !strcmp(p, ".."))
continue;
/* No pattern: match all */
--
2.43.0.594.gd9cf4e227d-goog
^ permalink raw reply related
* [RFC PATCH v2 4/6] test-tool run-command testsuite: support unit tests
From: Josh Steadmon @ 2024-02-03 0:50 UTC (permalink / raw)
To: git; +Cc: johannes.schindelin, peff, phillip.wood, gitster
In-Reply-To: <cover.1706921262.git.steadmon@google.com>
Teach the testsuite runner in `test-tool run-command testsuite` how to
run unit tests: if TEST_SHELL_PATH is not set, assume that we're running
the programs directly from CWD, rather than defaulting to "sh" as an
interpreter.
With this change, you can now use test-tool to run the unit tests:
$ make
$ cd t/unit-tests/bin
$ ../../helper/test-tool run-command testsuite
This should be helpful on Windows to allow running tests without
requiring Perl (for `prove`), as discussed in [1] and [2].
This again breaks backwards compatibility, as it is now required to set
TEST_SHELL_PATH properly for executing shell scripts, but again, as
noted in [2], there are no longer any such invocations in our codebase.
[1] https://lore.kernel.org/git/nycvar.QRO.7.76.6.2109091323150.59@tvgsbejvaqbjf.bet/
[2] https://lore.kernel.org/git/850ea42c-f103-68d5-896b-9120e2628686@gmx.de/
Signed-off-by: Josh Steadmon <steadmon@google.com>
---
t/helper/test-run-command.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index e6bd792274..a0b8dc6fd7 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -158,6 +158,8 @@ static int testsuite(int argc, const char **argv)
.task_finished = test_finished,
.data = &suite,
};
+ struct strbuf progpath = STRBUF_INIT;
+ size_t path_prefix_len;
argc = parse_options(argc, argv, NULL, options,
testsuite_usage, PARSE_OPT_STOP_AT_NON_OPTION);
@@ -165,9 +167,14 @@ static int testsuite(int argc, const char **argv)
if (max_jobs <= 0)
max_jobs = online_cpus();
+ /*
+ * If we run without a shell, we have to provide the relative path to
+ * the executables.
+ */
suite.shell_path = getenv("TEST_SHELL_PATH");
if (!suite.shell_path)
- suite.shell_path = "sh";
+ strbuf_addstr(&progpath, "./");
+ path_prefix_len = progpath.len;
dir = opendir(".");
if (!dir)
@@ -180,13 +187,17 @@ static int testsuite(int argc, const char **argv)
/* No pattern: match all */
if (!argc) {
- string_list_append(&suite.tests, p);
+ strbuf_setlen(&progpath, path_prefix_len);
+ strbuf_addstr(&progpath, p);
+ string_list_append(&suite.tests, progpath.buf);
continue;
}
for (i = 0; i < argc; i++)
if (!wildmatch(argv[i], p, 0)) {
- string_list_append(&suite.tests, p);
+ strbuf_setlen(&progpath, path_prefix_len);
+ strbuf_addstr(&progpath, p);
+ string_list_append(&suite.tests, progpath.buf);
break;
}
}
@@ -213,6 +224,7 @@ static int testsuite(int argc, const char **argv)
string_list_clear(&suite.tests, 0);
string_list_clear(&suite.failed, 0);
+ strbuf_release(&progpath);
return ret;
}
--
2.43.0.594.gd9cf4e227d-goog
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox