Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
1e2574e
Merge branch 'ds/partial-bundle-more' into ab/plug-leak-in-revisions
gitster Apr 3, 2022
b925fcf
t/helper/test-fast-rebase.c: don't leak "struct strbuf"
avar Apr 13, 2022
4b59b2d
blame: use "goto cleanup" for cleanup_scoreboard()
avar Apr 13, 2022
f260505
string_list API users: use string_list_init_{no,}dup
avar Apr 13, 2022
89f45cf
format-patch: don't leak "extra_headers" or "ref_message_ids"
avar Apr 13, 2022
bf20fe4
cocci: add and apply free_commit_list() rules
avar Apr 13, 2022
1878b5e
revision.[ch]: provide and start using a release_revisions()
avar Apr 13, 2022
2108fe4
revisions API users: add straightforward release_revisions()
avar Apr 13, 2022
296a143
revision.[ch]: document and move code declared around "init"
avar Apr 13, 2022
f196c1e
revisions API users: use release_revisions() needing REV_INFO_INIT
avar Apr 13, 2022
5e48017
stash: always have the owner of "stash_info" free it
avar Apr 13, 2022
0139c58
revisions API users: add "goto cleanup" for release_revisions()
avar Apr 13, 2022
b78ce33
revisions API users: use release_revisions() in http-push.c
avar Apr 13, 2022
f6bfea0
revisions API users: use release_revisions() in builtin/log.c
avar Apr 13, 2022
bf1b32d
revisions API users: use release_revisions() with UNLEAK()
avar Apr 13, 2022
f0cb6b8
revisions API users: use release_revisions() for "prune_data" users
avar Apr 13, 2022
e966fc5
revisions API: have release_revisions() release "commits"
avar Apr 13, 2022
a52f07a
revisions API: have release_revisions() release "mailmap"
avar Apr 13, 2022
7a98d9a
revisions API: have release_revisions() release "cmdline"
avar Apr 13, 2022
e75d2f7
revisions API: have release_revisions() release "filter"
avar Apr 13, 2022
f41fb66
revisions API: have release_revisions() release "grep_filter"
avar Apr 13, 2022
689a8e8
revisions API: have release_revisions() release "prune_data"
avar Apr 13, 2022
ab1f692
revisions API: clear "boundary_commits" in release_revisions()
avar Apr 13, 2022
81ffbf8
revisions API: release "reflog_info" in release revisions()
avar Apr 13, 2022
6ab75ac
revisions API: call diff_free(&revs->pruning) in revisions_release()
avar Apr 13, 2022
9d5a7df
revisions API: have release_revisions() release "date_mode"
avar Apr 14, 2022
ae1b383
revisions API: have release_revisions() release "topo_walk_info"
avar Apr 14, 2022
54c8a7c
revisions API: add a TODO for diff_free(&revs->diffopt)
avar Apr 14, 2022
863d6ce
ci: fix code style
dscho May 21, 2022
78d5e4c
tests: refactor --write-junit-xml code
dscho May 21, 2022
270ccd2
test(junit): avoid line feeds in XML attributes
dscho May 21, 2022
b95181c
ci/run-build-and-tests: take a more high-level view
dscho May 21, 2022
08dccc8
ci: make it easier to find failed tests' logs in the GitHub workflow
dscho May 21, 2022
dab73ae
ci/run-build-and-tests: add some structure to the GitHub workflow output
dscho May 21, 2022
0f5ae59
ci: optionally mark up output in the GitHub workflow
dscho May 21, 2022
448de90
ci(github): skip the logs of the successful test cases
dscho May 21, 2022
110e911
ci(github): avoid printing test case preamble twice
vdye May 21, 2022
0068c82
ci: use `--github-workflow-markup` in the GitHub workflow
dscho May 21, 2022
aeea008
ci(github): mention where the full logs can be found
dscho May 21, 2022
3069f2a
ci: call `finalize_test_case_output` a little later
dscho May 21, 2022
a561962
cmake: fix CMakeLists.txt on Linux
Berrysoft May 24, 2022
8043151
cmake: add pcre2 support
Berrysoft May 24, 2022
5ec7110
cmake: remove (_)UNICODE def on Windows in CMakeLists.txt
Berrysoft May 24, 2022
6448182
transport: remove unnecessary indenting in transport_push()
fhrbata May 20, 2022
35919bf
transport: unify return values and exit point from transport_push()
fhrbata May 20, 2022
8c49d70
transport: free local and remote refs in transport_push()
fhrbata May 20, 2022
a759106
archive: improve documentation of --prefix
rscharfe May 28, 2022
23f2356
Merge branch 'rs/document-archive-prefix' into js/scalar-diagnose
gitster May 28, 2022
b02fdbc
pathspec: correct an empty string used as a pathspec element
gitster May 29, 2022
237a1d1
archive: optionally add "virtual" files
dscho May 28, 2022
de1f68a
archive --add-virtual-file: allow paths containing colons
dscho May 28, 2022
b448557
scalar: validate the optional enlistment argument
dscho May 28, 2022
aa5c79a
scalar: implement `scalar diagnose`
dscho May 28, 2022
0ed5b13
scalar diagnose: include disk space information
dscho May 28, 2022
93e804b
scalar: teach `diagnose` to gather packfile info
mjcheetham May 28, 2022
15d8adc
scalar: teach `diagnose` to gather loose objects information
mjcheetham May 28, 2022
f31b624
Merge branch 'yw/cmake-updates'
gitster Jun 7, 2022
2da81d1
Merge branch 'ab/plug-leak-in-revisions'
gitster Jun 7, 2022
fc5a070
Merge branch 'js/ci-github-workflow-markup'
gitster Jun 7, 2022
07a4540
Merge branch 'fh/transport-push-leakfix'
gitster Jun 7, 2022
006fd83
Merge branch 'rs/document-archive-prefix'
gitster Jun 7, 2022
08baf19
Merge branch 'js/scalar-diagnose'
gitster Jun 7, 2022
f008095
Merge branch 'jc/all-negative-pathspec'
gitster Jun 7, 2022
9c897ee
Eighth batch
gitster Jun 7, 2022
596838d
Merge branch 'js/ci-gcc-12-fixes' into maint
gitster Jun 8, 2022
79d1e6d
Merge branch 'jc/http-clear-finished-pointer' into maint
gitster Jun 8, 2022
b8117d2
Merge branch 'jc/update-ozlabs-url' into maint
gitster Jun 8, 2022
c47b89c
Merge branch 'jc/show-branch-g-current' into maint
gitster Jun 8, 2022
9d13041
Merge branch 'jc/archive-add-file-normalize-mode' into maint
gitster Jun 8, 2022
f02e234
Merge branch 'ab/valgrind-fixes' into maint
gitster Jun 8, 2022
080b062
Merge branch 'cb/ci-make-p4-optional' into maint
gitster Jun 8, 2022
a5a5273
Merge branch 'mg/detect-compiler-in-c-locale' into maint
gitster Jun 8, 2022
ac8f6b6
Merge branch 'rs/commit-summary-wo-break-rewrite' into maint
gitster Jun 8, 2022
d777ef9
Merge branch 'pw/test-malloc-with-sanitize-address' into maint
gitster Jun 8, 2022
363d54f
Merge branch 'ah/rebase-keep-base-fix' into maint
gitster Jun 8, 2022
67c305f
Merge branch 'ds/midx-normalize-pathname-before-comparison' into maint
gitster Jun 8, 2022
d2b11e0
Merge branch 'jc/clone-remote-name-leak-fix' into maint
gitster Jun 8, 2022
dc8c8de
Prepare for 2.36.2
gitster Jun 8, 2022
1e59178
Sync with 'maint'
gitster Jun 8, 2022
6703df6
unpack-objects: low memory footprint for get_data() in dry_run mode
chiyutianyi Jan 20, 2022
6e289d2
object-file.c: do fsync() and close() before post-write die()
avar Feb 1, 2022
46f9def
object-file.c: refactor write_loose_object() to several steps
chiyutianyi Jan 20, 2022
5a95ebe
object-file.c: factor out deflate part of write_loose_object()
avar Mar 18, 2022
2684754
object-file.c: add "stream_loose_object()" to handle large object
chiyutianyi Jan 20, 2022
eb962b6
core doc: modernize core.bigFileThreshold documentation
avar Feb 1, 2022
88a2754
unpack-objects: use stream_loose_object() to unpack large objects
chiyutianyi Jan 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ jobs:
- name: test
shell: bash
run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
- name: ci/print-test-failures.sh
if: failure()
shell: bash
run: ci/print-test-failures.sh
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -204,10 +200,6 @@ jobs:
env:
NO_SVN_TESTS: 1
run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
- name: ci/print-test-failures.sh
if: failure()
shell: bash
run: ci/print-test-failures.sh
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -261,8 +253,6 @@ jobs:
- uses: actions/checkout@v2
- run: ci/install-dependencies.sh
- run: ci/run-build-and-tests.sh
- run: ci/print-test-failures.sh
if: failure()
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -292,8 +282,6 @@ jobs:
- uses: actions/checkout@v1
- run: ci/install-docker-dependencies.sh
- run: ci/run-build-and-tests.sh
- run: ci/print-test-failures.sh
if: failure()
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v1
Expand Down
50 changes: 50 additions & 0 deletions Documentation/RelNotes/2.36.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Git v2.36.2 Release Notes
=========================

This maintenance release is primarily to merge down updates to the
build and CI procedures from the 'master' front, in order to ensure
that we can cut healthy maintenance releases in the future. It also
contains a handful of small and trivially-correct bugfixes.

Fixes since v2.36.1
-------------------

* Fixes real problems noticed by gcc 12 and works around false
positives.

* Update URL to the gitk repository.

* The "--current" option of "git show-branch" should have been made
incompatible with the "--reflog" mode, but this was not enforced,
which has been corrected.

* "git archive --add-file=<path>" picked up the raw permission bits
from the path and propagated to zip output in some cases, without
normalization, which has been corrected (tar output did not have
this issue).

* A bit of test framework fixes with a few fixes to issues found by
valgrind.

* macOS CI jobs have been occasionally flaky due to tentative version
skew between perforce and the homebrew packager. Instead of
failing the whole CI job, just let it skip the p4 tests when this
happens.

* The commit summary shown after making a commit is matched to what
is given in "git status" not to use the break-rewrite heuristics.

* Avoid problems from interaction between malloc_check and address
sanitizer.

* "git rebase --keep-base <upstream> <branch-to-rebase>" computed the
commit to rebase onto incorrectly, which has been corrected.

* The path taken by "git multi-pack-index" command from the end user
was compared with path internally prepared by the tool withut first
normalizing, which lead to duplicated paths not being noticed,
which has been corrected.

* "git clone --origin X" leaked piece of memory that held value read
from the clone.defaultRemoteName configuration variable, which has
been plugged.
13 changes: 13 additions & 0 deletions Documentation/RelNotes/2.37.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Performance, Internal Implementation, Development Support etc.
no longer version controlled and it is local responsibility of
translaters to generate it.

* Plug the memory leaks from the trickiest API of all, the revision
walker.


Fixes since v2.36
Expand Down Expand Up @@ -232,6 +234,16 @@ Fixes since v2.36
avoid corrupting the repository when packsize limit is used.
(merge 66731ff921 tb/geom-repack-with-keep-and-max later to maint).

* The documentation on the interaction between "--add-file" and
"--prefix" options of "git archive" has been improved.
(merge a75910602a rs/document-archive-prefix later to maint).

* A git subcommand like "git add -p" spawns a separate git process
while relaying its command line arguments. A pathspec with only
negative elements was mistakenly passed with an empty string, which
has been corrected.
(merge b02fdbc80a jc/all-negative-pathspec later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge e6b2582da3 cm/reftable-0-length-memset later to maint).
(merge 0b75e5bf22 ab/misc-cleanup later to maint).
Expand All @@ -252,3 +264,4 @@ Fixes since v2.36
(merge af845a604d tb/receive-pack-code-cleanup later to maint).
(merge 2acf4cf001 js/ci-gcc-12-fixes later to maint).
(merge 05e280c0a6 jc/http-clear-finished-pointer later to maint).
(merge 8c49d704ef fh/transport-push-leakfix later to maint).
33 changes: 24 additions & 9 deletions Documentation/config/core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -444,17 +444,32 @@ You probably do not need to adjust this value.
Common unit suffixes of 'k', 'm', or 'g' are supported.

core.bigFileThreshold::
Files larger than this size are stored deflated, without
attempting delta compression. Storing large files without
delta compression avoids excessive memory usage, at the
slight expense of increased disk usage. Additionally files
larger than this size are always treated as binary.
The size of files considered "big", which as discussed below
changes the behavior of numerous git commands, as well as how
such files are stored within the repository. The default is
512 MiB. Common unit suffixes of 'k', 'm', or 'g' are
supported.
+
Default is 512 MiB on all platforms. This should be reasonable
for most projects as source code and other text files can still
be delta compressed, but larger binary media files won't be.
Files above the configured limit will be:
+
Common unit suffixes of 'k', 'm', or 'g' are supported.
* Stored deflated, without attempting delta compression.
+
The default limit is primarily set with this use-case in mind. With it
most projects will have their source code and other text files delta
compressed, but not larger binary media files.
+
Storing large files without delta compression avoids excessive memory
usage, at the slight expense of increased disk usage.
+
* Will be treated as if though they were labeled "binary" (see
linkgit:gitattributes[5]). This means that e.g. linkgit:git-log[1]
and linkgit:git-diff[1] will not diffs for files above this limit.
+
* Will be generally be streamed when written, which avoids excessive
memory usage, at the cost of some fixed overhead. Commands that make
use of this include linkgit:git-archive[1],
linkgit:git-fast-import[1], linkgit:git-index-pack[1],
linkgit:git-unpack-objects[1] and linkgit:git-fsck[1].

core.excludesFile::
Specifies the pathname to the file that contains patterns to
Expand Down
31 changes: 28 additions & 3 deletions Documentation/git-archive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,36 @@ OPTIONS
Report progress to stderr.

--prefix=<prefix>/::
Prepend <prefix>/ to each filename in the archive.
Prepend <prefix>/ to paths in the archive. Can be repeated; its
rightmost value is used for all tracked files. See below which
value gets used by `--add-file` and `--add-virtual-file`.

-o <file>::
--output=<file>::
Write the archive to <file> instead of stdout.

--add-file=<file>::
Add a non-tracked file to the archive. Can be repeated to add
multiple files. The path of the file in the archive is built by
concatenating the value of the last `--prefix` option (if any)
before this `--add-file` and the basename of <file>.

--add-virtual-file=<path>:<content>::
Add the specified contents to the archive. Can be repeated to add
multiple files. The path of the file in the archive is built
by concatenating the value for `--prefix` (if any) and the
basename of <file>.
by concatenating the value of the last `--prefix` option (if any)
before this `--add-virtual-file` and `<path>`.
+
The `<path>` argument can start and end with a literal double-quote
character; the contained file name is interpreted as a C-style string,
i.e. the backslash is interpreted as escape character. The path must
be quoted if it contains a colon, to avoid the colon from being
misinterpreted as the separator between the path and the contents, or
if the path begins or ends with a double-quote character.
+
The file mode is limited to a regular file, and the option may be
subject to platform-dependent command-line limits. For non-trivial
cases, write an untracked file and use `--add-file` instead.

--worktree-attributes::
Look for attributes in .gitattributes files in the working tree
Expand Down Expand Up @@ -194,6 +213,12 @@ EXAMPLES
commit on the current branch. Note that the output format is
inferred by the extension of the output file.

`git archive -o latest.tar --prefix=build/ --add-file=configure --prefix= HEAD`::

Creates a tar archive that contains the contents of the latest
commit on the current branch with no prefix and the untracked
file 'configure' with the prefix 'build/'.

`git config tar.tar.xz.command "xz -c"`::

Configure a "tar.xz" format for making LZMA-compressed tarfiles.
Expand Down
3 changes: 1 addition & 2 deletions add-interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,7 @@ static int get_modified_files(struct repository *r,
run_diff_files(&rev, 0);
}

if (ps)
clear_pathspec(&rev.prune_data);
release_revisions(&rev);
}
hashmap_clear_and_free(&s.file_map, struct pathname_entry, ent);
if (unmerged_count)
Expand Down
87 changes: 68 additions & 19 deletions archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "parse-options.h"
#include "unpack-trees.h"
#include "dir.h"
#include "quote.h"

static char const * const archive_usage[] = {
N_("git archive [<options>] <tree-ish> [<path>...]"),
Expand Down Expand Up @@ -263,6 +264,7 @@ static int queue_or_write_archive_entry(const struct object_id *oid,
struct extra_file_info {
char *base;
struct stat stat;
void *content;
};

int write_archive_entries(struct archiver_args *args,
Expand Down Expand Up @@ -331,19 +333,27 @@ int write_archive_entries(struct archiver_args *args,

put_be64(fake_oid.hash, i + 1);

strbuf_reset(&path_in_archive);
if (info->base)
strbuf_addstr(&path_in_archive, info->base);
strbuf_addstr(&path_in_archive, basename(path));

strbuf_reset(&content);
if (strbuf_read_file(&content, path, info->stat.st_size) < 0)
err = error_errno(_("cannot read '%s'"), path);
else
err = write_entry(args, &fake_oid, path_in_archive.buf,
path_in_archive.len,
if (!info->content) {
strbuf_reset(&path_in_archive);
if (info->base)
strbuf_addstr(&path_in_archive, info->base);
strbuf_addstr(&path_in_archive, basename(path));

strbuf_reset(&content);
if (strbuf_read_file(&content, path, info->stat.st_size) < 0)
err = error_errno(_("cannot read '%s'"), path);
else
err = write_entry(args, &fake_oid, path_in_archive.buf,
path_in_archive.len,
canon_mode(info->stat.st_mode),
content.buf, content.len);
} else {
err = write_entry(args, &fake_oid,
path, strlen(path),
canon_mode(info->stat.st_mode),
content.buf, content.len);
info->content, info->stat.st_size);
}

if (err)
break;
}
Expand Down Expand Up @@ -493,6 +503,7 @@ static void extra_file_info_clear(void *util, const char *str)
{
struct extra_file_info *info = util;
free(info->base);
free(info->content);
free(info);
}

Expand All @@ -514,14 +525,49 @@ static int add_file_cb(const struct option *opt, const char *arg, int unset)
if (!arg)
return -1;

path = prefix_filename(args->prefix, arg);
item = string_list_append_nodup(&args->extra_files, path);
item->util = info = xmalloc(sizeof(*info));
info = xmalloc(sizeof(*info));
info->base = xstrdup_or_null(base);
if (stat(path, &info->stat))
die(_("File not found: %s"), path);
if (!S_ISREG(info->stat.st_mode))
die(_("Not a regular file: %s"), path);

if (!strcmp(opt->long_name, "add-file")) {
path = prefix_filename(args->prefix, arg);
if (stat(path, &info->stat))
die(_("File not found: %s"), path);
if (!S_ISREG(info->stat.st_mode))
die(_("Not a regular file: %s"), path);
info->content = NULL; /* read the file later */
} else if (!strcmp(opt->long_name, "add-virtual-file")) {
struct strbuf buf = STRBUF_INIT;
const char *p = arg;

if (*p != '"')
p = strchr(p, ':');
else if (unquote_c_style(&buf, p, &p) < 0)
die(_("unclosed quote: '%s'"), arg);

if (!p || *p != ':')
die(_("missing colon: '%s'"), arg);

if (p == arg)
die(_("empty file name: '%s'"), arg);

path = buf.len ?
strbuf_detach(&buf, NULL) : xstrndup(arg, p - arg);

if (args->prefix) {
char *save = path;
path = prefix_filename(args->prefix, path);
free(save);
}
memset(&info->stat, 0, sizeof(info->stat));
info->stat.st_mode = S_IFREG | 0644;
info->content = xstrdup(p + 1);
info->stat.st_size = strlen(info->content);
} else {
BUG("add_file_cb() called for %s", opt->long_name);
}
item = string_list_append_nodup(&args->extra_files, path);
item->util = info;

return 0;
}

Expand Down Expand Up @@ -554,6 +600,9 @@ static int parse_archive_args(int argc, const char **argv,
{ OPTION_CALLBACK, 0, "add-file", args, N_("file"),
N_("add untracked file to archive"), 0, add_file_cb,
(intptr_t)&base },
{ OPTION_CALLBACK, 0, "add-virtual-file", args,
N_("path:content"), N_("add untracked file to archive"), 0,
add_file_cb, (intptr_t)&base },
OPT_STRING('o', "output", &output, N_("file"),
N_("write the archive to this file")),
OPT_BOOL(0, "worktree-attributes", &worktree_attributes,
Expand Down
Loading