Git development
 help / color / mirror / Atom feed
* [PATCH v4] fuzz: add new oss-fuzz fuzzer for date.c / date.h
From: Arthur Chan via GitGitGadget @ 2023-11-17 17:47 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Arthur Chan, Arthur Chan
In-Reply-To: <pull.1612.v3.git.1699959186146.gitgitgadget@gmail.com>

From: Arthur Chan <arthur.chan@adalogics.com>

Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
---
    fuzz: add new oss-fuzz fuzzer for date.c / date.h
    
    This patch is aimed to add a new oss-fuzz fuzzer to the oss-fuzz
    directory for fuzzing date.c / date.h in the base directory.
    
    The .gitignore of the oss-fuzz directory and the Makefile have been
    modified to accommodate the new fuzzer fuzz-date.c.
    
    Fixed the objects order in .gitignore and Makefiles and fixed some of
    the logic and formatting for the fuzz-date.c fuzzer in v2.
    
    Fixed the creation and memory allocation of the fuzzing str in v3. Also
    fixed the tz type and sign-extended the data before passing to the tz
    variable.
    
    Fixed the tz variable allocations and some of the bytes used for fuzzing
    variables in v4.
    
    Comment: Yes, indeed. It is quite annoying to have that twice. Yes, the
    tz should be considered as attacker controllable and thus negative
    values should be considered. But it is tricky to fuzz it because the
    date.c::gm_time_t() will call die() if the value is invalid and that
    exit the fuzzer directly. OSS-Fuzz may consider it as an issue (or bug)
    because the fuzzer exit "unexpectedly". I agree that if we consider the
    tz as "attacker controllable, we should include negative values, but
    since it will cause the fuzzer exit, I am not sure if it is the right
    approach from the fuzzing perspective. Also, it is something that date.c
    already take care of with the conditional checking, thus it may also be
    worth to do some checking and exclude some invalid values before calling
    date.c::show_date() but this may result in copying some conditional
    checking code from date.c.
    
    Additional comment for v4: Thanks for the suggestion. Yes, that maybe
    the easier approach. Since the new logic is only using 2 bytes for the
    int16_t tz, thus the local and dmtype variable could use separate bytes
    to increase "randomness".

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1612%2Farthurscchan%2Fnew-fuzzer-date-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1612/arthurscchan/new-fuzzer-date-v4
Pull-Request: https://github.com/gitgitgadget/git/pull/1612

Range-diff vs v3:

 1:  046bca32889 ! 1:  33a72d4c197 fuzz: add new oss-fuzz fuzzer for date.c / date.h
     @@ oss-fuzz/fuzz-date.c (new)
      +{
      +	int local;
      +	int num;
     -+	int tz;
      +	char *str;
     -+	int8_t *tmp_data;
     ++	int16_t tz;
      +	timestamp_t ts;
      +	enum date_mode_type dmtype;
      +	struct date_mode *dm;
      +
      +	if (size <= 4)
      +		/*
     -+		 * we use the first byte to fuzz dmtype and local,
     -+		 * then the next three bytes to fuzz tz	offset,
     -+		 * and the remainder (at least one byte) is fed
     -+		 * as end-user input to approxidate_careful().
     ++		 * we use the first byte to fuzz dmtype and the
     ++		 * second byte to fuzz local, then the next two
     ++		 * bytes to fuzz tz offset. The remainder
     ++		 * (at least one byte) is fed as input to
     ++		 * approxidate_careful().
      +		 */
      +		return 0;
      +
     -+	local = !!(*data & 0x10);
     -+	num = *data % DATE_UNIX;
     ++	local = !!(*data++ & 0x10);
     ++	num = *data++ % DATE_UNIX;
      +	if (num >= DATE_STRFTIME)
      +		num++;
      +	dmtype = (enum date_mode_type)num;
     -+	data++;
     -+	size--;
     ++	size -= 2;
      +
     -+	tmp_data = (int8_t*)data;
     -+	tz = *tmp_data++;
     -+	tz = (tz << 8) | *tmp_data++;
     -+	tz = (tz << 8) | *tmp_data++;
     -+	data += 3;
     -+	size -= 3;
     ++	tz = *data++;
     ++	tz = (tz << 8) | *data++;
     ++	size -= 2;
      +
      +	str = xmemdupz(data, size);
      +
     @@ oss-fuzz/fuzz-date.c (new)
      +
      +	dm = date_mode_from_type(dmtype);
      +	dm->local = local;
     -+	show_date(ts, tz, dm);
     ++	show_date(ts, (int)tz, dm);
      +
      +	date_mode_release(dm);
      +


 Makefile             |  1 +
 oss-fuzz/.gitignore  |  1 +
 oss-fuzz/fuzz-date.c | 49 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 oss-fuzz/fuzz-date.c

diff --git a/Makefile b/Makefile
index 03adcb5a480..4b875ef6ce1 100644
--- a/Makefile
+++ b/Makefile
@@ -750,6 +750,7 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
 ETAGS_TARGET = TAGS
 
 FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
+FUZZ_OBJS += oss-fuzz/fuzz-date.o
 FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
 FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
 .PHONY: fuzz-objs
diff --git a/oss-fuzz/.gitignore b/oss-fuzz/.gitignore
index 9acb74412ef..5b954088254 100644
--- a/oss-fuzz/.gitignore
+++ b/oss-fuzz/.gitignore
@@ -1,3 +1,4 @@
 fuzz-commit-graph
+fuzz-date
 fuzz-pack-headers
 fuzz-pack-idx
diff --git a/oss-fuzz/fuzz-date.c b/oss-fuzz/fuzz-date.c
new file mode 100644
index 00000000000..036378b946f
--- /dev/null
+++ b/oss-fuzz/fuzz-date.c
@@ -0,0 +1,49 @@
+#include "git-compat-util.h"
+#include "date.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+	int local;
+	int num;
+	char *str;
+	int16_t tz;
+	timestamp_t ts;
+	enum date_mode_type dmtype;
+	struct date_mode *dm;
+
+	if (size <= 4)
+		/*
+		 * we use the first byte to fuzz dmtype and the
+		 * second byte to fuzz local, then the next two
+		 * bytes to fuzz tz offset. The remainder
+		 * (at least one byte) is fed as input to
+		 * approxidate_careful().
+		 */
+		return 0;
+
+	local = !!(*data++ & 0x10);
+	num = *data++ % DATE_UNIX;
+	if (num >= DATE_STRFTIME)
+		num++;
+	dmtype = (enum date_mode_type)num;
+	size -= 2;
+
+	tz = *data++;
+	tz = (tz << 8) | *data++;
+	size -= 2;
+
+	str = xmemdupz(data, size);
+
+	ts = approxidate_careful(str, &num);
+	free(str);
+
+	dm = date_mode_from_type(dmtype);
+	dm->local = local;
+	show_date(ts, (int)tz, dm);
+
+	date_mode_release(dm);
+
+	return 0;
+}

base-commit: dadef801b365989099a9929e995589e455c51fed
-- 
gitgitgadget

^ permalink raw reply related

* [PATCH] setup: recognize bare repositories with packed-refs
From: Adam Majer @ 2023-11-17 20:32 UTC (permalink / raw)
  To: git; +Cc: Adam Majer
In-Reply-To: <20231117202513.20604-1-adamm@zombino.com>

In a garbage collected bare git repository, the refs/ subdirectory is
empty.  In use-cases when such a repository is directly added into
another repository, it no longer is detected as valid. Git doesn't
preserve empty paths so refs/ subdirectory is not present. Simply
creating an empty refs/ subdirectory fixes this problem.

Looking more carefully, there are two backends to handle various refs in
git -- the files backend that uses refs/ subdirectory and the
packed-refs backend that uses packed-refs file. If references are not
found in refs/ subdirectory (or directory doesn't exist), the
packed-refs directory will be consulted. Garbage collected repository
will have all its references in packed-refs file.

To allow the use-case when packed-refs is the only source of refs and
refs/ subdirectory is simply not present, augment 'is_git_directory()'
setup function to look for packed-refs file as an alternative to refs/
subdirectory.

Signed-off-by: Adam Majer <adamm@zombino.com>
---
 setup.c       | 10 +++++++---
 t/t6500-gc.sh |  8 ++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/setup.c b/setup.c
index fc592dc6dd..2a6dda6ae9 100644
--- a/setup.c
+++ b/setup.c
@@ -348,7 +348,7 @@ int get_common_dir_noenv(struct strbuf *sb, const char *gitdir)
  *
  *  - either an objects/ directory _or_ the proper
  *    GIT_OBJECT_DIRECTORY environment variable
- *  - a refs/ directory
+ *  - a refs/ directory or packed-refs file
  *  - either a HEAD symlink or a HEAD file that is formatted as
  *    a proper "ref:", or a regular file HEAD that has a properly
  *    formatted sha1 object name.
@@ -384,8 +384,12 @@ int is_git_directory(const char *suspect)
 
 	strbuf_setlen(&path, len);
 	strbuf_addstr(&path, "/refs");
-	if (access(path.buf, X_OK))
-		goto done;
+	if (access(path.buf, X_OK)) {
+		strbuf_setlen(&path, len);
+		strbuf_addstr(&path, "/packed-refs");
+		if (access(path.buf, R_OK))
+			goto done;
+	}
 
 	ret = 1;
 done:
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index 18fe1c25e6..e81eb7d2ab 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -214,6 +214,14 @@ test_expect_success 'gc.repackFilter launches repack with a filter' '
 	grep -E "^trace: (built-in|exec|run_command): git repack .* --filter=blob:none ?.*" trace.out
 '
 
+test_expect_success 'remove empty refs/ subdirectory' '
+	git -C bare.git cat-file -e 60dd8ad7d8ed49005c18b7ce9f5b7a45c28df814 &&
+	test_dir_is_empty bare.git/refs/heads &&
+	test_dir_is_empty bare.git/refs/tags &&
+	rm -r bare.git/refs &&
+	GIT_DIR="$PWD"/bare.git git -C bare.git cat-file -e 60dd8ad7d8ed49005c18b7ce9f5b7a45c28df814
+'
+
 test_expect_success 'gc.repackFilterTo store filtered out objects' '
 	test_when_finished "rm -rf bare.git filtered.git" &&
 
-- 
2.42.0


^ permalink raw reply related

* [PATCH] setup: recognize bare repositories with packed-refs
From: Adam Majer @ 2023-11-17 20:25 UTC (permalink / raw)
  To: git; +Cc: Adam Majer

When a garbage collected bare git repository is added to another git
repository, the refs/ subdirectory is empty.  In case-cases when such a
repository is added into another repository directly, it no longer is
detected as a valid. Git doesn't preserve empty paths so refs/
subdirectory is not present in parent git.  Simply creating an empty
refs/ subdirectory fixes this problem.

Looking more carefully, there are two backends to handle various refs in
git -- the files backend that uses refs/ subdirectory and the
packed-refs backend that uses packed-refs file. If references are not
found in refs/ subdirectory (or directory doesn't exist), the
packed-refs directory will be consulted. Garbage collected repository
will have all its references in packed-refs file.

To allow the use-case when packed-refs is the only source of refs and
refs/ subdirectory is simply not present, augment 'is_git_directory()'
setup function to look for packed-refs file as an alternative to refs/
subdirectory.

Signed-off-by: Adam Majer <adamm@zombino.com>
---
 setup.c       | 10 +++++++---
 t/t6500-gc.sh |  8 ++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/setup.c b/setup.c
index fc592dc6dd..2a6dda6ae9 100644
--- a/setup.c
+++ b/setup.c
@@ -348,7 +348,7 @@ int get_common_dir_noenv(struct strbuf *sb, const char *gitdir)
  *
  *  - either an objects/ directory _or_ the proper
  *    GIT_OBJECT_DIRECTORY environment variable
- *  - a refs/ directory
+ *  - a refs/ directory or packed-refs file
  *  - either a HEAD symlink or a HEAD file that is formatted as
  *    a proper "ref:", or a regular file HEAD that has a properly
  *    formatted sha1 object name.
@@ -384,8 +384,12 @@ int is_git_directory(const char *suspect)
 
 	strbuf_setlen(&path, len);
 	strbuf_addstr(&path, "/refs");
-	if (access(path.buf, X_OK))
-		goto done;
+	if (access(path.buf, X_OK)) {
+		strbuf_setlen(&path, len);
+		strbuf_addstr(&path, "/packed-refs");
+		if (access(path.buf, R_OK))
+			goto done;
+	}
 
 	ret = 1;
 done:
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index 18fe1c25e6..e81eb7d2ab 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -214,6 +214,14 @@ test_expect_success 'gc.repackFilter launches repack with a filter' '
 	grep -E "^trace: (built-in|exec|run_command): git repack .* --filter=blob:none ?.*" trace.out
 '
 
+test_expect_success 'remove empty refs/ subdirectory' '
+	git -C bare.git cat-file -e 60dd8ad7d8ed49005c18b7ce9f5b7a45c28df814 &&
+	test_dir_is_empty bare.git/refs/heads &&
+	test_dir_is_empty bare.git/refs/tags &&
+	rm -r bare.git/refs &&
+	GIT_DIR="$PWD"/bare.git git -C bare.git cat-file -e 60dd8ad7d8ed49005c18b7ce9f5b7a45c28df814
+'
+
 test_expect_success 'gc.repackFilterTo store filtered out objects' '
 	test_when_finished "rm -rf bare.git filtered.git" &&
 
-- 
2.42.0


^ permalink raw reply related

* Re: [PATCH] setup: recognize bare repositories with packed-refs
From: Adam Majer @ 2023-11-17 20:44 UTC (permalink / raw)
  To: git
In-Reply-To: <20231117203253.21143-1-adamm@zombino.com>

On 2023-11-17 21:32, Adam Majer wrote:
> +test_expect_success 'remove empty refs/ subdirectory' '
> +	git -C bare.git cat-file -e 60dd8ad7d8ed49005c18b7ce9f5b7a45c28df814 &&
> +	test_dir_is_empty bare.git/refs/heads &&
> +	test_dir_is_empty bare.git/refs/tags &&
> +	rm -r bare.git/refs &&
> +	GIT_DIR="$PWD"/bare.git git -C bare.git cat-file -e 60dd8ad7d8ed49005c18b7ce9f5b7a45c28df814

In the test, I've first tried to use GIT_CEILING_DIRECTORIES="$PWD" here 
instead, but git went up into the parent directory anyway. I'm not sure 
if this is a bug, or feature, or my misunderstanding.

- Adam


^ permalink raw reply

* Re: [PATCH] merge-file: add --diff-algorithm option
From: Antonin Delpeuch @ 2023-11-17 21:42 UTC (permalink / raw)
  To: git
In-Reply-To: <pull.1606.git.git.1699480494355.gitgitgadget@gmail.com>

Hi all,

Here a few more thoughts about this patch, to explain what brought me to 
needing that. If this need is misguided, perhaps you could redirect me 
to a better solution.

I am writing a custom merge driver for Java files. This merge driver 
internally calls git-merge-file and then solves the merge conflicts 
which only consist of import statements (there might be cases where it 
gets it wrong, but I can then use other tools to cleanup those import 
statements). When testing this, I noticed that the merge driver 
performed more poorly on other sorts of conflicts, compared to the 
standard "ort" merge strategy. This is because "ort" uses the 
"histogram" diff algorithm, which gives better results than the "myers" 
diff algorithm that merge-file uses.

Intuitively, if "histogram" is the default diff algorithm used by "git 
merge", then it would also make sense to have the same default for "git 
merge-file", but I assume that changing this default could be considered 
a bad breaking change. So I thought that making this diff algorithm 
configurable would be an acceptable move, hence my patch.

Of course, the diffing could be configured in other ways, for instance 
with its handling of whitespace or EOL (similarly to what the "git-diff" 
command offers). I think those options would definitely be worth 
exposing in merge-file as well. If you think this makes sense, then I 
would be happy to work on a new version of this patch which would 
attempt to include all the relevant options. I could also try to add the 
corresponding tests.

But perhaps my need is misguided? Could it be that I should not be 
writing a custom merge driver, but instead use another extension point 
to only process the conflicting hunks after execution of the existing 
merge driver? I couldn't find such an extension point, but it can well 
be that I missed it.

Thank you,

Antonin


^ permalink raw reply

* Re: Migration of git-scm.com to a static web site: ready for review/testing
From: Johannes Schindelin @ 2023-11-18  1:14 UTC (permalink / raw)
  To: Todd Zullinger; +Cc: git, Matt Burke, Victoria Dye, Matthias Aßhauer
In-Reply-To: <ZVeUQEG5jIzKbvmT@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 3330 bytes --]

Hi Todd,

On Fri, 17 Nov 2023, Todd Zullinger wrote:

> Johannes Schindelin wrote:
> > At this point, the patches are fairly robust and I am mainly hoping for
> > help with verifying that the static site works as intended, that existing
> > links will continue to work with the new site (essentially, find obscure
> > references to the existing website, then insert `git.github.io/` in the
> > URL and verify that it works as intended).
> >
> > To that end, I deployed this branch to GitHub Pages so that anyone
> > interested (hopefully many!) can have a look at
> > https://git.github.io/git-scm.com/ and compare to the existing
> > https://git-scm.com/.
>
> This is nice.  Thanks to all for working on it!

😊

> For checking links, a tool like linkcheker[1] is very handy.
> This is run against the local docs in the Fedora package
> builds to catch broken links.

Hmm, `linkchecker` is really slow for me, even locally.

> I ran it against the test site and it turned up _a lot_ of
> broken links.  [...]
>
>   URL        `ch00/ch10-git-internals'
>   Name       `Git Internals'
>   Parent URL https://git.github.io/git-scm.com/book/tr/v2/Ek-b%C3%B6l%C3%BCm-C:-Git-Commands-Plumbing-Commands/, line 106, col 1318
>   Real URL   https://git.github.io/git-scm.com/book/tr/v2/Ek-b%C3%B6l%C3%BCm-C:-Git-Commands-Plumbing-Commands/ch00/ch10-git-internals
>   Check time 3.303 seconds
>   Size       1KB
>   Result     Error: 404 Not Found

Good catch. I totally forgot to take care of the cross-references!

This is now fixed, as of
https://github.com/dscho/git-scm.com/commit/e599a57b2fadf8cb01e57af23fcb929b32e94bcb

I kicked off the GitHub workflow to re-generate the books, and the updated
GitHub Pages look fine (see e.g. the parent URL mentioned above and follow
the "Pull Request Refs" link).

> Running it against a local directory of the content would be
> a lot faster, if that's an option.  It's also worth bumping
> the default number of threads from 10 to increase the speed
> a bit.
>
> [1] https://linkchecker.github.io/linkchecker/

Unfortunately it is actually quite slow.

Granted, the added cross-references now increase the number of hyperlinks
to check, but after I let the program run for a bit over an hour to look
at https://git-scm.com/ (for comparison), it is now running on the local
build (i.e. the `public/` folder generated by Hugo, not even an HTTP
server) for over 45 minutes and still not done:

-- snip --
[...]
10 threads active, 112977 links queued, 206443 links in 100001 URLs checked, runtime 48 minutes, 46 seconds
10 threads active, 113455 links queued, 206689 links in 100001 URLs checked, runtime 48 minutes, 52 seconds
10 threads active, 113829 links queued, 206874 links in 100001 URLs checked, runtime 48 minutes, 57 seconds
10 threads active, 114230 links queued, 207136 links in 100001 URLs checked, runtime 49 minutes, 3 seconds
10 threads active, 114731 links queued, 207498 links in 100001 URLs checked, runtime 49 minutes, 9 seconds
-- snap --

Maybe something is going utterly wrong because the number of links seems
to be dramatically larger than what the https://git-scm.com/ reported;
Maybe linkchecker broke out of the `public/` directory and now indexes my
entire harddrive ;-)

Ciao,
Johannes

^ permalink raw reply

* Re: Migration of git-scm.com to a static web site: ready for review/testing
From: Todd Zullinger @ 2023-11-18  2:57 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, Matt Burke, Victoria Dye, Matthias Aßhauer
In-Reply-To: <4dd9b45d-b352-d8ba-3314-96ab48f7abf7@gmx.de>

Hi Johannes,

Johannes Schindelin wrote:
>> For checking links, a tool like linkcheker[1] is very handy.
>> This is run against the local docs in the Fedora package
>> builds to catch broken links.
> 
> Hmm, `linkchecker` is really slow for me, even locally.

Yeah, it took an hour and a half to run for me, both on an
old laptop and a fast server with plenty of threads,
bandwidth, and memory.

Checking the git HTML documentation takes under 30 seconds,
which is largely the only place I've used it.  It has been
very helpful in catching broken links in the docs during the
build and the time is short enough that I never minded.

> Granted, the added cross-references now increase the number of hyperlinks
> to check, but after I let the program run for a bit over an hour to look
> at https://git-scm.com/ (for comparison), it is now running on the local
> build (i.e. the `public/` folder generated by Hugo, not even an HTTP
> server) for over 45 minutes and still not done:
> 
> -- snip --
> [...]
> 10 threads active, 112977 links queued, 206443 links in 100001 URLs checked, runtime 48 minutes, 46 seconds
> 10 threads active, 113455 links queued, 206689 links in 100001 URLs checked, runtime 48 minutes, 52 seconds
> 10 threads active, 113829 links queued, 206874 links in 100001 URLs checked, runtime 48 minutes, 57 seconds
> 10 threads active, 114230 links queued, 207136 links in 100001 URLs checked, runtime 49 minutes, 3 seconds
> 10 threads active, 114731 links queued, 207498 links in 100001 URLs checked, runtime 49 minutes, 9 seconds
> -- snap --

I would have thought that bumping the number of threads a
lot would really help, but I ran it on a dual Xeon system
with 40 threads and it took about the same time.  Perhaps I
should have increased to double or more the system processor
count.

> Maybe something is going utterly wrong because the number
> of links seems to be dramatically larger than what the
> https://git-scm.com/ reported; Maybe linkchecker broke out
> of the `public/` directory and now indexes my entire
> harddrive ;-)

Heh, hopefully not. :)

I wondered if there were circular links that it was picking
up and not de-duplicating.  I may try to run it with the
--verbose option which logs all checked URLs.  Maybe that
will turn up something.  It sure seems like there's a _lot_
of links here.

There is a --recursion-level option which might be helpful.
The --ignore-url and/or --no-follow-url may also be useful.

Though even if it's (very) slow, it might be worth running
to flush out some initial issues before making the site
live.  Letting it run in the background for a few hours is
probably less effort than fielding a number of big reports
about broken URL here and there. :)

Of course, it would be even better if it were fast enough to
run as part of the site build process to catch broken links
before each deployment, but that would need to be measured
in some relatively small number of seconds instead of the
hours it seems to take now. :/

-- 
Todd

^ permalink raw reply

* Re: Migration of git-scm.com to a static web site: ready for review/testing
From: Johannes Sixt @ 2023-11-18  9:41 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, Matt Burke, Victoria Dye, Matthias Aßhauer
In-Reply-To: <6f7d20b4-a725-0ef9-f6d3-ff2810da9e7a@gmx.de>

Am 17.11.23 um 14:25 schrieb Johannes Schindelin:
> Hi,
> 
> the idea of migrating https://git-scm.com/ from a Rails app to a static
> site has been discussed several times on this list in the past.
> 
> Thanks to the heroic, multi-year efforts of Matt Burke, Victoria Dye and
> Matthias Aßhauer, there is now a Pull Request, ready for review:
> https://github.com/git/git-scm.com/pull/1804
> 
> This Pull Request is not for the faint of heart, mainly because of the
> sheer amount of generated pages that are committed to the repository (such
> as the book, the manual pages, etc, a design decision necessary to run
> this as a static website).
> 
> These pages are generated by GitHub workflows that are intended to run on
> a schedule, and the scripts that generate them are part of the Pull
> Request. For that reason, I do not consider it necessary to review those
> generated pages, those reviews have been done in the upstream sources from
> which the pages were generated.
> 
> At this point, the patches are fairly robust and I am mainly hoping for
> help with verifying that the static site works as intended, that existing
> links will continue to work with the new site (essentially, find obscure
> references to the existing website, then insert `git.github.io/` in the
> URL and verify that it works as intended).
> 
> To that end, I deployed this branch to GitHub Pages so that anyone
> interested (hopefully many!) can have a look at
> https://git.github.io/git-scm.com/ and compare to the existing
> https://git-scm.com/.

When a transition to static pages happens, an important aspect is that
external links that point into git-scm.com must not be invalidated.
There are many such links in Stackoverflow answers, for example.

I checked one link:

https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt--r
https://git.github.io/git-scm.com/docs/git-rebase#Documentation/git-rebase.txt--r

and it is looking very good. Thank you! I assume that keeping links
working is not just a happy accident, but part of the plan.

-- Hannes


^ permalink raw reply

* Re: Migration of git-scm.com to a static web site: ready for review/testing
From: Johannes Schindelin @ 2023-11-18  9:46 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git, Matt Burke, Victoria Dye, Matthias Aßhauer
In-Reply-To: <39f863b9-fc81-43ca-93f5-89e341e8615d@kdbg.org>

Hi Hannes,

Yes, keeping existing deep links working is very much a goal of this work.

Thank you,
Johannes


-------- Original Message --------
From: Johannes Sixt <j6t@kdbg.org>
Sent: November 18, 2023 10:41:11 AM GMT+01:00
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, Matt Burke <spraints@gmail.com>, Victoria Dye <vdye@github.com>, "Matthias Aßhauer" <mha1993@live.de>
Subject: Re: Migration of git-scm.com to a static web site: ready for review/testing

Am 17.11.23 um 14:25 schrieb Johannes Schindelin:
> Hi,
> 
> the idea of migrating https://git-scm.com/ from a Rails app to a static
> site has been discussed several times on this list in the past.
> 
> Thanks to the heroic, multi-year efforts of Matt Burke, Victoria Dye and
> Matthias Aßhauer, there is now a Pull Request, ready for review:
> https://github.com/git/git-scm.com/pull/1804
> 
> This Pull Request is not for the faint of heart, mainly because of the
> sheer amount of generated pages that are committed to the repository (such
> as the book, the manual pages, etc, a design decision necessary to run
> this as a static website).
> 
> These pages are generated by GitHub workflows that are intended to run on
> a schedule, and the scripts that generate them are part of the Pull
> Request. For that reason, I do not consider it necessary to review those
> generated pages, those reviews have been done in the upstream sources from
> which the pages were generated.
> 
> At this point, the patches are fairly robust and I am mainly hoping for
> help with verifying that the static site works as intended, that existing
> links will continue to work with the new site (essentially, find obscure
> references to the existing website, then insert `git.github.io/` in the
> URL and verify that it works as intended).
> 
> To that end, I deployed this branch to GitHub Pages so that anyone
> interested (hopefully many!) can have a look at
> https://git.github.io/git-scm.com/ and compare to the existing
> https://git-scm.com/.

When a transition to static pages happens, an important aspect is that
external links that point into git-scm.com must not be invalidated.
There are many such links in Stackoverflow answers, for example.

I checked one link:

https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt--r
https://git.github.io/git-scm.com/docs/git-rebase#Documentation/git-rebase.txt--r

and it is looking very good. Thank you! I assume that keeping links
working is not just a happy accident, but part of the plan.

-- Hannes


^ permalink raw reply

* Re: [PATCH v4] subtree: fix split processing with multiple subtrees present
From: Christian Couder @ 2023-11-18 11:28 UTC (permalink / raw)
  To: Zach FettersMoore via GitGitGadget; +Cc: git, Zach FettersMoore
In-Reply-To: <pull.1587.v4.git.1698347871200.gitgitgadget@gmail.com>

On Thu, Oct 26, 2023 at 9:18 PM Zach FettersMoore via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Zach FettersMoore <zach.fetters@apollographql.com>
>
> When there are multiple subtrees present in a repository and they are
> all using 'git subtree split', the 'split' command can take a
> significant (and constantly growing) amount of time to run even when
> using the '--rejoin' flag. This is due to the fact that when processing
> commits to determine the last known split to start from when looking
> for changes, if there has been a split/merge done from another subtree
> there will be 2 split commits, one mainline and one subtree, for the
> second subtree that are part of the processing. The non-mainline
> subtree split commit will cause the processing to always need to search
> the entire history of the given subtree as part of its processing even
> though those commits are totally irrelevant to the current subtree
> split being run.

Thanks for your continued work on this!

I am not familiar with git subtree so I might miss obvious things. On
the other hand, my comments might help increase a bit the number of
people who could review this patch.

> In the diagram below, 'M' represents the mainline repo branch, 'A'
> represents one subtree, and 'B' represents another. M3 and B1 represent
> a split commit for subtree B that was created from commit M4. M2 and A1
> represent a split commit made from subtree A that was also created
> based on changes back to and including M4. M1 represents new changes to
> the repo, in this scenario if you try to run a 'git subtree split
> --rejoin' for subtree B, commits M1, M2, and A1, will be included in
> the processing of changes for the new split commit since the last
> split/rejoin for subtree B was at M3. The issue is that by having A1
> included in this processing the command ends up needing to processing
> every commit down tree A even though none of that is needed or relevant
> to the current command and result.
>
> M1
>  |        \       \
> M2         |       |
>  |        A1       |
> M3         |       |
>  |         |      B1
> M4         |       |

About the above, Junio already commented the following:

-> The above paragraph explains which different things you drew in the
-> diagram are representing, but it is not clear how they relate to
-> each other.  Do they for example depict parent-child commit
-> relationship?  What are the wide gaps between these three tracks and
-> what are the short angled lines leaning to the left near the tip?
-> Is the time/topology flowing from bottom to top?

and it doesn't look like you have addressed that comment.

When you say "M3 and B1 represent a split commit for subtree B that
was created from commit M4." I am not sure what it means exactly.
Could you give example commands that could have created the M3 and B1
commits?

> So this commit makes a change to the processing of commits for the split
> command in order to ignore non-mainline commits from other subtrees such
> as A1 in the diagram by adding a new function
> 'should_ignore_subtree_commit' which is called during
> 'process_split_commit'. This allows the split/rejoin processing to still
> function as expected but removes all of the unnecessary processing that
> takes place currently which greatly inflates the processing time.

Could you tell a bit more what kind of processing time reduction is or
would be possible on what kind of repo? Have you benchmark-ed or just
timed this somehow on one of your repos or better on an open source
repo (so that we could reproduce if we wanted)?

> Added a test to validate that the proposed fix
> solves the issue.
>
> The test accomplishes this by checking the output
> of the split command to ensure the output from
> the progress of 'process_split_commit' function
> that represents the 'extracount' of commits
> processed does not increment.

Does not increment compared to what?

> This was tested against the original functionality
> to show the test failed, and then with this fix
> to show the test passes.
>
> This illustrated that when using multiple subtrees,
> A and B, when doing a split on subtree B, the
> processing does not traverse the entire history
> of subtree A which is unnecessary and would cause
> the 'extracount' of processed commits to climb
> based on the number of commits in the history of
> subtree A.

Does this mean that the test checks that the extracount is the same
when subtree A exists as when it doesn't exist?

[...]

>  contrib/subtree/git-subtree.sh     | 29 ++++++++++++++++++++-
>  contrib/subtree/t/t7900-subtree.sh | 42 ++++++++++++++++++++++++++++++
>  2 files changed, 70 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> index e0c5d3b0de6..e69991a9d80 100755
> --- a/contrib/subtree/git-subtree.sh
> +++ b/contrib/subtree/git-subtree.sh
> @@ -778,6 +778,20 @@ ensure_valid_ref_format () {
>                 die "fatal: '$1' does not look like a ref"
>  }
>
> +# Usage: check if a commit from another subtree should be
> +# ignored from processing for splits
> +should_ignore_subtree_split_commit () {

Maybe adding:

    assert test $# = 1
    local rev="$1"

here, and using $rev instead of $1 in this function could make things
a bit clearer and similar to what is done in other functions.

> +  if test -n "$(git log -1 --grep="git-subtree-dir:" $1)"
> +  then
> +    if test -z "$(git log -1 --grep="git-subtree-mainline:" $1)" &&
> +                       test -z "$(git log -1 --grep="git-subtree-dir: $arg_prefix$" $1)"
> +    then
> +      return 0
> +    fi
> +  fi
> +  return 1
> +}

The above doesn't seem to be properly indented. We use tabs not spaces.

>  # Usage: process_split_commit REV PARENTS
>  process_split_commit () {
>         assert test $# = 2
> @@ -963,7 +977,20 @@ cmd_split () {
>         eval "$grl" |
>         while read rev parents
>         do
> -               process_split_commit "$rev" "$parents"
> +               if should_ignore_subtree_split_commit "$rev"
> +               then
> +                       continue
> +               fi
> +               parsedParents=''

It seems to me that we name variables "parsed_parents" (or sometimes
"parsedparents") rather than "parsedParents".

> +               for parent in $parents
> +               do
> +                       should_ignore_subtree_split_commit "$parent"
> +                       if test $? -eq 1

I think the 2 lines above could be replaced by:

+                       if ! should_ignore_subtree_split_commit "$parent"

> +                       then
> +                               parsedParents+="$parent "

It doesn't seem to me that we use "+=" much in our shell scripts.
https://www.shellcheck.net/ emits the following:

(warning): In POSIX sh, += is undefined.

so I guess we don't use it because it's not available in some usual shells.

(I haven't checked the script with https://www.shellcheck.net/ before
and after your patch, but it might help avoid bash-isms and such
issues.)

> +                       fi
> +               done
> +               process_split_commit "$rev" "$parsedParents"
>         done || exit $?

It looks like we use "exit $?" a lot in git-subtree.sh while we use
just "exit" most often elsewhere. Not sure why.

>         latest_new=$(cache_get latest_new) || exit $?
> diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
> index 49a21dd7c9c..87d59afd761 100755
> --- a/contrib/subtree/t/t7900-subtree.sh
> +++ b/contrib/subtree/t/t7900-subtree.sh
> @@ -385,6 +385,48 @@ test_expect_success 'split sub dir/ with --rejoin' '
>         )
>  '
>
> +test_expect_success 'split with multiple subtrees' '
> +       subtree_test_create_repo "$test_count" &&
> +       subtree_test_create_repo "$test_count/subA" &&
> +       subtree_test_create_repo "$test_count/subB" &&
> +       test_create_commit "$test_count" main1 &&
> +       test_create_commit "$test_count/subA" subA1 &&
> +       test_create_commit "$test_count/subA" subA2 &&
> +       test_create_commit "$test_count/subA" subA3 &&
> +       test_create_commit "$test_count/subB" subB1 &&
> +       (
> +               cd "$test_count" &&
> +               git fetch ./subA HEAD &&
> +               git subtree add --prefix=subADir FETCH_HEAD
> +       ) &&
> +       (
> +               cd "$test_count" &&
> +               git fetch ./subB HEAD &&
> +               git subtree add --prefix=subBDir FETCH_HEAD
> +       ) &&
> +       test_create_commit "$test_count" subADir/main-subA1 &&
> +       test_create_commit "$test_count" subBDir/main-subB1 &&
> +       (
> +               cd "$test_count" &&
> +               git subtree split --prefix=subADir --squash --rejoin -m "Sub A Split 1"
> +       ) &&

Not sure why there are so many sub-shells used, and why the -C option
is not used instead to tell Git to work in a subdirectory. I guess you
copied what most existing (old) tests in this test script do.

For example perhaps the 4 line above could be replaced by just:

+               git -C "$test_count" subtree split --prefix=subADir
--squash --rejoin -m "Sub A Split 1" &&

> +       (
> +               cd "$test_count" &&
> +               git subtree split --prefix=subBDir --squash --rejoin -m "Sub B Split 1"
> +       ) &&
> +       test_create_commit "$test_count" subADir/main-subA2 &&
> +       test_create_commit "$test_count" subBDir/main-subB2 &&
> +       (
> +               cd "$test_count" &&
> +               git subtree split --prefix=subADir --squash --rejoin -m "Sub A Split 2"
> +       ) &&
> +       (
> +               cd "$test_count" &&
> +               test "$(git subtree split --prefix=subBDir --squash --rejoin \
> +                -d -m "Sub B Split 1" 2>&1 | grep -w "\[1\]")" = ""
> +       )
> +'

It's not clear to me what the test is doing. Maybe you could split it
into 2 tests. Perhaps one setting up a repo with multiple subtrees and
one checking that a new split ignores other subtree split commits.
Perhaps adding a few comments would help too.

Best,
Christian.

^ permalink raw reply

* Re: [PATCH] merge-file: add --diff-algorithm option
From: Phillip Wood @ 2023-11-19 16:42 UTC (permalink / raw)
  To: Antonin Delpeuch via GitGitGadget, git; +Cc: Antonin Delpeuch
In-Reply-To: <pull.1606.git.git.1699480494355.gitgitgadget@gmail.com>

Hi Antonin

On 08/11/2023 21:54, Antonin Delpeuch via GitGitGadget wrote:
> From: Antonin Delpeuch <antonin@delpeuch.eu>
> 
> This makes it possible to use other diff algorithms than the 'myers'
> default algorithm, when using the 'git merge-file' command.

I think being able to select the diff algorithm is reasonable. I might 
be nice to mention the use of "git merge-file" in custom merge drivers 
as a motivation in the commit message.

> Signed-off-by: Antonin Delpeuch <antonin@delpeuch.eu>
> ---
>      merge-file: add --diff-algorithm option
> 
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1606%2Fwetneb%2Fmerge_file_configurable_diff_algorithm-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1606/wetneb/merge_file_configurable_diff_algorithm-v1
> Pull-Request: https://github.com/git/git/pull/1606
> 
>   Documentation/git-merge-file.txt |  5 +++++
>   builtin/merge-file.c             | 28 ++++++++++++++++++++++++++++
>   2 files changed, 33 insertions(+)
> 
> diff --git a/Documentation/git-merge-file.txt b/Documentation/git-merge-file.txt
> index 6a081eacb72..917535217c1 100644
> --- a/Documentation/git-merge-file.txt
> +++ b/Documentation/git-merge-file.txt
> @@ -92,6 +92,11 @@ object store and the object ID of its blob is written to standard output.
>   	Instead of leaving conflicts in the file, resolve conflicts
>   	favouring our (or their or both) side of the lines.
>   
> +--diff-algorithm <algorithm>::
> +	Use a different diff algorithm while merging, which can help
> +	avoid mismerges that occur due to unimportant matching lines
> +	(such as braces from distinct functions).  See also
> +	linkgit:git-diff[1] `--diff-algorithm`.

Perhaps we could list the available algorithms here so the user does not 
have to go searching for them in another man page.

>   EXAMPLES
>   --------
> diff --git a/builtin/merge-file.c b/builtin/merge-file.c
> index 832c93d8d54..1f987334a31 100644
> --- a/builtin/merge-file.c
> +++ b/builtin/merge-file.c
> @@ -1,5 +1,6 @@
>   #include "builtin.h"
>   #include "abspath.h"
> +#include "diff.h"
>   #include "hex.h"
>   #include "object-name.h"
>   #include "object-store.h"
> @@ -28,6 +29,30 @@ static int label_cb(const struct option *opt, const char *arg, int unset)
>   	return 0;
>   }
>   
> +static int set_diff_algorithm(xpparam_t *xpp,
> +			      const char *alg)
> +{
> +	long diff_algorithm = parse_algorithm_value(alg);
> +	if (diff_algorithm < 0)
> +		return -1;
> +	xpp->flags = (xpp->flags & ~XDF_DIFF_ALGORITHM_MASK) | diff_algorithm;
> +	return 0;
> +}
> +
> +static int diff_algorithm_cb(const struct option *opt,
> +				const char *arg, int unset)
> +{
> +	xpparam_t *xpp = opt->value;
> +
> +	BUG_ON_OPT_NEG(unset);
> +
> +	if (set_diff_algorithm(xpp, arg))
> +		return error(_("option diff-algorithm accepts \"myers\", "
> +			       "\"minimal\", \"patience\" and \"histogram\""));
> +
> +	return 0;
> +}
> +
>   int cmd_merge_file(int argc, const char **argv, const char *prefix)
>   {
>   	const char *names[3] = { 0 };
> @@ -48,6 +73,9 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
>   			    XDL_MERGE_FAVOR_THEIRS),
>   		OPT_SET_INT(0, "union", &xmp.favor, N_("for conflicts, use a union version"),
>   			    XDL_MERGE_FAVOR_UNION),
> +		OPT_CALLBACK_F(0, "diff-algorithm", &xmp.xpp, N_("<algorithm>"),
> +			     N_("choose a diff algorithm"),
> +			     PARSE_OPT_NONEG, diff_algorithm_cb),
>   		OPT_INTEGER(0, "marker-size", &xmp.marker_size,
>   			    N_("for conflicts, use this marker size")),
>   		OPT__QUIET(&quiet, N_("do not warn about conflicts")),

This patch looks sensible to me, it would be nice to have some tests though.

Best Wishes

Phillip

> base-commit: 98009afd24e2304bf923a64750340423473809ff

^ permalink raw reply

* Re: [PATCH] merge-file: add --diff-algorithm option
From: Phillip Wood @ 2023-11-19 16:43 UTC (permalink / raw)
  To: Antonin Delpeuch, git; +Cc: Elijah Newren
In-Reply-To: <653b08fd-2df3-4a7a-8082-fdb809e87784@delpeuch.eu>

Hi Antonin

On 17/11/2023 21:42, Antonin Delpeuch wrote:
> Hi all,
> 
> Here a few more thoughts about this patch, to explain what brought me to 
> needing that. If this need is misguided, perhaps you could redirect me 
> to a better solution.
> 
> I am writing a custom merge driver for Java files. This merge driver 
> internally calls git-merge-file and then solves the merge conflicts 
> which only consist of import statements (there might be cases where it 
> gets it wrong, but I can then use other tools to cleanup those import 
> statements). When testing this, I noticed that the merge driver 
> performed more poorly on other sorts of conflicts, compared to the 
> standard "ort" merge strategy. This is because "ort" uses the 
> "histogram" diff algorithm, which gives better results than the "myers" 
> diff algorithm that merge-file uses.

I cannot comment on this particular use but I think in general calling 
"git merge-file" from a custom merge driver is perfectly sensible. Have 
you tested your driver with this patch to see if you get better results 
with the histogram diff algorithm?

> Intuitively, if "histogram" is the default diff algorithm used by "git 
> merge", then it would also make sense to have the same default for "git 
> merge-file", but I assume that changing this default could be considered 
> a bad breaking change. So I thought that making this diff algorithm 
> configurable would be an acceptable move, hence my patch.

I can see there's an argument for changing the default algorithm of "git 
merge-file" to match what "ort" uses. I know Elijah found the histogram 
algorithm gave better results in his testing when he was developing 
"ort". While it would be a breaking change if on the average the new 
default gives better conflicts it might be worth it. This patch would 
mean that someone wanting to use the "myers" algorithm could still do so.

> Of course, the diffing could be configured in other ways, for instance 
> with its handling of whitespace or EOL (similarly to what the "git-diff" 
> command offers). I think those options would definitely be worth 
> exposing in merge-file as well. If you think this makes sense, then I 
> would be happy to work on a new version of this patch which would 
> attempt to include all the relevant options. I could also try to add the 
> corresponding tests.

It would be nice to see some tests for this patch, ideally using a test 
case that gives different conflicts for "myers" and "histogram". We 
could add the other options later if there is a demand.

Best Wishes

Phillip

> But perhaps my need is misguided? Could it be that I should not be 
> writing a custom merge driver, but instead use another extension point 
> to only process the conflicting hunks after execution of the existing 
> merge driver? I couldn't find such an extension point, but it can well 
> be that I missed it.
> 
> Thank you,
> 
> Antonin
> 
> 

^ permalink raw reply

* Re: [PATCH] merge-file: add --diff-algorithm option
From: Antonin Delpeuch @ 2023-11-19 19:29 UTC (permalink / raw)
  To: phillip.wood, git; +Cc: Elijah Newren
In-Reply-To: <de04aec0-a195-45da-8951-bb30f2a629a3@gmail.com>

Hi Phillip,

Thank you so much for taking the time to review this!

On 19/11/2023 17:43, Phillip Wood wrote:
> I cannot comment on this particular use but I think in general calling 
> "git merge-file" from a custom merge driver is perfectly sensible. 
> Have you tested your driver with this patch to see if you get better 
> results with the histogram diff algorithm?

Yes, I can confirm that the results are better in my use case indeed.

> I can see there's an argument for changing the default algorithm of 
> "git merge-file" to match what "ort" uses. I know Elijah found the 
> histogram algorithm gave better results in his testing when he was 
> developing "ort". While it would be a breaking change if on the 
> average the new default gives better conflicts it might be worth it. 
> This patch would mean that someone wanting to use the "myers" 
> algorithm could still do so.

Agreed. I would be happy to submit a follow-up patch to change the 
default. Or would you prefer to have it in the same patch (as a separate 
commit)? I was worried this would make my patch less likely to get merged.

> It would be nice to see some tests for this patch, ideally using a 
> test case that gives different conflicts for "myers" and "histogram". 
> We could add the other options later if there is a demand.

Will do.

> Perhaps we could list the available algorithms here so the user does 
> not have to go searching for them in another man page.

This part is copied from "Documentation/merge-strategies.txt", which 
redirects to the manual for git-diff in the same way. I assume it was 
done so that whenever a new diff algorithm is introduced, it only needs 
documenting in one place. But I agree it is definitely more 
user-friendly to list the algorithms directly. Should I change the 
documentation of merge strategies in the same way?

Best wishes,

Antonin


^ permalink raw reply

* Re: [PATCH] Fix a typo in `each_file_in_pack_dir_fn()`'s declaration
From: Junio C Hamano @ 2023-11-19 23:15 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin
In-Reply-To: <pull.1614.git.1700226915859.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> Subject: Re: [PATCH] Fix a typo in `each_file_in_pack_dir_fn()`'s declaration

Let's have "packfile.[ch]: " before the title to tell what area the
helper function is about.

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> One parameter is called `file_pach`. On the face of it, this looks as if
> it was supposed to talk about a `path` instead of a `pach`.
>
> However, looking at the way this callback is called, it gets fed the
> `d_name` from a directory entry, which provides just the file name, not
> the full path. Therefore, let's fix this by calling the parameter
> `file_name` instead.
>  ...
>  typedef void each_file_in_pack_dir_fn(const char *full_path, size_t full_path_len,
> -				      const char *file_pach, void *data);
> +				      const char *file_name, void *data);

Very good observation.  We form a pathname to a file in a
"objects/pack/" subdirectory by concatenating this parameter after
the full_path/full_path_len parameter, which has the path to that
subdirectory, so "file_name" definitely is a much better name.

The "full_path" that does not say full path to what directory may
have room for improvement ("leading_path" or even "packdir"), but
that's OK.

Thanks for spotting.

>  void for_each_file_in_pack_dir(const char *objdir,
>  			       each_file_in_pack_dir_fn fn,
>  			       void *data);
>
> base-commit: cfb8a6e9a93adbe81efca66e6110c9b4d2e57169

^ permalink raw reply

* Re: [PATCH] setup: recognize bare repositories with packed-refs
From: Junio C Hamano @ 2023-11-19 23:24 UTC (permalink / raw)
  To: Glen Choo, Josh Steadmon; +Cc: git, Adam Majer
In-Reply-To: <20231117203253.21143-1-adamm@zombino.com>

Adam Majer <adamm@zombino.com> writes:

> In a garbage collected bare git repository, the refs/ subdirectory is
> empty.  In use-cases when such a repository is directly added into
> another repository, it no longer is detected as valid.

Josh & Glen [*], isn't this a layout that we  explicitly discourage and
eventually plan to forbid anyway?

*1* who worked on e35f202b (setup: trace bare repository setups, 2023-05-01)

^ permalink raw reply

* Re: [PATCH] merge-file: add --diff-algorithm option
From: Junio C Hamano @ 2023-11-19 23:30 UTC (permalink / raw)
  To: Phillip Wood; +Cc: Antonin Delpeuch, git, Elijah Newren
In-Reply-To: <de04aec0-a195-45da-8951-bb30f2a629a3@gmail.com>

Phillip Wood <phillip.wood123@gmail.com> writes:

> I can see there's an argument for changing the default algorithm of
> "git merge-file" to match what "ort" uses. I know Elijah found the
> histogram algorithm gave better results in his testing when he was
> developing "ort". While it would be a breaking change if on the
> average the new default gives better conflicts it might be worth
> it. This patch would mean that someone wanting to use the "myers"
> algorithm could still do so.

Sounds like a sensible thing to do.  First allow to configure the
custom algorithm from the command line option (and optionally via a
configuration variable) and ship it in a release, start giving a
warning if the using script did not specify the configuration or the
command line option and used the current default and ship it in the
next release, wait for a few releases and then finally flip the
default, or something like that.

Thanks.

^ permalink raw reply

* [GIT PULL] l10n updates for 2.43.0 round 2
From: Jiang Xin @ 2023-11-20  0:13 UTC (permalink / raw)
  To: Junio C Hamano, Git l10n discussion group, Alexander Shopov,
	Arkadii Yakovets, Bagas Sanjaya, Emir SARI, Jean-Noël Avila,
	Jiang Xin, Jordi Mas, Peter Krefting, Ralf Thielow, Teng Long,
	Yi-Jyun Pan
  Cc: Git List

Hi Junio,

Please pull the following l10n updates for Git 2.43.0.

The following changes since commit cfb8a6e9a93adbe81efca66e6110c9b4d2e57169:

  Git 2.43-rc2 (2023-11-14 15:14:45 +0900)

are available in the Git repository at:

  git@github.com:git-l10n/git-po.git tags/l10n-2.43.0-rnd2

for you to fetch changes up to d30343266793525abd82c15fcb246d892f474d92:

  Merge branch 'l10n/zh-TW/2023-11-19' of github.com:l10n-tw/git-po (2023-11-20 07:57:09 +0800)

----------------------------------------------------------------
l10n-2.43.0-rnd2
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE37vMEzKDqYvVxs51k24VDd1FMtUFAmVaodkACgkQk24VDd1F
MtUXAxAAqkzi6QOAXCdCFylSP/zSHGoOdY1zpOZxKcQbfmfY6FBUVAW31c3nCg6h
7OIXmreS2sMY+nIhvowSQO/Azn7Ka/kglB3MaOu5EcfO9SEbAGmT4JtvDOSLdUZS
kZytWwvFY83l3aJGCPmz5FDc6upo3v9b2aSrbiYv3o7A+r3YSwTtLqKeoXZnRyg9
ACh2fq2PVJV/LkPXbbg6xcwsiKSOL71hUBH/OfZrPuEIXQUJZXgUQySopu2R4HX2
UPyP2uhg5XncoN4oCgkFTX/tO+lIzdnREzCVQGlmHI4v0WFOIPKP9bgMQHi4qRi7
SMwCW+su8vFPCucNgeM8xh6NYg7UBCR3RXq8tRw7WCct3Hz3FHVS5HI/zCg/lCD8
4YS3CcCokGggif4ONV0qrQQih3QXv4mwmtzGy7y6t+4Qi0XKV17yJb5d6Es+/7YT
/CTM3JQNguiejNzNjrvMg6LOBBYr32dULnH8+E8ZYaG8wZY4ZI8gwR4p0BUNvE6K
Sxa+/2sdskaNL+h4vhT+dq3skDqxfy2gLc6UavTLkxwEzRLMlqD9h4SbXyJKl2ur
VH7A/KoypdrMoRcYeDtM00kMONxQmVXhLWE0PHdUIHnj3Bt4skMWEJCI5Xc5oQIE
uoNUYDhs9mDbQybJU/1Sak7f5C0qwqMjp5QczyTWgEGrUdqnPLs=
=XEYO
-----END PGP SIGNATURE-----

----------------------------------------------------------------
Alexander Shopov (1):
      l10n: bg.po: Updated Bulgarian translation (5579t)

Arkadii Yakovets (1):
      l10n: update uk localization for v2.43

Bagas Sanjaya (1):
      l10n: po-id for 2.43 (round 1)

Emir SARI (1):
      l10n: tr: v2.43.0

Jean-Noël Avila (1):
      l10n: fr: v2.43.0 rnd 2

Jiang Xin (8):
      Merge branch 'master' of github.com:nafmo/git-l10n-sv
      Merge branch 'po-id' of github.com:bagasme/git-po
      Merge branch 'fr_v2.43.0' of github.com:jnavila/git
      Merge branch 'tr-l10n' of github.com:bitigchi/git-po
      Merge branch 'catalan' of github.com:Softcatala/git-po
      Merge branch '2.43-uk-update' of github.com:arkid15r
      Merge branch 'master' of github.com:alshopov/git-po
      Merge branch 'l10n/zh-TW/2023-11-19' of github.com:l10n-tw/git-po

Jordi Mas (1):
      l10n: Update Catalan translation

Peter Krefting (1):
      l10n: sv.po: Update Swedish translation (5579t)

Ralf Thielow (1):
      l10n: Update German translation

Teng Long (1):
      l10n: zh_CN: for git 2.43.0-rc1

Yi-Jyun Pan (1):
      l10n: zh-TW: Git 2.43.0-rc1

 po/bg.po    | 1448 ++++++++++++++----------
 po/ca.po    |  691 +++++++-----
 po/de.po    |  571 ++++++----
 po/fr.po    |  640 +++++++----
 po/id.po    |  674 ++++++-----
 po/sv.po    | 3569 ++++++++++++++++++++++++++++++-----------------------------
 po/tr.po    |  529 +++++----
 po/uk.po    |  625 ++++++-----
 po/zh_CN.po |  602 ++++++----
 po/zh_TW.po | 1116 +++++++------------
 10 files changed, 5712 insertions(+), 4753 deletions(-)

--
Jiang Xin

^ permalink raw reply

* Re: [GIT PULL] l10n updates for 2.43.0 round 2
From: Junio C Hamano @ 2023-11-20  1:29 UTC (permalink / raw)
  To: Jiang Xin
  Cc: Git l10n discussion group, Alexander Shopov, Arkadii Yakovets,
	Bagas Sanjaya, Emir SARI, Jean-Noël Avila, Jordi Mas,
	Peter Krefting, Ralf Thielow, Teng Long, Yi-Jyun Pan, Git List
In-Reply-To: <20231120001309.24434-1-worldhello.net@gmail.com>

Jiang Xin <worldhello.net@gmail.com> writes:

> Hi Junio,
>
> Please pull the following l10n updates for Git 2.43.0.
>
> The following changes since commit cfb8a6e9a93adbe81efca66e6110c9b4d2e57169:
>
>   Git 2.43-rc2 (2023-11-14 15:14:45 +0900)
>
> are available in the Git repository at:
>
>   git@github.com:git-l10n/git-po.git tags/l10n-2.43.0-rnd2
>
> for you to fetch changes up to d30343266793525abd82c15fcb246d892f474d92:
>
>   Merge branch 'l10n/zh-TW/2023-11-19' of github.com:l10n-tw/git-po (2023-11-20 07:57:09 +0800)

Thanks.  Will do.

^ permalink raw reply

* Re: bugreport
From: Thomas Guyot @ 2023-11-20  8:36 UTC (permalink / raw)
  To: galo joel, git
In-Reply-To: <CAKh3n_qqMiJL-Mn2MxBmG5MRL36w+v-kxjqb8wUv1i7KOEVaDw@mail.gmail.com>


Hi Joel,

I'm copying your attachment in-line for simplicity...

On 2023-10-24 16:40, galo joel wrote:
> Please answer the following questions to help us understand your issue.
>
> What did you do before the bug happened? (Steps to reproduce your issue)
>
> execute as admin git bash and,(in cmd W10, same. open git-bash.exe as system-32).
> try chmod 755, 777... does not work 'cause im user ($) and not admin (#)
>
> Wha did you expect to happen? (Expected behavior)
>
> change .sh to chmod 755 for execute bash
>
> What happened instead? (Actual behavior)
>
> nothing ._.
>
> What's different between what you expected and what actually happened?
>
> i expected a good sript in bash. now i'm sad
>
> Anything else you want to add:
>
> Please tell me what happen, maybe i'm wrong but chatGPT also no have idea why
> i cannot be admin in my own laptop xD, or maybe i need some libraries that i didnot
> install. I sell all my information so please help me to understand why does not work :)
>
> Please review the rest of the bug report below.
> You can delete any lines you don't wish to share.
>
>
> [System Info]
> git version:
> git version 2.42.0.windows.2
> cpu: x86_64
> built from commit: 2f819d1670fff9a1818f63b6722e9959405378e3
> sizeof-long: 4
> sizeof-size_t: 8
> shell-path: /bin/sh
> feature: fsmonitor--daemon
> uname: Windows 10.0 19045
> compiler info: gnuc: 13.2
> libc info: no libc information available
> $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe
>
>
> [Enabled Hooks]
> not run from a git repository - no hooks to show
>

You don't need admin to use git on Window. OTOH Windows has no concept 
of POSIX file permissions, and this is the reason you cannot set file 
permissions using chmod under git bash.

This Stackoverflow question has the answer you're most likely looking for:

https://stackoverflow.com/questions/21691202/how-to-create-file-execute-mode-permissions-in-git-on-windows

Regards,

--

Thomas

^ permalink raw reply

* Re: [PATCH] setup: recognize bare repositories with packed-refs
From: Glen Choo @ 2023-11-20  9:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Josh Steadmon, git, Adam Majer
In-Reply-To: <xmqqbkbppbrd.fsf@gitster.g>

On Mon, Nov 20, 2023 at 7:24 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Adam Majer <adamm@zombino.com> writes:
>
> > In a garbage collected bare git repository, the refs/ subdirectory is
> > empty.  In use-cases when such a repository is directly added into
> > another repository, it no longer is detected as valid.
>
> Josh & Glen [*], isn't this a layout that we  explicitly discourage and
> eventually plan to forbid anyway?

If my recollection of [1] serves me correctly, we didn't come to a
strong conclusion on whether or not to forbid bare repositories in the
working tree, particularly because it would leave existing repos (like
Git LFS) high and dry. Though personally, I'd be happy to see a
version of Git that forbade bare repositories in the working tree.

I don't really recall the bare repo tracing bits, so I'll leave that to Josh.

[1] https://lore.kernel.org/git/kl6lsfqpygsj.fsf@chooglen-macbookpro.roam.corp.google.com/

^ permalink raw reply

* Re: [PATCH] setup: recognize bare repositories with packed-refs
From: Adam Majer @ 2023-11-20  9:43 UTC (permalink / raw)
  To: Junio C Hamano, Glen Choo, Josh Steadmon; +Cc: git
In-Reply-To: <xmqqbkbppbrd.fsf@gitster.g>

On 11/20/23 00:24, Junio C Hamano wrote:
> Adam Majer <adamm@zombino.com> writes:
> 
>> In a garbage collected bare git repository, the refs/ subdirectory is
>> empty.  In use-cases when such a repository is directly added into
>> another repository, it no longer is detected as valid.
> 
> Josh & Glen [*], isn't this a layout that we  explicitly discourage and
> eventually plan to forbid anyway?
> 
> *1* who worked on e35f202b (setup: trace bare repository setups, 2023-05-01)

This is fair enough. Completely removing embedded git repos would cause 
some pain in test suites as it was discussed in the thread for that 
commit[1]. Gitea (for example) has a few dozen embedded bare 
repositories for tests.

In either case, running `git gc` on a bare repository makes it no longer 
detectable as a git repository after checkout, GIT_DIR or not. This 
seems to be unintentional and not linked to the other discussion.

- Adam

^ permalink raw reply

* [PATCH v2] commit-graph: disable GIT_COMMIT_GRAPH_PARANOIA by default
From: Patrick Steinhardt @ 2023-11-20 11:01 UTC (permalink / raw)
  To: git; +Cc: Taylor Blau, Jeff King, Junio C Hamano
In-Reply-To: <7e2d300c4af9a7853201121d66f982afa421bbba.1699957350.git.ps@pks.im>

[-- Attachment #1: Type: text/plain, Size: 8228 bytes --]

In 7a5d604443 (commit: detect commits that exist in commit-graph but not
in the ODB, 2023-10-31), we have introduced a new object existence check
into `repo_parse_commit_internal()` so that we do not parse commits via
the commit-graph that don't have a corresponding object in the object
database. This new check of course comes with a performance penalty,
which the commit put at around 30% for `git rev-list --topo-order`. But
there are in fact scenarios where the performance regression is even
higher. The following benchmark against linux.git with a fully-build
commit-graph:

  Benchmark 1: git.v2.42.1 rev-list --count HEAD
    Time (mean ± σ):     658.0 ms ±   5.2 ms    [User: 613.5 ms, System: 44.4 ms]
    Range (min … max):   650.2 ms … 666.0 ms    10 runs

  Benchmark 2: git.v2.43.0-rc1 rev-list --count HEAD
    Time (mean ± σ):      1.333 s ±  0.019 s    [User: 1.263 s, System: 0.069 s]
    Range (min … max):    1.302 s …  1.361 s    10 runs

  Summary
    git.v2.42.1 rev-list --count HEAD ran
      2.03 ± 0.03 times faster than git.v2.43.0-rc1 rev-list --count HEAD

While it's a noble goal to ensure that results are the same regardless
of whether or not we have a potentially stale commit-graph, taking twice
as much time is a tough sell. Furthermore, we can generally assume that
the commit-graph will be updated by git-gc(1) or git-maintenance(1) as
required so that the case where the commit-graph is stale should not at
all be common.

With that in mind, default-disable GIT_COMMIT_GRAPH_PARANOIA and restore
the behaviour and thus performance previous to the mentioned commit. In
order to not be inconsistent, also disable this behaviour by default in
`lookup_commit_in_graph()`, where the object existence check has been
introduced right at its inception via f559d6d45e (revision: avoid
hitting packfiles when commits are in commit-graph, 2021-08-09).

This results in another speedup in commands that end up calling this
function, even though it's less pronounced compared to the above
benchmark. The following has been executed in linux.git with ~1.2
million references:

  Benchmark 1: GIT_COMMIT_GRAPH_PARANOIA=true git rev-list --all --no-walk=unsorted
    Time (mean ± σ):      2.947 s ±  0.003 s    [User: 2.412 s, System: 0.534 s]
    Range (min … max):    2.943 s …  2.949 s    3 runs

  Benchmark 2: GIT_COMMIT_GRAPH_PARANOIA=false git rev-list --all --no-walk=unsorted
    Time (mean ± σ):      2.724 s ±  0.030 s    [User: 2.207 s, System: 0.514 s]
    Range (min … max):    2.704 s …  2.759 s    3 runs

  Summary
    GIT_COMMIT_GRAPH_PARANOIA=false git rev-list --all --no-walk=unsorted ran
      1.08 ± 0.01 times faster than GIT_COMMIT_GRAPH_PARANOIA=true git rev-list --all --no-walk=unsorted

So whereas 7a5d604443 initially introduced the logic to start doing an
object existence check in `repo_parse_commit_internal()` by default, the
updated logic will now instead cause `lookup_commit_in_graph()` to stop
doing the check by default. This behaviour continues to be tweakable by
the user via the GIT_COMMIT_GRAPH_PARANOIA environment variable.

Note that this requires us to amend some tests to manually turn on the
paranoid checks again. This is because we cause repository corruption by
manually deleting objects which are part of the commit graph already.
These circumstances shouldn't usually happen in repositories.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 Documentation/git.txt       | 6 +++---
 commit-graph.c              | 2 +-
 commit.c                    | 2 +-
 t/t5318-commit-graph.sh     | 8 ++++----
 t/t6022-rev-list-missing.sh | 5 +++++
 t/t7700-repack.sh           | 2 +-
 6 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/Documentation/git.txt b/Documentation/git.txt
index 2535a30194..6c19fd1d76 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -917,9 +917,9 @@ for full details.
 	avoid issues with stale commit-graphs that contain references to
 	already-deleted commits, but comes with a performance penalty.
 +
-The default is "true", which enables the aforementioned behavior.
-Setting this to "false" disables the existence check. This can lead to
-a performance improvement at the cost of consistency.
+The default is "false", which disables the aforementioned behavior.
+Setting this to "true" enables the existence check so that stale commits
+will never be returned from the commit-graph at the cost of performance.
 
 `GIT_ALLOW_PROTOCOL`::
 	If set to a colon-separated list of protocols, behave as if
diff --git a/commit-graph.c b/commit-graph.c
index acac9bf6e1..6fad9d195d 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1005,7 +1005,7 @@ struct commit *lookup_commit_in_graph(struct repository *repo, const struct obje
 	uint32_t pos;
 
 	if (commit_graph_paranoia == -1)
-		commit_graph_paranoia = git_env_bool(GIT_COMMIT_GRAPH_PARANOIA, 1);
+		commit_graph_paranoia = git_env_bool(GIT_COMMIT_GRAPH_PARANOIA, 0);
 
 	if (!prepare_commit_graph(repo))
 		return NULL;
diff --git a/commit.c b/commit.c
index 8405d7c3fc..37956b836c 100644
--- a/commit.c
+++ b/commit.c
@@ -577,7 +577,7 @@ int repo_parse_commit_internal(struct repository *r,
 		static int commit_graph_paranoia = -1;
 
 		if (commit_graph_paranoia == -1)
-			commit_graph_paranoia = git_env_bool(GIT_COMMIT_GRAPH_PARANOIA, 1);
+			commit_graph_paranoia = git_env_bool(GIT_COMMIT_GRAPH_PARANOIA, 0);
 
 		if (commit_graph_paranoia && !has_object(r, &item->object.oid, 0)) {
 			unparse_commit(r, &item->object.oid);
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 7fe7c72a87..a2b4442660 100755
--- a/t/t5318-commit-graph.sh
+++ b/t/t5318-commit-graph.sh
@@ -911,10 +911,10 @@ test_expect_success 'stale commit cannot be parsed when given directly' '
 
 		# Verify that it is possible to read the commit from the
 		# commit graph when not being paranoid, ...
-		GIT_COMMIT_GRAPH_PARANOIA=false git rev-list B &&
+		git rev-list B &&
 		# ... but parsing the commit when double checking that
 		# it actually exists in the object database should fail.
-		test_must_fail git rev-list -1 B
+		test_must_fail env GIT_COMMIT_GRAPH_PARANOIA=true git rev-list -1 B
 	)
 '
 
@@ -938,9 +938,9 @@ test_expect_success 'stale commit cannot be parsed when traversing graph' '
 
 		# Again, we should be able to parse the commit when not
 		# being paranoid about commit graph staleness...
-		GIT_COMMIT_GRAPH_PARANOIA=false git rev-parse HEAD~2 &&
+		git rev-parse HEAD~2 &&
 		# ... but fail when we are paranoid.
-		test_must_fail git rev-parse HEAD~2 2>error &&
+		test_must_fail env GIT_COMMIT_GRAPH_PARANOIA=true git rev-parse HEAD~2 2>error &&
 		grep "error: commit $oid exists in commit-graph but not in the object database" error
 	)
 '
diff --git a/t/t6022-rev-list-missing.sh b/t/t6022-rev-list-missing.sh
index 40265a4f66..1ca4eb5a36 100755
--- a/t/t6022-rev-list-missing.sh
+++ b/t/t6022-rev-list-missing.sh
@@ -13,6 +13,11 @@ test_expect_success 'create repository and alternate directory' '
 	test_commit 3
 '
 
+# We manually corrupt the repository, which means that the commit-graph may
+# contain references to already-deleted objects. We thus need to enable
+# commit-graph paranoia to not returned these deleted commits from the graph.
+export GIT_COMMIT_GRAPH_PARANOIA=true
+
 for obj in "HEAD~1" "HEAD~1^{tree}" "HEAD:1.t"
 do
 	test_expect_success "rev-list --missing=error fails with missing object $obj" '
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index d2975e6c93..94f9f4a1da 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -271,7 +271,7 @@ test_expect_success 'repacking fails when missing .pack actually means missing o
 		ls .git/objects/pack/*.pack >before-pack-dir &&
 
 		test_must_fail git fsck &&
-		test_must_fail git repack --cruft -d 2>err &&
+		test_must_fail env GIT_COMMIT_GRAPH_PARANOIA=true git repack --cruft -d 2>err &&
 		grep "bad object" err &&
 
 		# Before failing, the repack did not modify the
-- 
2.42.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related

* [PATCH] object-name: reject too-deep recursive ancestor queries
From: Taylor Blau @ 2023-11-20 16:13 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Patrick Steinhardt, Junio C Hamano,
	Carlos Andrés Ramírez Cataño

When trying to resolve a revision query like "HEAD~~~~~", our call
pattern looks something like:

  - object-name.c::get_oid_with_context()
  - object-name.c::get_oid_1()
  - object-name.c::get_nth_ancestor()
  - object-name.c::get_oid_1()
  - ...

With `get_nth_ancestor()` and `get_oid_1()` mutually recurring, popping
one '~' off of the revision query for each round of the recursion.

Since this recursive behavior is unbounded, having too many "~"'s
contained in a revision query will cause us to blow the stack.
Generating a message like this when compiled under SANITIZE=address:

    $ valgrind git rev-parse "HEAD$(perl -e "print \"~\" x 1000000000000")"
    ==597453== Memcheck, a memory error detector
    ==597453== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
    ==597453== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
    ==597453== Command: /home/ttaylorr/local/bin/git.compile diff HEAD~~~~~~~~~~~~[...]
    ==597453==
    AddressSanitizer:DEADLYSIGNAL
    =================================================================
    ==597453==ERROR: AddressSanitizer: stack-overflow on address 0x7fffdd838ff8 (pc 0x7f2726082748 bp 0x7fffdd839110 sp 0x7fffdd839000 T0)
        #0 0x7f2726082748 in __asan::GetTLSFakeStack() ../../../../src/libsanitizer/asan/asan_fake_stack.cpp:176
        #1 0x7f2726082748 in GetFakeStackFast ../../../../src/libsanitizer/asan/asan_fake_stack.cpp:193
        #2 0x7f27260833de in OnMalloc ../../../../src/libsanitizer/asan/asan_fake_stack.cpp:207
        #3 0x7f27260833de in __asan_stack_malloc_1 ../../../../src/libsanitizer/asan/asan_fake_stack.cpp:256
        #4 0x563f9077d9d8 in get_nth_ancestor /home/ttaylorr/src/git/object-name.c:1087
        #5 0x563f9077e957 in get_oid_1 /home/ttaylorr/src/git/object-name.c:1295
        #6 0x563f9077da64 in get_nth_ancestor /home/ttaylorr/src/git/object-name.c:1092
        #7 0x563f9077e957 in get_oid_1 /home/ttaylorr/src/git/object-name.c:1295
        #8 0x563f9077da64 in get_nth_ancestor /home/ttaylorr/src/git/object-name.c:1092
        [...]
        #247 0x563f9077e957 in get_oid_1 /home/ttaylorr/src/git/object-name.c:1295
        #248 0x563f9077da64 in get_nth_ancestor /home/ttaylorr/src/git/object-name.c:1092

    SUMMARY: AddressSanitizer: stack-overflow ../../../../src/libsanitizer/asan/asan_fake_stack.cpp:176 in __asan::GetTLSFakeStack()
    ==597453==ABORTING

(Note that the actual stack is much deeper. GDB reports that the bottom
of the stack looks something like the following):

    #54866 0x0000555555c6d3bf in get_oid_with_context_1 (repo=0x5555563849a0 <the_repo>, name=0x7fffffff4be5 "HEAD", '~' <repeats 196 times>..., flags=128, prefix=0x0, oid=0x7ffff5713d40, oc=0x7ffff5713d90) at object-name.c:1947
    #54867 0x0000555555c6e2fa in get_oid_with_context (repo=0x5555563849a0 <the_repo>, str=0x7fffffff4be5 "HEAD", '~' <repeats 196 times>..., flags=128, oid=0x7ffff5713d40, oc=0x7ffff5713d90) at object-name.c:2096
    #54868 0x0000555555d8eed8 in handle_revision_arg_1 (arg_=0x7fffffff4be5 "HEAD", '~' <repeats 196 times>..., revs=0x7ffff5b000d0, flags=0, revarg_opt=0) at revision.c:2174
    #54869 0x0000555555d8f1a9 in handle_revision_arg (arg=0x7fffffff4be5 "HEAD", '~' <repeats 196 times>..., revs=0x7ffff5b000d0, flags=0, revarg_opt=0) at revision.c:2189
    #54870 0x0000555555d97ca9 in setup_revisions (argc=2, argv=0x7fffffff4970, revs=0x7ffff5b000d0, opt=0x0) at revision.c:2932
    #54871 0x00005555557d6a63 in cmd_diff (argc=2, argv=0x7fffffff4970, prefix=0x0) at builtin/diff.c:502
    #54872 0x00005555557367bf in run_builtin (p=0x5555561c4c30 <commands+816>, argc=2, argv=0x7fffffff4970) at git.c:469
    #54873 0x000055555573716b in handle_builtin (argc=2, argv=0x7fffffff4970) at git.c:723
    #54874 0x000055555573785a in run_argv (argcp=0x7ffff56028b0, argv=0x7ffff56028e0) at git.c:787
    #54875 0x0000555555738626 in cmd_main (argc=2, argv=0x7fffffff4970) at git.c:922
    #54876 0x00005555559d3fdd in main (argc=3, argv=0x7fffffff4968) at common-main.c:62

Fortunately, we can impose a limit on the maximum recursion depth we're
willing to accept when resolving queries like the above without
significantly impeding users. This patch sets the limit at 4096, though
we could probably increase that limit depending on the size of each
frame.

The limit introduced here is large enough that any reasonable query
should still run to completion, but small enough that if the frame size
were to significantly increase, our protection would still be effective.

The change here is straightforward: each call to get_nth_ancestor()
increases a counter, and then decrements that counter before returning.

The diff is a little noisy since there are a handful of return paths
from `get_nth_ancestor()`, all of which need to decrement the depth
variable.

Since this is a local-only exploit, a user would have to be tricked into
running such a query by an adversary. Even if they were successfully
tricked into running the malicious query, the blast radius is limited to
a local stack overflow, which does not have meaningful paths to remote
code execution, arbitrary memory reads, or any more grave security
concerns.

Reported-by: Carlos Andrés Ramírez Cataño <antaigroupltda@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 object-name.c                  | 26 ++++++++++++++++++++------
 t/t1506-rev-parse-diagnosis.sh |  5 +++++
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/object-name.c b/object-name.c
index 0bfa29dbbf..675e0a759e 100644
--- a/object-name.c
+++ b/object-name.c
@@ -1080,6 +1080,9 @@ static enum get_oid_result get_parent(struct repository *r,
 	return MISSING_OBJECT;
 }
 
+static int get_nth_ancestor_max_depth = 4096;
+static int get_nth_ancestor_curr_depth;
+
 static enum get_oid_result get_nth_ancestor(struct repository *r,
 					    const char *name, int len,
 					    struct object_id *result,
@@ -1089,20 +1092,31 @@ static enum get_oid_result get_nth_ancestor(struct repository *r,
 	struct commit *commit;
 	int ret;
 
+	if (++get_nth_ancestor_curr_depth > get_nth_ancestor_max_depth)
+		 return error(_("exceeded maximum ancestor depth"));
+
 	ret = get_oid_1(r, name, len, &oid, GET_OID_COMMITTISH);
 	if (ret)
-		return ret;
+		goto done;
 	commit = lookup_commit_reference(r, &oid);
-	if (!commit)
-		return MISSING_OBJECT;
+	if (!commit) {
+		ret = MISSING_OBJECT;
+		goto done;
+	}
 
 	while (generation--) {
-		if (repo_parse_commit(r, commit) || !commit->parents)
-			return MISSING_OBJECT;
+		if (repo_parse_commit(r, commit) || !commit->parents) {
+			ret = MISSING_OBJECT;
+			goto done;
+		}
 		commit = commit->parents->item;
 	}
 	oidcpy(result, &commit->object.oid);
-	return FOUND;
+
+	ret = FOUND;
+done:
+	get_nth_ancestor_curr_depth--;
+	return ret;
 }
 
 struct object *repo_peel_to_type(struct repository *r, const char *name, int namelen,
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index ef40511d89..b3b9f6c8c5 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -244,6 +244,11 @@ test_expect_success 'reject Nth ancestor if N is too high' '
 	test_must_fail git rev-parse HEAD~100000000000000000000000000000000
 '
 
+test_expect_success 'reject too-deep recursive ancestor queries' '
+	test_must_fail git rev-parse "HEAD$(perl -e "print \"~\" x 4097")" 2>err &&
+	grep "error: exceeded maximum ancestor depth" err
+'
+
 test_expect_success 'pathspecs with wildcards are not ambiguous' '
 	echo "*.c" >expect &&
 	git rev-parse "*.c" >actual &&

base-commit: cfb8a6e9a93adbe81efca66e6110c9b4d2e57169
-- 
2.43.0.rc2.19.geadd45bf00

^ permalink raw reply related

* [ANNOUNCE] Git v2.43.0
From: Junio C Hamano @ 2023-11-20 17:01 UTC (permalink / raw)
  To: git; +Cc: Linux Kernel, git-packagers

The latest feature release Git v2.43.0 is now available at the
usual places.  It is comprised of 464 non-merge commits since
v2.42.0, contributed by 80 people, 17 of which are new faces [*].

The tarballs are found at:

    https://www.kernel.org/pub/software/scm/git/

The following public repositories all have a copy of the 'v2.43.0'
tag and the 'master' branch that the tag points at:

  url = https://git.kernel.org/pub/scm/git/git
  url = https://kernel.googlesource.com/pub/scm/git/git
  url = git://repo.or.cz/alt-git.git
  url = https://github.com/gitster/git

New contributors whose contributions weren't in v2.42.0 are as follows.
Welcome to the Git development community!

  Aditya Neelamraju, Alyssa Ross, Caleb Hill, Dorcas AnonoLitunya,
  Dragan Simic, Isoken June Ibizugbe, Jan Alexander Steffens
  (heftig), Javier Mora, ks1322 ks1322, Mark Ruvald Pedersen,
  Matthew McClain, Naomi Ibe, Romain Chossart, Tang Yuyi, Vipul
  Kumar, 王常新, and 谢致邦 (XIE Zhibang).

Returning contributors who helped this release are as follows.
Thanks for your continued support.

  Ævar Arnfjörð Bjarmason, Alexander Shopov, Andrei Rybak,
  Andy Koppe, Arkadii Yakovets, Bagas Sanjaya, Beat Bolli, brian
  m. carlson, Calvin Wan, Christian Couder, Christian Hesse,
  Derrick Stolee, Drew DeVault, Elijah Newren, Emily Shaffer,
  Emir SARI, Eric W. Biederman, Eric Wong, Evan Gates, Han Young,
  Hariom Verma, Jacob Abel, Jacob Stopak, Jason Hatton, Jean-Noël
  Avila, Jeff King, Johannes Schindelin, John Cai, Jordi Mas,
  Josh Soref, Josip Sokcevic, Junio C Hamano, Karthik Nayak,
  Kate Golovanova, Kousik Sanagavarapu, Kristoffer Haugsbakk,
  Linus Arver, Mark Levedahl, Martin Ågren, Martin Storsjö,
  M Hickford, Michael Strawbridge, Michal Suchanek, Oswald
  Buddenhagen, Patrick Steinhardt, Peter Krefting, Philippe Blain,
  Phillip Wood, Ralf Thielow, Randall S. Becker, René Scharfe,
  Robert Coup, Rubén Justo, Sergey Organov, Shuqi Liang, Stefan
  Haller, Štěpán Němec, Taylor Blau, Teng Long, Todd Zullinger,
  Victoria Dye, Wesley Schwengle, and Yi-Jyun Pan.

[*] We are counting not just the authorship contribution but issue
    reporting, mentoring, helping and reviewing that are recorded in
    the commit trailers.

----------------------------------------------------------------

Git v2.43 Release Notes
=======================

Backward Compatibility Notes

 * The "--rfc" option of "git format-patch" used to be a valid way to
   override an earlier "--subject-prefix=<something>" on the command
   line and replace it with "[RFC PATCH]", but from this release, it
   merely prefixes the string "RFC " in front of the given subject
   prefix.  If you are negatively affected by this change, please use
   "--subject-prefix=PATCH --rfc" as a replacement.

 * In Git 2.42, "git rev-list --stdin" learned to take non-revisions
   (like "--not") from the standard input, but the way such a "--not" was
   handled was quite confusing, which has been rethought.  The updated
   rule is that "--not" given from the command line only affects revs
   given from the command line that comes but not revs read from the
   standard input, and "--not" read from the standard input affects
   revs given from the standard input and not revs given from the
   command line.

UI, Workflows & Features

 * A message written in olden time prevented a branch from getting
   checked out, saying it is already checked out elsewhere. But these
   days, we treat a branch that is being bisected or rebased just like
   a branch that is checked out and protect it from getting modified
   with the same codepath.  The message has been rephrased to say that
   the branch is "in use" to avoid confusion.

 * Hourly and other schedules of "git maintenance" jobs are randomly
   distributed now.

 * "git cmd -h" learned to signal which options can be negated by
   listing such options like "--[no-]opt".

 * The way authentication related data other than passwords (e.g.,
   oauth token and password expiration data) are stored in libsecret
   keyrings has been rethought.

 * Update the libsecret and wincred credential helpers to correctly
   match which credential to erase; they erased the wrong entry in
   some cases.

 * Git GUI updates.

 * "git format-patch" learned a new "--description-file" option that
   lets cover letter description to be fed; this can be used on
   detached HEAD where there is no branch description available, and
   also can override the branch description if there is one.

 * Use of the "--max-pack-size" option to allow multiple packfiles to
   be created is now supported even when we are sending unreachable
   objects to cruft packs.

 * "git format-patch --rfc --subject-prefix=<foo>" used to ignore the
   "--subject-prefix" option and used "[RFC PATCH]"; now we will add
   "RFC" prefix to whatever subject prefix is specified.

 * "git log --format" has been taught the %(decorate) placeholder for
   further customization over what the "--decorate" option offers.

 * The default log message created by "git revert", when reverting a
   commit that records a revert, has been tweaked, to encourage people
   to describe complex "revert of revert of revert" situations better in
   their own words.

 * The command-line completion support (in contrib/) learned to
   complete "git commit --trailer=" for possible trailer keys.

 * "git update-index" learned the "--show-index-version" option to
   inspect the index format version used by the on-disk index file.

 * "git diff" learned the "diff.statNameWidth" configuration variable,
   to give the default width for the name part in the "--stat" output.

 * "git range-diff --notes=foo" compared "log --notes=foo --notes" of
   the two ranges, instead of using just the specified notes tree,
   which has been corrected to use only the specified notes tree.

 * The command line completion script (in contrib/) can be told to
   complete aliases by including ": git <cmd> ;" in the alias to tell
   it that the alias should be completed in a similar way to how "git
   <cmd>" is completed.  The parsing code for the alias has been
   loosened to allow ';' without an extra space before it.

 * "git for-each-ref" and friends learned to apply mailmap to
   authorname and other fields in a more flexible way than using
   separate placeholder letters like %a[eElL] every time we want to
   come up with small variants.

 * "git repack" machinery learned to pay attention to the "--filter="
   option.

 * "git repack" learned the "--max-cruft-size" option to prevent cruft
   packs from growing without bounds.

 * "git merge-tree" learned to take strategy backend specific options
   via the "-X" option, like "git merge" does.

 * "git log" and friends learned the "--dd" option that is a
   short-hand for "--diff-merges=first-parent -p".

 * The attribute subsystem learned to honor the "attr.tree"
   configuration variable that specifies which tree to read the
   .gitattributes files from.

 * "git merge-file" learns a mode to read three variants of the
   contents to be merged from blob objects.


Performance, Internal Implementation, Development Support etc.

 * "git check-attr" has been taught to work better with sparse-index.

 * It may be tempting to leave the help text NULL for a command line
   option that is either hidden or too obvious, but "git subcmd -h"
   and "git subcmd --help-all" would have segfaulted if done so.  Now
   the help text is truly optional.

 * Tests that are known to pass with LSan are now marked as such.

 * Flaky "git p4" tests, as well as "git svn" tests, are now skipped
   in the (rather expensive) sanitizer CI job.

 * Tests with LSan from time to time seem to emit harmless messages
   that make our tests unnecessarily flaky; we work around it by
   filtering the uninteresting output.

 * Unused parameters to functions are marked as such, and/or removed,
   in order to bring us closer to "-Wunused-parameter" clean.

 * The code to keep track of existing packs in the repository while
   repacking has been refactored.

 * The "streaming" interface used for bulk-checkin codepath has been
   narrowed to take only blob objects for now, with no real loss of
   functionality.

 * GitHub CI workflow has learned to trigger Coverity check.

 * Test coverage for trailers has been improved.

 * The code to iterate over loose references has been optimized to
   reduce the number of lstat() system calls.

 * The codepaths that read "chunk" formatted files have been corrected
   to pay attention to the chunk size and notice broken files.

 * Replace macos-12 used at GitHub CI with macos-13.
   (merge 682a868f67 js/ci-use-macos-13 later to maint).


Fixes since v2.42
-----------------

 * Overly long label names used in the sequencer machinery are now
   chopped to fit under filesystem limitation.

 * Scalar updates.

 * Tweak GitHub Actions CI so that pushing the same commit to multiple
   branch tips at the same time will not waste building and testing
   the same thing twice.

 * The commit-graph verification code that detects a mixture of zero and
   non-zero generation numbers has been updated.

 * "git diff -w --exit-code" with various options did not work
   correctly, which has been corrected.

 * The "transfer.unpackLimit" configuration variable ought to be used
   as a fallback, but overrode the more specific "fetch.unpackLimit"
   and "receive.unpackLimit" configuration variables by mistake, which
   has been corrected.

 * The use of API between two calls to require_clean_work_tree() from
   the sequencer code has been cleaned up for consistency.

 * "git diff --no-such-option" and other corner cases around the exit
   status of the "diff" command have been corrected.

 * "git for-each-ref --sort='contents:size'" sorted the refs according
   to size numerically, giving a ref that points at a blob twelve-byte
   (12) long before showing a blob hundred-byte (100) long, which has
   been corrected.

 * We now limit the depth of the tree objects and maximum length of
   pathnames recorded in tree objects.
   (merge 4d5693ba05 jk/tree-name-and-depth-limit later to maint).

 * Various fixes to the behavior of "rebase -i", when the command got
   interrupted by conflicting changes, have been made.

 * References from a description of the `--patch` option in various
   manual pages have been simplified and improved.

 * "git grep -e A --no-or -e B" is accepted, even though the negation
   of the "--or" option did not mean anything, which has been tightened.

 * The completion script (in contrib/) has been taught to treat the
   "-t" option to "git checkout" and "git switch" just like the
   "--track" option, to complete remote-tracking branches.

 * "git diff --no-index -R <(one) <(two)" did not work correctly,
   which has been corrected.

 * "git maintenance" timers' implementation has been updated, based on
   systemd timers, to work with WSL.

 * "git diff --cached" codepath did not fill the necessary stat
   information for a file when fsmonitor knows it is clean and ended
   up behaving as if it were not clean, which has been corrected.

 * How "alias.foo = : git cmd ; aliased-command-string" should be
   spelled with necessary whitespace around punctuation marks to work
   has been more clearly documented (but this will be moot with newer
   versions of Git where the parsing rules have been improved).

 * HTTP Header redaction code has been adjusted for a newer version of
   cURL library that shows its traces differently from earlier
   versions.

 * An error message given by "git send-email", when given a malformed
   address, did not show the offending address, which has been corrected.

 * UBSan options were not propagated through the test framework to git
   run via the httpd, unlike ASan options, which has been corrected.

 * "checkout --merge -- path" and "update-index --unresolve path" did
   not resurrect conflicted state that was resolved to remove path,
   but now they do.
   (merge 5bdedac3c7 jc/unresolve-removal later to maint).

 * The display width table for unicode characters has been updated for
   Unicode 15.1
   (merge 872976c37e bb/unicode-width-table-15 later to maint).

 * Update mailmap entry for Derrick.
   (merge 6e5457d8c7 ds/mailmap-entry-update later to maint).

 * In the ".gitmodules" files, submodules are keyed by their names,
   and the path to the submodule whose name is $name is specified by
   the submodule.$name.path variable.  There were a few codepaths that
   mixed the name and path up when consulting the submodule database,
   which have been corrected.  It took long for these bugs to be found
   as the name of a submodule initially is the same as its path, and
   the problem does not surface until it is moved to a different path,
   which apparently happens very rarely.

 * "git diff --merge-base X other args..." insisted that X must be a
   commit and errored out when given an annotated tag that peels to a
   commit, but we only need it to be a committish.  This has been
   corrected.
   (merge 4adceb5a29 ar/diff-index-merge-base-fix later to maint).

 * "git merge-tree" used to segfault when the "--attr-source"
   option is used, which has been corrected.
   (merge e95bafc52f jc/merge-ort-attr-index-fix later to maint).

 * Unlike "git log --pretty=%D", "git log --pretty="%(decorate)" did
   not auto-initialize the decoration subsystem, which has been
   corrected.

 * Feeding "git stash store" with a random commit that was not created
   by "git stash create" now errors out.
   (merge d9b6634589 jc/fail-stash-to-store-non-stash later to maint).

 * The index file has room only for the lower 32-bit of the file size in
   the cached stat information, which means cached stat information
   will have 0 in its sd_size member for a file whose size is a multiple
   of 4GiB.  This is mistaken for a racily clean path.  Avoid it by
   storing a bogus sd_size value instead for such files.
   (merge 5143ac07b1 bc/racy-4gb-files later to maint).

 * "git p4" tried to store symlinks to LFS when told, but has been
   fixed not to do so, because it does not make sense.
   (merge 10c89a02b0 mm/p4-symlink-with-lfs later to maint).

 * The codepath to handle recipient addresses `git send-email
   --compose` learns from the user was completely broken, which has
   been corrected.
   (merge 3ec6167567 jk/send-email-fix-addresses-from-composed-messages later to maint).

 * "cd sub && git grep -f patterns" tried to read "patterns" file at
   the top level of the working tree; it has been corrected to read
   "sub/patterns" instead.

 * "git reflog expire --single-worktree" has been broken for the past
   20 months or so, which has been corrected.

 * "git send-email" did not have certain pieces of data computed yet
   when it tried to validate the outgoing messages and its recipient
   addresses, which has been sorted out.

 * "git bugreport" learned to complain when it received a command line
   argument that it will not use.

 * The codepath to traverse the commit-graph learned to notice that a
   commit is missing (e.g., corrupt repository lost an object), even
   though it knows something about the commit (like its parents) from
   what is in commit-graph.
   (merge 7a5d604443 ps/do-not-trust-commit-graph-blindly-for-existence later to maint).

 * "git rev-list --missing" did not work for missing commit objects,
   which has been corrected.

 * "git rev-list --unpacked --objects" failed to exclude packed
   non-commit objects, which has been corrected.
   (merge 7b3c8e9f38 tb/rev-list-unpacked-fix later to maint).

 * "To dereference" and "to peel" were sometimes used in in-code
   comments and documentation but without description in the glossary.
   (merge 893dce2ffb vd/glossary-dereference-peel later to maint).

 * Other code cleanup, docfix, build fix, etc.
   (merge c2c349a15c xz/commit-title-soft-limit-doc later to maint).
   (merge 1bd809938a tb/format-pack-doc-update later to maint).
   (merge 8f81532599 an/clang-format-typofix later to maint).
   (merge 3ca86adc2d la/strvec-header-fix later to maint).
   (merge 6789275d37 jc/test-i18ngrep later to maint).
   (merge 9972cd6004 ps/leakfixes later to maint).
   (merge 46edab516b tz/send-email-helpfix later to maint).

----------------------------------------------------------------

Changes since v2.42.0 are as follows:

Aditya Neelamraju (1):
      clang-format: fix typo in comment

Alexander Shopov (1):
      l10n: bg.po: Updated Bulgarian translation (5579t)

Alyssa Ross (1):
      diff: fix --merge-base with annotated tags

Andrei Rybak (1):
      SubmittingPatches: call gitk's command "Copy commit reference"

Andy Koppe (8):
      pretty-formats: enclose options in angle brackets
      decorate: refactor format_decorations()
      decorate: avoid some unnecessary color overhead
      decorate: color each token separately
      pretty: add %(decorate[:<options>]) format
      pretty: add pointer and tag options to %(decorate)
      decorate: use commit color for HEAD arrow
      pretty: fix ref filtering for %(decorate) formats

Arkadii Yakovets (1):
      l10n: update uk localization for v2.43

Bagas Sanjaya (1):
      l10n: po-id for 2.43 (round 1)

Beat Bolli (1):
      unicode: update the width tables to Unicode 15.1

Caleb Hill (1):
      git-clean doc: fix "without do cleaning" typo

Calvin Wan (4):
      hex-ll: separate out non-hash-algo functions
      wrapper: reduce scope of remove_or_warn()
      config: correct bad boolean env value error message
      parse: separate out parsing functions from config.h

Christian Couder (9):
      pack-objects: allow `--filter` without `--stdout`
      t/helper: add 'find-pack' test-tool
      repack: refactor finishing pack-objects command
      repack: refactor finding pack prefix
      pack-bitmap-write: rebuild using new bitmap when remapping
      repack: add `--filter=<filter-spec>` option
      gc: add `gc.repackFilter` config option
      repack: implement `--filter-to` for storing filtered out objects
      gc: add `gc.repackFilterTo` config option

Christian Hesse (2):
      t/lib-gpg: forcibly run a trustdb update
      t/t6300: drop magic filtering

Derrick Stolee (13):
      upload-pack: fix race condition in error messages
      maintenance: add get_random_minute()
      maintenance: use random minute in launchctl scheduler
      maintenance: use random minute in Windows scheduler
      maintenance: use random minute in cron scheduler
      maintenance: swap method locations
      maintenance: use random minute in systemd scheduler
      maintenance: fix systemd schedule overlaps
      maintenance: update schedule before config
      scalar: add --[no-]src option
      setup: add discover_git_directory_reason()
      scalar reconfigure: help users remove buggy repos
      mailmap: change primary address for Derrick Stolee

Dorcas AnonoLitunya (1):
      t7601: use "test_path_is_file" etc. instead of "test -f"

Dragan Simic (2):
      diff --stat: add config option to limit filename width
      diff --stat: set the width defaults in a helper function

Drew DeVault (1):
      format-patch: --rfc honors what --subject-prefix sets

Elijah Newren (26):
      documentation: wording improvements
      documentation: fix small error
      documentation: fix typos
      documentation: fix apostrophe usage
      documentation: add missing words
      documentation: remove extraneous words
      documentation: fix subject/verb agreement
      documentation: employ consistent verb tense for a list
      documentation: fix verb tense
      documentation: fix adjective vs. noun
      documentation: fix verb vs. noun
      documentation: fix singular vs. plural
      documentation: whitespace is already generally plural
      documentation: fix choice of article
      documentation: add missing article
      documentation: remove unnecessary hyphens
      documentation: add missing hyphens
      documentation: use clearer prepositions
      documentation: fix punctuation
      documentation: fix capitalization
      documentation: fix whitespace issues
      documentation: add some commas where they are helpful
      documentation: add missing fullstops
      documentation: add missing quotes
      documentation: add missing parenthesis
      RelNotes: minor wording fixes in 2.43.0 release notes

Emily Shaffer (2):
      t0091-bugreport: stop using i18ngrep
      bugreport: reject positional arguments

Emir SARI (1):
      l10n: tr: v2.43.0

Eric W. Biederman (1):
      bulk-checkin: only support blobs in index_bulk_checkin

Eric Wong (1):
      treewide: fix various bugs w/ OpenSSL 3+ EVP API

Evan Gates (1):
      git-config: fix misworded --type=path explanation

Han Young (1):
      show doc: redirect user to git log manual instead of git diff-tree

Isoken June Ibizugbe (1):
      builtin/branch.c: adjust error messages to coding guidelines

Jacob Abel (1):
      builtin/worktree.c: fix typo in "forgot fetch" msg

Jacob Stopak (1):
      Include gettext.h in MyFirstContribution tutorial

Jan Alexander Steffens (heftig) (6):
      submodule--helper: use submodule_from_path in set-{url,branch}
      submodule--helper: return error from set-url when modifying failed
      t7419: actually test the branch switching
      t7419, t7420: use test_cmp_config instead of grepping .gitmodules
      t7419: test that we correctly handle renamed submodules
      t7420: test that we correctly handle renamed submodules

Jason Hatton (1):
      Prevent git from rehashing 4GiB files

Javier Mora (2):
      git-status.txt: fix minor asciidoc format issue
      doc/git-bisect: clarify `git bisect run` syntax

Jean-Noël Avila (1):
      l10n: fr: v2.43.0 rnd 2

Jeff King (114):
      hashmap: use expected signatures for comparison functions
      diff-files: avoid negative exit value
      diff: show usage for unknown builtin_diff_files() options
      diff: die when failing to read index in git-diff builtin
      diff: drop useless return from run_diff_{files,index} functions
      diff: drop useless return values in git-diff helpers
      diff: drop useless "status" parameter from diff_result_code()
      commit-graph: verify swapped zero/non-zero generation cases
      test-lib: ignore uninteresting LSan output
      sequencer: use repository parameter in short_commit_name()
      sequencer: mark repository argument as unused
      ref-filter: mark unused parameters in parser callbacks
      pack-bitmap: mark unused parameters in show_object callback
      worktree: mark unused parameters in each_ref_fn callback
      commit-graph: mark unused data parameters in generation callbacks
      ls-tree: mark unused parameter in callback
      stash: mark unused parameter in diff callback
      trace2: mark unused us_elapsed_absolute parameters
      trace2: mark unused config callback parameter
      test-trace2: mark unused argv/argc parameters
      grep: mark unused parameter in output function
      add-interactive: mark unused callback parameters
      negotiator/noop: mark unused callback parameters
      worktree: mark unused parameters in noop repair callback
      imap-send: mark unused parameters with NO_OPENSSL
      grep: mark unused parmaeters in pcre fallbacks
      credential: mark unused parameter in urlmatch callback
      fetch: mark unused parameter in ref_transaction callback
      bundle-uri: mark unused parameters in callbacks
      gc: mark unused descriptors in scheduler callbacks
      update-ref: mark unused parameter in parser callbacks
      ci: allow branch selection through "vars"
      ci: deprecate ci/config/allow-ref script
      merge: make xopts a strvec
      merge: simplify parsing of "-n" option
      format-patch: use OPT_STRING_LIST for to/cc options
      tree-walk: reduce stack size for recursive functions
      tree-walk: drop MAX_TRAVERSE_TREES macro
      tree-walk: rename "error" variable
      fsck: detect very large tree pathnames
      add core.maxTreeDepth config
      traverse_trees(): respect max_allowed_tree_depth
      read_tree(): respect max_allowed_tree_depth
      list-objects: respect max_allowed_tree_depth
      tree-diff: respect max_allowed_tree_depth
      lower core.maxTreeDepth default to 2048
      checkout-index: delay automatic setting of to_tempfile
      parse-options: prefer opt->value to globals in callbacks
      parse-options: mark unused "opt" parameter in callbacks
      merge: do not pass unused opt->value parameter
      parse-options: add more BUG_ON() annotations
      interpret-trailers: mark unused "unset" parameters in option callbacks
      parse-options: mark unused parameters in noop callback
      merge-ort: drop custom err() function
      merge-ort: stop passing "opt" to read_oid_strbuf()
      merge-ort: drop unused parameters from detect_and_process_renames()
      merge-ort: drop unused "opt" parameter from merge_check_renames_reusable()
      http: factor out matching of curl http/2 trace lines
      http: update curl http/2 info matching for curl 8.3.0
      merge-ort: lowercase a few error messages
      fsmonitor: prefer repo_git_path() to git_pathdup()
      fsmonitor/win32: drop unused parameters
      fsmonitor: mark some maybe-unused parameters
      fsmonitor/win32: mark unused parameter in fsm_os__incompatible()
      fsmonitor: mark unused parameters in stub functions
      fsmonitor/darwin: mark unused parameters in system callback
      fsmonitor: mark unused hashmap callback parameters
      run-command: mark unused parameters in start_bg_wait callbacks
      test-lib: set UBSAN_OPTIONS to match ASan
      commit-graph: factor out chain opening function
      commit-graph: check mixed generation validation when loading chain file
      t5324: harmonize sha1/sha256 graph chain corruption
      commit-graph: detect read errors when verifying graph chain
      commit-graph: tighten chain size check
      commit-graph: report incomplete chains during verification
      t6700: mark test as leak-free
      commit-reach: free temporary list in get_octopus_merge_bases()
      merge: free result of repo_get_merge_bases()
      commit-graph: move slab-clearing to close_commit_graph()
      commit-graph: free all elements of graph chain
      commit-graph: delay base_graph assignment in add_graph_to_chain()
      commit-graph: free graph struct that was not added to chain
      commit-graph: free write-context entries before overwriting
      commit-graph: free write-context base_graph_name during cleanup
      commit-graph: clear oidset after finishing write
      decorate: add clear_decoration() function
      revision: clear decoration structs during release_revisions()
      daemon: free listen_addr before returning
      repack: free existing_cruft array after use
      chunk-format: note that pair_chunk() is unsafe
      t: add library for munging chunk-format files
      midx: stop ignoring malformed oid fanout chunk
      commit-graph: check size of oid fanout chunk
      midx: check size of oid lookup chunk
      commit-graph: check consistency of fanout table
      midx: check size of pack names chunk
      midx: enforce chunk alignment on reading
      midx: check size of object offset chunk
      midx: bounds-check large offset chunk
      midx: check size of revindex chunk
      commit-graph: check size of commit data chunk
      commit-graph: detect out-of-bounds extra-edges pointers
      commit-graph: bounds-check base graphs chunk
      commit-graph: check size of generations chunk
      commit-graph: bounds-check generation overflow chunk
      commit-graph: check bounds when accessing BDAT chunk
      commit-graph: check bounds when accessing BIDX chunk
      commit-graph: detect out-of-order BIDX offsets
      chunk-format: drop pair_chunk_unsafe()
      t5319: make corrupted large-offset test more robust
      doc/send-email: mention handling of "reply-to" with --compose
      Revert "send-email: extract email-parsing code into a subroutine"
      send-email: handle to/cc/bcc from --compose message
      t: avoid perl's pack/unpack "Q" specifier

Johannes Schindelin (19):
      windows: ignore empty `PATH` elements
      is_Cygwin: avoid `exec`ing anything
      Move is_<platform> functions to the beginning
      Move the `_which` function (almost) to the top
      Work around Tcl's default `PATH` lookup
      rebase: allow overriding the maximal length of the generated labels
      ci: avoid building from the same commit in parallel
      ci(linux-asan-ubsan): let's save some time
      var: avoid a segmentation fault when `HOME` is unset
      completion(switch/checkout): treat --track and -t the same
      maintenance(systemd): support the Windows Subsystem for Linux
      ci: add a GitHub workflow to submit Coverity scans
      coverity: cache the Coverity Build Tool
      coverity: allow overriding the Coverity project
      coverity: support building on Windows
      coverity: allow running on macOS
      coverity: detect and report when the token or project is incorrect
      max_tree_depth: lower it for MSVC to avoid stack overflows
      ci: upgrade to using macos-13

John Cai (3):
      merge-ort: initialize repo in index state
      attr: read attributes from HEAD when bare repo
      attr: add attr.tree for setting the treeish to read attributes from

Jordi Mas (1):
      l10n: Update Catalan translation

Josh Soref (1):
      Documentation/git-status: add missing line breaks

Josip Sokcevic (1):
      diff-lib: fix check_removed when fsmonitor is on

Junio C Hamano (57):
      update-index: do not read HEAD and MERGE_HEAD unconditionally
      resolve-undo: allow resurrecting conflicted state that resolved to deletion
      update-index: use unmerge_index_entry() to support removal
      update-index: remove stale fallback code for "--unresolve"
      checkout/restore: refuse unmerging paths unless checking out of the index
      checkout/restore: add basic tests for --merge
      checkout: allow "checkout -m path" to unmerge removed paths
      mv: fix error for moving directory to another
      diff: move the fallback "--exit-code" code down
      diff: mode-only change should be noticed by "--patch -w --exit-code"
      diff: teach "--stat -w --exit-code" to notice differences
      t4040: remove test that succeeded for a wrong reason
      pretty-formats: define "literal formatting code"
      diff: spell DIFF_INDEX_CACHED out when calling run_diff_index()
      diff: the -w option breaks --exit-code for --raw and other output modes
      transfer.unpackLimit: fetch/receive.unpackLimit takes precedence
      Start the 2.43 cycle
      The second batch for 2.43
      The extra batch to update credenthal helpers
      The third batch
      The fourth batch
      The fifth batch
      The sixth batch
      The seventh batch
      update-index doc: v4 is OK with JGit and libgit2
      update-index: add --show-index-version
      test-tool: retire "index-version"
      The eighth batch
      The ninth batch
      The tenth batch
      The eleventh batch
      completion: loosen and document the requirement around completing alias
      The twelfth batch
      The thirteenth batch
      The fourteenth batch
      The fifteenth batch
      doc: update list archive reference to use lore.kernel.org
      The sixteenth batch
      merge: introduce {copy|clear}_merge_options()
      stash: be careful what we store
      grep: -f <path> is relative to $cwd
      The seventeenth batch
      The eighteenth batch
      commit: do not use cryptic "new_index" in end-user facing messages
      The nineteenth batch
      am: align placeholder for --whitespace option with apply
      The twentieth batch
      The twenty-first batch
      The twenty-second batch
      test framework: further deprecate test_i18ngrep
      Git 2.42.1
      tests: teach callers of test_i18ngrep to use test_grep
      A bit more before -rc1
      Prepare for -rc1
      Git 2.43-rc1
      Git 2.43-rc2
      Git 2.43

Karthik Nayak (3):
      revision: rename bit to `do_not_die_on_missing_objects`
      rev-list: move `show_commit()` to the bottom
      rev-list: add commit object support in `--missing` option

Kousik Sanagavarapu (4):
      ref-filter: sort numerically when ":size" is used
      t/t6300: cleanup test_atom
      t/t6300: introduce test_bad_atom
      ref-filter: add mailmap support

Kristoffer Haugsbakk (2):
      range-diff: treat notes like `log`
      grep: die gracefully when outside repository

Linus Arver (17):
      trailer tests: make test cases self-contained
      trailer test description: this tests --where=after, not --where=before
      trailer: add tests to check defaulting behavior with --no-* flags
      trailer doc: narrow down scope of --where and related flags
      trailer: trailer location is a place, not an action
      trailer --no-divider help: describe usual "---" meaning
      trailer --parse help: expose aliased options
      trailer --only-input: prefer "configuration variables" over "rules"
      trailer --parse docs: add explanation for its usefulness
      trailer --unfold help: prefer "reformat" over "join"
      trailer doc: emphasize the effect of configuration variables
      trailer doc: separator within key suppresses default separator
      trailer doc: <token> is a <key> or <keyAlias>, not both
      trailer: separate public from internal portion of trailer_iterator
      trailer: split process_input_file into separate pieces
      trailer: split process_command_line_args into separate functions
      strvec: drop unnecessary include of hex.h

M Hickford (3):
      credential/libsecret: store new attributes
      credential/libsecret: erase matching creds only
      credential/wincred: erase matching creds only

Mark Levedahl (6):
      git gui Makefile - remove Cygwin modifications
      git-gui - remove obsolete Cygwin specific code
      git-gui - use cygstart to browse on Cygwin
      git-gui - use mkshortcut on Cygwin
      git-gui - re-enable use of hook scripts
      git-gui - use git-hook, honor core.hooksPath

Mark Ruvald Pedersen (1):
      sequencer: truncate labels to accommodate loose refs

Martin Ågren (1):
      git-merge-file doc: drop "-file" from argument placeholders

Matthew McClain (1):
      git-p4 shouldn't attempt to store symlinks in LFS

Michael Strawbridge (1):
      send-email: move validation code below process_address_list

Michal Suchanek (1):
      git-push doc: more visibility for -q option

Naomi Ibe (1):
      builtin/add.c: clean up die() messages

Oswald Buddenhagen (16):
      t/lib-rebase: set_fake_editor(): fix recognition of reset's short command
      t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently
      sequencer: simplify allocation of result array in todo_list_rearrange_squash()
      t/lib-rebase: improve documentation of set_fake_editor()
      t9001: fix indentation in test_no_confirm()
      format-patch: add --description-file option
      sequencer: rectify empty hint in call of require_clean_work_tree()
      sequencer: beautify subject of reverts of reverts
      git-revert.txt: add discussion
      sequencer: fix error message on failure to copy SQUASH_MSG
      t3404-rebase-interactive.sh: fix typos in title of a rewording test
      sequencer: remove unreachable exit condition in pick_commits()
      am: fix error message in parse_opt_show_current_patch()
      rebase: simplify code related to imply_merge()
      rebase: handle --strategy via imply_merge() as well
      rebase: move parse_opt_keep_empty() down

Patrick Steinhardt (23):
      upload-pack: fix exit code when denying fetch of unreachable object ID
      revision: make pseudo-opt flags read via stdin behave consistently
      doc/git-worktree: mention "refs/rewritten" as per-worktree refs
      doc/git-repack: fix syntax for `-g` shorthand option
      doc/git-repack: don't mention nonexistent "--unpacked" option
      commit-graph: introduce envvar to disable commit existence checks
      commit: detect commits that exist in commit-graph but not in the ODB
      builtin/show-ref: convert pattern to a local variable
      builtin/show-ref: split up different subcommands
      builtin/show-ref: fix leaking string buffer
      builtin/show-ref: fix dead code when passing patterns
      builtin/show-ref: refactor `--exclude-existing` options
      builtin/show-ref: stop using global variable to count matches
      builtin/show-ref: stop using global vars for `show_one()`
      builtin/show-ref: refactor options for patterns subcommand
      builtin/show-ref: ensure mutual exclusiveness of subcommands
      builtin/show-ref: explicitly spell out different modes in synopsis
      builtin/show-ref: add new mode to check for reference existence
      t: use git-show-ref(1) to check for ref existence
      test-bloom: stop setting up Git directory twice
      shallow: fix memory leak when registering shallow roots
      setup: refactor `upgrade_repository_format()` to have common exit
      setup: fix leaking repository format

Peter Krefting (1):
      l10n: sv.po: Update Swedish translation (5579t)

Philippe Blain (3):
      completion: commit: complete configured trailer tokens
      completion: commit: complete trailers tokens more robustly
      completion: improve doc for complex aliases

Phillip Wood (7):
      rebase -i: move unlink() calls
      rebase -i: remove patch file after conflict resolution
      sequencer: use rebase_path_message()
      sequencer: factor out part of pick_commits()
      rebase: fix rewritten list for failed pick
      rebase --continue: refuse to commit after failed command
      rebase -i: fix adding failed command to the todo list

Ralf Thielow (1):
      l10n: Update German translation

René Scharfe (18):
      subtree: disallow --no-{help,quiet,debug,branch,message}
      t1502, docs: disallow --no-help
      t1502: move optionspec help output to a file
      t1502: test option negation
      parse-options: show negatability of options in short help
      parse-options: factor out usage_indent() and usage_padding()
      parse-options: no --[no-]no-...
      parse-options: simplify usage_padding()
      parse-options: allow omitting option help text
      name-rev: use OPT_HIDDEN_BOOL for --peel-tag
      grep: use OPT_INTEGER_F for --max-depth
      grep: reject --no-or
      diff --no-index: fix -R with stdin
      parse-options: drop unused parse_opt_ctx_t member
      parse-options: make CMDMODE errors more precise
      am: simplify --show-current-patch handling
      am, rebase: fix arghelp syntax of --empty
      reflog: fix expire --single-worktree

Robert Coup (1):
      upload-pack: add tracing for fetches

Rubén Justo (2):
      branch: error message deleting a branch in use
      branch: error message checking out a branch in use

Sergey Organov (4):
      doc/diff-options: fix link to generating patch section
      diff-merges: improve --diff-merges documentation
      diff-merges: introduce '--dd' option
      completion: complete '--dd'

Shuqi Liang (3):
      t1092: add tests for 'git check-attr'
      attr.c: read attributes in a sparse directory
      check-attr: integrate with sparse-index

Tang Yuyi (1):
      merge-tree: add -X strategy option

Taylor Blau (28):
      repack: move `pack_geometry` struct to the stack
      commit-graph: introduce `commit_graph_generation_from_graph()`
      t/t5318-commit-graph.sh: test generation zero transitions during fsck
      commit-graph: avoid repeated mixed generation number warnings
      leak tests: mark a handful of tests as leak-free
      leak tests: mark t3321-notes-stripspace.sh as leak-free
      leak tests: mark t5583-push-branches.sh as leak-free
      builtin/pack-objects.c: remove unnecessary strbuf_reset()
      builtin/pack-objects.c: support `--max-pack-size` with `--cruft`
      Documentation/gitformat-pack.txt: remove multi-cruft packs alternative
      Documentation/gitformat-pack.txt: drop mixed version section
      builtin/repack.c: extract structure to store existing packs
      builtin/repack.c: extract marking packs for deletion
      builtin/repack.c: extract redundant pack cleanup for --geometric
      builtin/repack.c: extract redundant pack cleanup for existing packs
      builtin/repack.c: extract `has_existing_non_kept_packs()`
      builtin/repack.c: store existing cruft packs separately
      builtin/repack.c: avoid directly inspecting "util"
      builtin/repack.c: extract common cruft pack loop
      git-send-email.perl: avoid printing undef when validating addresses
      t7700: split cruft-related tests to t7704
      builtin/repack.c: parse `--max-pack-size` with OPT_MAGNITUDE
      builtin/repack.c: implement support for `--max-cruft-size`
      builtin/repack.c: avoid making cruft packs preferred
      Documentation/gitformat-pack.txt: fix typo
      Documentation/gitformat-pack.txt: fix incorrect MIDX documentation
      list-objects: drop --unpacked non-commit objects from results
      pack-bitmap: drop --unpacked non-commit objects from results

Teng Long (1):
      l10n: zh_CN: for git 2.43.0-rc1

Todd Zullinger (3):
      RelNotes: minor typo fixes in 2.43.0 draft
      RelNotes: improve wording of credential helper notes
      send-email: remove stray characters from usage

Victoria Dye (5):
      ref-cache.c: fix prefix matching in ref iteration
      dir.[ch]: expose 'get_dtype'
      dir.[ch]: add 'follow_symlink' arg to 'get_dtype'
      files-backend.c: avoid stat in 'loose_fill_ref_dir'
      glossary: add definitions for dereference & peel

Vipul Kumar (1):
      git-gui: Fix a typo in README

Wesley Schwengle (2):
      git-push.txt: fix grammar
      git-svn: drop FakeTerm hack

Yi-Jyun Pan (1):
      l10n: zh-TW: Git 2.43.0-rc1

brian m. carlson (2):
      t: add a test helper to truncate files
      merge-file: add an option to process object IDs

Ævar Arnfjörð Bjarmason (1):
      Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4

Štěpán Němec (6):
      doc: fix some typos, grammar and wording issues
      doc/diff-options: improve wording of the log.diffMerges mention
      git-jump: admit to passing merge mode args to ls-files
      doc/gitk: s/sticked/stuck/
      t/README: fix multi-prerequisite example
      doc/cat-file: make synopsis and description less confusing

王常新 (1):
      merge-ort.c: fix typo 'neeed' to 'needed'

谢致邦 (XIE Zhibang) (2):
      doc: correct the 50 characters soft limit
      doc: correct the 50 characters soft limit (+)


^ permalink raw reply

* What's cooking in git.git (Nov 2023, #08; Mon, 20)
From: Junio C Hamano @ 2023-11-20 17:01 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).

Git 2.43 has been tagged.  With many folks are away from the
keyboard for vacation, I would expect it will be a very slow week.
I'll be taking a few weeks off, too, so please enjoy this release ;-).

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']

* tz/send-email-helpfix (2023-11-16) 1 commit
  (merged to 'next' on 2023-11-17 at 8422271795)
 + send-email: remove stray characters from usage

 Typoes in "git send-email -h" have been corrected.
 source: <20231115173952.339303-3-tmz@pobox.com>


* vd/glossary-dereference-peel (2023-11-14) 1 commit
  (merged to 'next' on 2023-11-17 at bac3ab0c0b)
 + glossary: add definitions for dereference & peel

 "To dereference" and "to peel" were sometimes used in in-code
 comments and documentation but without description in the glossary.
 source: <pull.1610.v2.git.1699917471769.gitgitgadget@gmail.com>

--------------------------------------------------
[New Topics]

* ac/fuzz-show-date (2023-11-20) 1 commit
 - fuzz: add new oss-fuzz fuzzer for date.c / date.h

 Subject approxidate() and show_date() macchinery to OSS-Fuzz.

 Will merge to 'next'?
 source: <pull.1612.v4.git.1700243267653.gitgitgadget@gmail.com>


* js/packfile-h-typofix (2023-11-20) 1 commit
 - packfile.c: fix a typo in `each_file_in_pack_dir_fn()`'s declaration

 Typofix.

 Will merge to 'next'.
 source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com>

--------------------------------------------------
[Stalled]

* pw/rebase-sigint (2023-09-07) 1 commit
 - rebase -i: ignore signals when forking subprocesses

 If the commit log editor or other external programs (spawned via
 "exec" insn in the todo list) receive internactive signal during
 "git rebase -i", it caused not just the spawned program but the
 "Git" process that spawned them, which is often not what the end
 user intended.  "git" learned to ignore SIGINT and SIGQUIT while
 waiting for these subprocesses.

 Expecting a reroll.
 cf. <12c956ea-330d-4441-937f-7885ab519e26@gmail.com>
 source: <pull.1581.git.1694080982621.gitgitgadget@gmail.com>


* tk/cherry-pick-sequence-requires-clean-worktree (2023-06-01) 1 commit
 - cherry-pick: refuse cherry-pick sequence if index is dirty

 "git cherry-pick A" that replays a single commit stopped before
 clobbering local modification, but "git cherry-pick A..B" did not,
 which has been corrected.

 Expecting a reroll.
 cf. <999f12b2-38d6-f446-e763-4985116ad37d@gmail.com>
 source: <pull.1535.v2.git.1685264889088.gitgitgadget@gmail.com>


* jc/diff-cached-fsmonitor-fix (2023-09-15) 3 commits
 - diff-lib: fix check_removed() when fsmonitor is active
 - Merge branch 'jc/fake-lstat' into jc/diff-cached-fsmonitor-fix
 - Merge branch 'js/diff-cached-fsmonitor-fix' into jc/diff-cached-fsmonitor-fix
 (this branch uses jc/fake-lstat.)

 The optimization based on fsmonitor in the "diff --cached"
 codepath is resurrected with the "fake-lstat" introduced earlier.

 It is unknown if the optimization is worth resurrecting, but in case...
 source: <xmqqr0n0h0tw.fsf@gitster.g>

--------------------------------------------------
[Cooking]

* jw/builtin-objectmode-attr (2023-11-16) 2 commits
 - SQUASH???
 - attr: add builtin objectmode values support

 The builtin_objectmode attribute is populated for each path
 without adding anything in .gitattributes files, which would be
 useful in magic pathspec, e.g., ":(attr:builtin_objectmode=100755)"
 to limit to executables.
 source: <20231116054437.2343549-1-jojwang@google.com>


* ps/ref-deletion-updates (2023-11-17) 4 commits
 - refs: remove `delete_refs` callback from backends
 - refs: deduplicate code to delete references
 - refs/files: use transactions to delete references
 - t5510: ensure that the packed-refs file needs locking

 Simplify API implementation to delete references by eliminating
 duplication.

 Will merge to 'next'.
 source: <cover.1699951815.git.ps@pks.im>


* tz/send-email-negatable-options (2023-11-17) 2 commits
  (merged to 'next' on 2023-11-17 at f09e533e43)
 + send-email: avoid duplicate specification warnings
 + perl: bump the required Perl version to 5.8.1 from 5.8.0

 Newer versions of Getopt::Long started giving warnings against our
 (ab)use of it in "git send-email".  Bump the minimum version
 requirement for Perl to 5.8.1 (from September 2002) to allow
 simplifying our implementation.

 Will cook in 'next'.
 source: <20231116193014.470420-1-tmz@pobox.com>


* js/ci-discard-prove-state (2023-11-14) 1 commit
  (merged to 'next' on 2023-11-14 at fade3ba143)
 + ci: avoid running the test suite _twice_
 (this branch uses ps/ci-gitlab.)

 The way CI testing used "prove" could lead to running the test
 suite twice needlessly, which has been corrected.

 Will cook in 'next'.
 source: <pull.1613.git.1699894837844.gitgitgadget@gmail.com>


* jk/chunk-bounds-more (2023-11-09) 9 commits
  (merged to 'next' on 2023-11-13 at 3df4b18bea)
 + commit-graph: mark chunk error messages for translation
 + commit-graph: drop verify_commit_graph_lite()
 + commit-graph: check order while reading fanout chunk
 + commit-graph: use fanout value for graph size
 + commit-graph: abort as soon as we see a bogus chunk
 + commit-graph: clarify missing-chunk error messages
 + commit-graph: drop redundant call to "lite" verification
 + midx: check consistency of fanout table
 + commit-graph: handle overflow in chunk_size checks
 (this branch is used by tb/pair-chunk-expect.)

 Code clean-up for jk/chunk-bounds topic.

 Will cook in 'next'.
 source: <20231109070310.GA2697602@coredump.intra.peff.net>


* ps/httpd-tests-on-nixos (2023-11-11) 3 commits
  (merged to 'next' on 2023-11-13 at 81bd6f5334)
 + t9164: fix inability to find basename(1) in Subversion hooks
 + t/lib-httpd: stop using legacy crypt(3) for authentication
 + t/lib-httpd: dynamically detect httpd and modules path

 Portability tweak.

 Will cook in 'next'.
 source: <cover.1699596457.git.ps@pks.im>


* ss/format-patch-use-encode-headers-for-cover-letter (2023-11-10) 1 commit
  (merged to 'next' on 2023-11-14 at 1a4bd59e15)
 + format-patch: fix ignored encode_email_headers for cover letter

 "git format-patch --encode-email-headers" ignored the option when
 preparing the cover letter, which has been corrected.

 Will cook in 'next'.
 source: <20231109111950.387219-1-contact@emersion.fr>


* ps/ban-a-or-o-operator-with-test (2023-11-11) 4 commits
  (merged to 'next' on 2023-11-14 at d84471baab)
 + Makefile: stop using `test -o` when unlinking duplicate executables
 + contrib/subtree: convert subtree type check to use case statement
 + contrib/subtree: stop using `-o` to test for number of args
 + global: convert trivial usages of `test <expr> -a/-o <expr>`

 Test and shell scripts clean-up.

 Will cook in 'next'.
 source: <cover.1699609940.git.ps@pks.im>


* ak/rebase-autosquash (2023-11-16) 3 commits
  (merged to 'next' on 2023-11-17 at 3ed6e79445)
 + rebase: rewrite --(no-)autosquash documentation
 + rebase: support --autosquash without -i
 + rebase: fully ignore rebase.autoSquash without -i

 "git rebase --autosquash" is now enabled for non-interactive rebase,
 but it is still incompatible with the apply backend.

 Will cook in 'next'.
 source: <20231114214339.10925-1-andy.koppe@gmail.com>


* vd/for-each-ref-unsorted-optimization (2023-11-16) 10 commits
  (merged to 'next' on 2023-11-17 at ff99420bf6)
 + t/perf: add perf tests for for-each-ref
 + ref-filter.c: use peeled tag for '*' format fields
 + for-each-ref: clean up documentation of --format
 + ref-filter.c: filter & format refs in the same callback
 + ref-filter.c: refactor to create common helper functions
 + ref-filter.c: rename 'ref_filter_handler()' to 'filter_one()'
 + ref-filter.h: add functions for filter/format & format-only
 + ref-filter.h: move contains caches into filter
 + ref-filter.h: add max_count and omit_empty to ref_format
 + ref-filter.c: really don't sort when using --no-sort

 "git for-each-ref --no-sort" still sorted the refs alphabetically
 which paid non-trivial cost.  It has been redefined to show output
 in an unspecified order, to allow certain optimizations to take
 advantage of.

 Will cook in 'next'.
 source: <pull.1609.v2.git.1699991638.gitgitgadget@gmail.com>


* jw/git-add-attr-pathspec (2023-11-04) 1 commit
  (merged to 'next' on 2023-11-13 at b61be94e4d)
 + attr: enable attr pathspec magic for git-add and git-stash

 "git add" and "git stash" learned to support the ":(attr:...)"
 magic pathspec.

 Will cook in 'next'.
 source: <20231103163449.1578841-1-jojwang@google.com>


* ps/ci-gitlab (2023-11-09) 8 commits
  (merged to 'next' on 2023-11-10 at ea7ed67945)
 + ci: add support for GitLab CI
 + ci: install test dependencies for linux-musl
 + ci: squelch warnings when testing with unusable Git repo
 + ci: unify setup of some environment variables
 + ci: split out logic to set up failed test artifacts
 + ci: group installation of Docker dependencies
 + ci: make grouping setup more generic
 + ci: reorder definitions for grouping functions
 (this branch is used by js/ci-discard-prove-state.)

 Add support for GitLab CI.

 Will cook in 'next'.
 source: <cover.1699514143.git.ps@pks.im>


* ps/ref-tests-update (2023-11-03) 10 commits
  (merged to 'next' on 2023-11-13 at dc26e55d6f)
 + t: mark several tests that assume the files backend with REFFILES
 + t7900: assert the absence of refs via git-for-each-ref(1)
 + t7300: assert exact states of repo
 + t4207: delete replace references via git-update-ref(1)
 + t1450: convert tests to remove worktrees via git-worktree(1)
 + t: convert tests to not access reflog via the filesystem
 + t: convert tests to not access symrefs via the filesystem
 + t: convert tests to not write references via the filesystem
 + t: allow skipping expected object ID in `ref-store update-ref`
 + Merge branch 'ps/show-ref' into ps/ref-tests-update

 Update ref-related tests.

 Will cook in 'next'.
 source: <cover.1698914571.git.ps@pks.im>


* jx/fetch-atomic-error-message-fix (2023-10-19) 2 commits
 - fetch: no redundant error message for atomic fetch
 - t5574: test porcelain output of atomic fetch

 "git fetch --atomic" issued an unnecessary empty error message,
 which has been corrected.

 Expecting an update.
 cf. <ZTjQIrCgSANAT8wR@tanuki>
 source: <ced46baeb1c18b416b4b4cc947f498bea2910b1b.1697725898.git.zhiyou.jx@alibaba-inc.com>


* js/bugreport-in-the-same-minute (2023-10-16) 1 commit
 - bugreport: include +i in outfile suffix as needed

 Instead of auto-generating a filename that is already in use for
 output and fail the command, `git bugreport` learned to fuzz the
 filename to avoid collisions with existing files.

 Expecting a reroll.
 cf. <ZTtZ5CbIGETy1ucV.jacob@initialcommit.io>
 source: <20231016214045.146862-2-jacob@initialcommit.io>


* kh/t7900-cleanup (2023-10-17) 9 commits
 - t7900: fix register dependency
 - t7900: factor out packfile dependency
 - t7900: fix `print-args` dependency
 - t7900: fix `pfx` dependency
 - t7900: factor out common schedule setup
 - t7900: factor out inheritance test dependency
 - t7900: create commit so that branch is born
 - t7900: setup and tear down clones
 - t7900: remove register dependency

 Test clean-up.

 Perhaps discard?
 cf. <655ca147-c214-41be-919d-023c1b27b311@app.fastmail.com>
 source: <cover.1697319294.git.code@khaugsbakk.name>


* tb/merge-tree-write-pack (2023-10-23) 5 commits
 - builtin/merge-tree.c: implement support for `--write-pack`
 - bulk-checkin: introduce `index_tree_bulk_checkin_incore()`
 - bulk-checkin: introduce `index_blob_bulk_checkin_incore()`
 - bulk-checkin: generify `stream_blob_to_pack()` for arbitrary types
 - bulk-checkin: extract abstract `bulk_checkin_source`

 "git merge-tree" learned "--write-pack" to record its result
 without creating loose objects.

 Broken when an object created during a merge is needed to continue merge
 cf. <CABPp-BEfy9VOvimP9==ry_rZXu=metOQ8s=_-XiG_Pdx9c06Ww@mail.gmail.com>
 source: <cover.1698101088.git.me@ttaylorr.com>


* 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
 (this branch uses jk/chunk-bounds-more.)

 Further code clean-up.

 Needs review.
 source: <cover.1699569246.git.me@ttaylorr.com>


* tb/path-filter-fix (2023-10-18) 17 commits
 - bloom: introduce `deinit_bloom_filters()`
 - commit-graph: reuse existing Bloom filters where possible
 - object.h: fix mis-aligned flag bits table
 - commit-graph: drop unnecessary `graph_read_bloom_data_context`
 - commit-graph.c: unconditionally load Bloom filters
 - bloom: prepare to discard incompatible Bloom filters
 - bloom: annotate filters with hash version
 - commit-graph: new filter ver. that fixes murmur3
 - 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.

 Needs (hopefully final and quick) review.
 source: <cover.1697653929.git.me@ttaylorr.com>


* cc/git-replay (2023-11-16) 14 commits
 - replay: stop assuming replayed branches do not diverge
 - replay: add --contained to rebase contained branches
 - replay: add --advance or 'cherry-pick' mode
 - replay: use standard revision ranges
 - replay: make it a minimal server side command
 - replay: remove HEAD related sanity check
 - replay: remove progress and info output
 - replay: add an important FIXME comment about gpg signing
 - replay: change rev walking options
 - replay: introduce pick_regular_commit()
 - replay: die() instead of failing assert()
 - replay: start using parse_options API
 - replay: introduce new builtin
 - t6429: remove switching aspects of fast-rebase

 Introduce "git replay", a tool meant on the server side without
 working tree to recreate a history.
 source: <20231115143327.2441397-1-christian.couder@gmail.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>


* js/update-urls-in-doc-and-comment (2023-09-26) 4 commits
 - doc: refer to internet archive
 - doc: update links for andre-simon.de
 - doc: update links to current pages
 - doc: switch links to https

 Stale URLs have been updated to their current counterparts (or
 archive.org) and HTTP links are replaced with working HTTPS links.

 Needs review.
 source: <pull.1589.v2.git.1695553041.gitgitgadget@gmail.com>


* la/trailer-cleanups (2023-10-20) 3 commits
 - trailer: use offsets for trailer_start/trailer_end
 - trailer: find the end of the log message
 - commit: ignore_non_trailer computes number of bytes to ignore

 Code clean-up.

 Comments?
 source: <pull.1563.v5.git.1697828495.gitgitgadget@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>


* jx/remote-archive-over-smart-http (2023-10-04) 4 commits
 - archive: support remote archive from stateless transport
 - transport-helper: call do_take_over() in connect_helper
 - transport-helper: call do_take_over() in process_connect
 - transport-helper: no connection restriction in connect_helper

 "git archive --remote=<remote>" learned to talk over the smart
 http (aka stateless) transport.

 Needs review.
 source: <cover.1696432593.git.zhiyou.jx@alibaba-inc.com>


* jx/sideband-chomp-newline-fix (2023-10-04) 3 commits
 - pkt-line: do not chomp newlines for sideband messages
 - pkt-line: memorize sideband fragment in reader
 - test-pkt-line: add option parser for unpack-sideband

 Sideband demultiplexer fixes.

 Needs review.
 source: <cover.1696425168.git.zhiyou.jx@alibaba-inc.com>


* js/config-parse (2023-09-21) 5 commits
 - config-parse: split library out of config.[c|h]
 - config.c: accept config_parse_options in git_config_from_stdin
 - config: report config parse errors using cb
 - config: split do_event() into start and flush operations
 - config: split out config_parse_options

 The parsing routines for the configuration files have been split
 into a separate file.

 Needs review.
 source: <cover.1695330852.git.steadmon@google.com>


* jc/fake-lstat (2023-09-15) 1 commit
 - cache: add fake_lstat()
 (this branch is used by jc/diff-cached-fsmonitor-fix.)

 A new helper to let us pretend that we called lstat() when we know
 our cache_entry is up-to-date via fsmonitor.

 Needs review.
 source: <xmqqcyykig1l.fsf@gitster.g>


* js/doc-unit-tests (2023-11-10) 3 commits
  (merged to 'next' on 2023-11-10 at 7d00ffd06b)
 + ci: run unit tests in CI
 + unit tests: add TAP unit test framework
 + unit tests: add a project plan document
 (this branch is used by js/doc-unit-tests-with-cmake.)

 Process to add some form of low-level unit tests has started.

 Will cook in 'next'.
 source: <cover.1699555664.git.steadmon@google.com>


* js/doc-unit-tests-with-cmake (2023-11-10) 7 commits
  (merged to 'next' on 2023-11-10 at b4503c9c8c)
 + cmake: handle also unit tests
 + cmake: use test names instead of full paths
 + cmake: fix typo in variable name
 + artifacts-tar: when including `.dll` files, don't forget the unit-tests
 + unit-tests: do show relative file paths
 + unit-tests: do not mistake `.pdb` files for being executable
 + cmake: also build unit tests
 (this branch uses js/doc-unit-tests.)

 Update the base topic to work with CMake builds.

 Will cook in 'next'.
 source: <pull.1579.v3.git.1695640836.gitgitgadget@gmail.com>


* 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>


* rj/status-bisect-while-rebase (2023-10-16) 1 commit
 - status: fix branch shown when not only bisecting

 "git status" is taught to show both the branch being bisected and
 being rebased when both are in effect at the same time.

 Needs review.
 source: <2e24ca9b-9c5f-f4df-b9f8-6574a714dfb2@gmail.com>

--------------------------------------------------
[Discarded]

* jc/strbuf-comment-line-char (2023-11-01) 4 commits
 . strbuf: move env-using functions to environment.c
 . strbuf: make add_lines() public
 . strbuf_add_commented_lines(): drop the comment_line_char parameter
 . strbuf_commented_addf(): drop the comment_line_char parameter

 Code simplification that goes directly against a past libification
 topic.  It is hard to judge because the "libification" is done
 piecewise without seemingly clear design principle.

 Will discard.
 source: <cover.1698791220.git.jonathantanmy@google.com>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox