Skip to content
Open

Jch #2059

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
fb78702
refs: avoid "too many arguments"
gitster Aug 6, 2024
becacd2
cat-file: avoid "too many arguments"
gitster Aug 6, 2024
2446e8f
notes: avoid "too many arguments"
gitster Aug 6, 2024
6c8ee88
miscellaneous: avoid "too many arguments"
gitster Aug 6, 2024
1e77bf0
packfile: move sizep computation
peff Aug 23, 2024
117addc
packfile: allow content-limit for cat-file
peff Aug 23, 2024
b2df0c0
packfile: fix off-by-one in content_limit comparison
Aug 23, 2024
a5f683f
packfile: inline cache_or_unpack_entry
Aug 23, 2024
98521d6
cat-file: use delta_base_cache entries directly
Aug 23, 2024
28402bc
packfile: packed_object_info avoids packed_to_object_type
Aug 23, 2024
7d4e4d5
object_info: content_limit only applies to blobs
Aug 23, 2024
489810f
cat-file: batch-command uses content_limit
Aug 23, 2024
1732dda
cat-file: batch_write: use size_t for length
Aug 23, 2024
f043683
cat-file: use writev(2) if available
Aug 23, 2024
31c5b4b
version: refactor strbuf_sanitize()
chriscool Sep 10, 2024
8afd0ee
strbuf: refactor strbuf_trim_trailing_ch()
chriscool Sep 10, 2024
3cb155a
Add 'promisor-remote' capability to protocol v2
chriscool Sep 10, 2024
bc0c4e1
promisor-remote: check advertised name or URL
chriscool Sep 10, 2024
82d283c
t7500: make each piece more independent
gitster Oct 14, 2024
dbafaff
config: values of pathname type can be prefixed with :(optional)
gitster Oct 14, 2024
2da08f2
parseopt: values of pathname type can be prefixed with :(optional)
gitster Oct 14, 2024
bed4d80
builtin/ls-remote: plug leaking server options
pks-t Oct 21, 2024
bfac141
t/helper: fix leaks in "reach" test tool
pks-t Oct 21, 2024
f4bb632
grep: fix leak in `grep_splice_or()`
pks-t Oct 21, 2024
4042f03
builtin/grep: fix leak with `--max-count=0`
pks-t Oct 21, 2024
ab28bc8
revision: fix leaking bloom filters
pks-t Oct 21, 2024
27a1c1f
diff-lib: fix leaking diffopts in `do_diff_cache()`
pks-t Oct 21, 2024
c0a1026
pretty: clear signature check
pks-t Oct 21, 2024
5ca4de4
upload-pack: fix leaking URI protocols
pks-t Oct 21, 2024
27164f7
builtin/commit: fix leaking change data contents
pks-t Oct 21, 2024
ecbb58e
trailer: fix leaking trailer values
pks-t Oct 21, 2024
9d0482d
trailer: fix leaking strbufs when formatting trailers
pks-t Oct 21, 2024
06d6581
builtin/commit: fix leaking cleanup config
pks-t Oct 21, 2024
7c66167
transport-helper: fix leaking import/export marks
pks-t Oct 21, 2024
8eded2f
builtin/tag: fix leaking key ID on failure to sign
pks-t Oct 21, 2024
9a2c5b0
combine-diff: fix leaking lost lines
pks-t Oct 21, 2024
8977bcf
dir: release untracked cache data
pks-t Oct 21, 2024
1fe066c
sparse-index: correctly free EWAH contents
pks-t Oct 21, 2024
a4a3b8c
t/helper: stop re-initialization of `the_repository`
pks-t Oct 21, 2024
44cbc97
t/helper: fix leaking buffer in "dump-untracked-cache"
pks-t Oct 21, 2024
e0e970d
dir: fix leak when parsing "status.showUntrackedFiles"
pks-t Oct 21, 2024
3ec42f3
builtin/merge: release outbut buffer after performing merge
pks-t Oct 21, 2024
931847a
list-objects-filter-options: work around reported leak on error
pks-t Oct 21, 2024
e6e6315
reftable/system: move "dir.h" to its only user
pks-t Oct 23, 2024
ac90e9f
reftable: explicitly handle hash format IDs
pks-t Oct 23, 2024
da2d199
reftable/system: stop depending on "hash.h"
pks-t Oct 23, 2024
3c58a50
reftable/stack: stop using `fsync_component()` directly
pks-t Oct 23, 2024
3f5e8d2
reftable/system: provide thin wrapper for tempfile subsystem
pks-t Oct 23, 2024
ec282c1
reftable/stack: drop only use of `get_locked_file_path()`
pks-t Oct 23, 2024
3740325
reftable/system: provide thin wrapper for lockfile subsystem
pks-t Oct 23, 2024
ae0f757
compat/mingw: support POSIX semantics for atomic renames
pks-t Oct 27, 2024
0142990
show-index: fix uninitialized hash function
quanta-kt Oct 26, 2024
2be7127
Documentation/git-bundle.txt: mention full backup example
LemmingAvalanche Oct 29, 2024
4f68a40
Documentation/git-bundle.txt: mention --all in spec. refs
LemmingAvalanche Oct 29, 2024
c4ac5fa
Documentation/git-bundle.txt: discuss naïve backups
LemmingAvalanche Oct 29, 2024
fcae55a
fetch-pack: refactor packet writing
calvin-wan-google Oct 28, 2024
9ddf78d
fetch-pack: move fetch initialization
calvin-wan-google Oct 28, 2024
bc52916
serve: advertise object-info feature
calvin-wan-google Oct 28, 2024
8c4368d
transport: add client support for object-info
calvin-wan-google Oct 28, 2024
f1ffe74
cat-file: add declaration of variable i inside its for loop
peijianju Oct 28, 2024
999bed8
cat-file: add remote-object-info to batch-command
peijianju Oct 28, 2024
d9b67c3
path-walk: introduce an object walk by path
derrickstolee Oct 31, 2024
44425c4
test-lib-functions: add test_cmp_sorted
derrickstolee Oct 31, 2024
35e6cf9
t6601: add helper for testing path-walk API
derrickstolee Oct 31, 2024
ca51c2d
path-walk: allow consumer to specify object types
derrickstolee Oct 31, 2024
8fa5e62
path-walk: visit tags and cached objects
derrickstolee Oct 31, 2024
c99f26c
path-walk: mark trees and blobs as UNINTERESTING
derrickstolee Oct 31, 2024
d18caa1
Merge branch 'kn/arbitrary-suffixes' into jch
ttaylorr Nov 1, 2024
fbed493
Merge branch 'kn/ci-clang-format-tidy' into jch
ttaylorr Nov 1, 2024
46be1b3
Merge branch 'cw/config-extensions' into jch
ttaylorr Nov 1, 2024
1597170
Merge branch 'ps/upgrade-clar' into jch
ttaylorr Nov 1, 2024
5b107fa
###
ttaylorr Nov 1, 2024
ff12b90
Merge branch 'jk/left-right-bitmap' into jch
ttaylorr Nov 1, 2024
8f346e1
### match next
ttaylorr Nov 1, 2024
ce4ffbd
Merge branch 'ej/cat-file-remote-object-info' into jch
ttaylorr Nov 1, 2024
5215bb8
Merge branch 'ps/mingw-rename' into jch
ttaylorr Nov 1, 2024
5640c87
Merge branch 'ps/reftable-detach' into jch
ttaylorr Nov 1, 2024
7be0046
Merge branch 'cc/promisor-remote-capability' into jch
ttaylorr Nov 1, 2024
96e5742
Merge branch 'jc/too-many-arguments' into jch
ttaylorr Nov 1, 2024
04bc973
Merge branch 'ew/cat-file-optim' into jch
ttaylorr Nov 1, 2024
71cf160
Merge branch 'bc/drop-ancient-libcurl-and-perl' into jch
ttaylorr Nov 1, 2024
f0176fb
Merge branch 'jc/optional-path' into jch
ttaylorr Nov 1, 2024
ddedb0e
Merge branch 'ps/leakfixes-part-9' into jch
ttaylorr Nov 1, 2024
2f42bd7
Merge branch 'as/show-index-uninitialized-hash' into jch
ttaylorr Nov 1, 2024
c65c75b
Merge branch 'kh/bundle-docs' into jch
ttaylorr Nov 1, 2024
5212635
Merge branch 'ds/path-walk-1' into jch
ttaylorr Nov 1, 2024
515fd3a
Merge branch 'bc/ancient-ci' into jch
ttaylorr Nov 1, 2024
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
16 changes: 10 additions & 6 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ AlignConsecutiveAssignments: false
# double b = 3.14;
AlignConsecutiveDeclarations: false

# Align consecutive macro definitions.
AlignConsecutiveMacros: true

# Align escaped newlines as far left as possible
# #define A \
# int aaaa; \
Expand Down Expand Up @@ -209,13 +212,14 @@ KeepEmptyLinesAtTheStartOfBlocks: false

# Penalties
# This decides what order things should be done if a line is too long
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakAssignment: 5
PenaltyBreakBeforeFirstCallParameter: 5
PenaltyBreakComment: 5
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyBreakOpenParenthesis: 300
PenaltyBreakString: 5
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 300

# Don't sort #include's
SortIncludes: false
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,21 @@ jobs:
- jobname: linux-musl
image: alpine
distro: alpine-latest
# Supported until 2025-04-02.
- jobname: linux32
image: i386/ubuntu:focal
distro: ubuntu32-20.04
- jobname: pedantic
image: fedora
distro: fedora-latest
# A RHEL 8 compatible distro. Supported until 2029-05-31.
- jobname: almalinux-8
image: almalinux:8
distro: almalinux-8
# Supported until 2026-08-31.
- jobname: debian-11
image: debian:11
distro: debian-11
env:
jobname: ${{matrix.vector.jobname}}
distro: ${{matrix.vector.distro}}
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test:linux:
parallel:
matrix:
- jobname: linux-old
image: ubuntu:16.04
image: ubuntu:20.04
CC: gcc
- jobname: linux-sha256
image: ubuntu:latest
Expand Down
14 changes: 14 additions & 0 deletions Documentation/CodingGuidelines
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,20 @@ For C programs:
- `S_free()` releases a structure's contents and frees the
structure.

- Function names should be clear and descriptive, accurately reflecting
their purpose or behavior. Arbitrary suffixes that do not add meaningful
context can lead to confusion, particularly for newcomers to the codebase.

Historically, the '_1' suffix has been used in situations where:

- A function handles one element among a group that requires similar
processing.
- A recursive function has been separated from its setup phase.

The '_1' suffix can be used as a concise way to indicate these specific
cases. However, it is recommended to find a more descriptive name wherever
possible to improve the readability and maintainability of the code.

For Perl programs:

- Most of the C guidelines above apply.
Expand Down
5 changes: 4 additions & 1 deletion Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ compiled without runtime prefix support, the compiled-in prefix will be
substituted instead. In the unlikely event that a literal path needs to
be specified that should _not_ be expanded, it needs to be prefixed by
`./`, like so: `./%(prefix)/bin`.

+
If prefixed with `:(optional)`, the configuration variable is treated
as if it does not exist, if the named path does not exist or names an
empty file.

Variables
~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion Documentation/config/core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ default in a bare repository.

core.repositoryFormatVersion::
Internal variable identifying the repository format and layout
version.
version. See linkgit:gitrepository-layout[5].

core.sharedRepository::
When 'group' (or 'true'), the repository is made shareable between
Expand Down
73 changes: 54 additions & 19 deletions Documentation/config/extensions.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,69 @@
extensions.objectFormat::
Specify the hash algorithm to use. The acceptable values are `sha1` and
`sha256`. If not specified, `sha1` is assumed. It is an error to specify
this key unless `core.repositoryFormatVersion` is 1.
extensions.*::
Unless otherwise stated, is an error to specify an extension if
`core.repositoryFormatVersion` is not `1`. See
linkgit:gitrepository-layout[5].
+
Note that this setting should only be set by linkgit:git-init[1] or
linkgit:git-clone[1]. Trying to change it after initialization will not
work and will produce hard-to-diagnose issues.

extensions.compatObjectFormat::

--
compatObjectFormat::
Specify a compatibility hash algorithm to use. The acceptable values
are `sha1` and `sha256`. The value specified must be different from the
value of extensions.objectFormat. This allows client level
value of `extensions.objectFormat`. This allows client level
interoperability between git repositories whose objectFormat matches
this compatObjectFormat. In particular when fully implemented the
pushes and pulls from a repository in whose objectFormat matches
compatObjectFormat. As well as being able to use oids encoded in
compatObjectFormat in addition to oids encoded with objectFormat to
locally specify objects.

extensions.refStorage::
noop::
This extension does not change git's behavior at all. It is useful only
for testing format-1 compatibility.
+
For historical reasons, this extension is respected regardless of the
`core.repositoryFormatVersion` setting.

noop-v1::
This extension does not change git's behavior at all. It is useful only
for testing format-1 compatibility.

objectFormat::
Specify the hash algorithm to use. The acceptable values are `sha1` and
`sha256`. If not specified, `sha1` is assumed.
+
Note that this setting should only be set by linkgit:git-init[1] or
linkgit:git-clone[1]. Trying to change it after initialization will not
work and will produce hard-to-diagnose issues.

partialClone::
When enabled, indicates that the repo was created with a partial clone
(or later performed a partial fetch) and that the remote may have
omitted sending certain unwanted objects. Such a remote is called a
"promisor remote" and it promises that all such omitted objects can
be fetched from it in the future.
+
The value of this key is the name of the promisor remote.
+
For historical reasons, this extension is respected regardless of the
`core.repositoryFormatVersion` setting.

preciousObjects::
If enabled, indicates that objects in the repository MUST NOT be deleted
(e.g., by `git-prune` or `git repack -d`).
+
For historical reasons, this extension is respected regardless of the
`core.repositoryFormatVersion` setting.

refStorage::
Specify the ref storage format to use. The acceptable values are:
+
include::../ref-storage-format.txt[]
+
It is an error to specify this key unless `core.repositoryFormatVersion` is 1.

+
Note that this setting should only be set by linkgit:git-init[1] or
linkgit:git-clone[1]. Trying to change it after initialization will not
work and will produce hard-to-diagnose issues.

extensions.worktreeConfig::
worktreeConfig::
If enabled, then worktrees will load config settings from the
`$GIT_DIR/config.worktree` file in addition to the
`$GIT_COMMON_DIR/config` file. Note that `$GIT_COMMON_DIR` and
Expand All @@ -40,23 +73,25 @@ extensions.worktreeConfig::
`config.worktree` file will override settings from any other
config files.
+
When enabling `extensions.worktreeConfig`, you must be careful to move
When enabling this extension, you must be careful to move
certain values from the common config file to the main working tree's
`config.worktree` file, if present:
+
* `core.worktree` must be moved from `$GIT_COMMON_DIR/config` to
`$GIT_COMMON_DIR/config.worktree`.
* If `core.bare` is true, then it must be moved from `$GIT_COMMON_DIR/config`
to `$GIT_COMMON_DIR/config.worktree`.

+
It may also be beneficial to adjust the locations of `core.sparseCheckout`
and `core.sparseCheckoutCone` depending on your desire for customizable
sparse-checkout settings for each worktree. By default, the `git
sparse-checkout` builtin enables `extensions.worktreeConfig`, assigns
sparse-checkout` builtin enables this extension, assigns
these config values on a per-worktree basis, and uses the
`$GIT_DIR/info/sparse-checkout` file to specify the sparsity for each
worktree independently. See linkgit:git-sparse-checkout[1] for more
details.
+
For historical reasons, `extensions.worktreeConfig` is respected
regardless of the `core.repositoryFormatVersion` setting.
For historical reasons, this extension is respected regardless of the
`core.repositoryFormatVersion` setting.
--
27 changes: 27 additions & 0 deletions Documentation/config/promisor.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
promisor.quiet::
If set to "true" assume `--quiet` when fetching additional
objects for a partial clone.

promisor.advertise::
If set to "true", a server will use the "promisor-remote"
capability, see linkgit:gitprotocol-v2[5], to advertise the
promisor remotes it is using, if it uses some. Default is
"false", which means the "promisor-remote" capability is not
advertised.

promisor.acceptFromServer::
If set to "all", a client will accept all the promisor remotes
a server might advertise using the "promisor-remote"
capability. If set to "knownName" the client will accept
promisor remotes which are already configured on the client
and have the same name as those advertised by the client. This
is not very secure, but could be used in a corporate setup
where servers and clients are trusted to not switch name and
URLs. If set to "knownUrl", the client will accept promisor
remotes which have both the same name and the same URL
configured on the client as the name and URL advertised by the
server. This is more secure than "all" or "knownUrl", so it
should be used if possible instead of those options. Default
is "none", which means no promisor remote advertised by a
server will be accepted. By accepting a promisor remote, the
client agrees that the server might omit objects that are
lazily fetchable from this promisor remote from its responses
to "fetch" and "clone" requests from the client. See
linkgit:gitprotocol-v2[5].
22 changes: 17 additions & 5 deletions Documentation/git-bundle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ the "offline" transfer of Git objects without an active "server"
sitting on the other side of the network connection.

They can be used to create both incremental and full backups of a
repository, and to relay the state of the references in one repository
to another.
repository (`git bundle create <file> --all`), and to relay the state of
the references in one repository to another.

Git commands that fetch or otherwise "read" via protocols such as
`ssh://` and `https://` can also operate on bundle files. It is
Expand Down Expand Up @@ -132,7 +132,7 @@ SPECIFYING REFERENCES
---------------------

Revisions must be accompanied by reference names to be packaged in a
bundle.
bundle. Alternatively `--all` can be used to package all refs.

More than one reference may be packaged, and more than one set of prerequisite objects can
be specified. The objects packaged are those not contained in the
Expand Down Expand Up @@ -203,8 +203,6 @@ It is okay to err on the side of caution, causing the bundle file
to contain objects already in the destination, as these are ignored
when unpacking at the destination.

If you want to match `git clone --mirror`, which would include your
refs such as `refs/remotes/*`, use `--all`.
If you want to provide the same set of refs that a clone directly
from the source repository would get, use `--branches --tags` for
the `<git-rev-list-args>`.
Expand Down Expand Up @@ -321,6 +319,20 @@ You can also see what references it offers:
$ git ls-remote mybundle
----------------

DISCUSSION
----------

A naive way to make a full backup of a repository is to use something to
the effect of `cp -a <repo> <destination>`. This is discouraged since
the repository could be written to during the copy operation. In turn
some files at `<destination>` could be corrupted.

This is why it is recommended to use Git tooling for making repository
backups, either with this command or with e.g. linkgit:git-clone[1].

See also linkgit:gitfaq[7], section "TRANSFERS" for a discussion of the
problems associated with file syncing across systems.

FILE FORMAT
-----------

Expand Down
24 changes: 20 additions & 4 deletions Documentation/git-cat-file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ info <object>::
Print object info for object reference `<object>`. This corresponds to the
output of `--batch-check`.

remote-object-info <remote> <object>...::
Print object info for object references `<object>` at specified <remote> without
downloading objects from remote. If the object-info capability is not
supported by the server, the objects will be downloaded instead.
Error when no object references are provided.
This command may be combined with `--buffer`.

flush::
Used with `--buffer` to execute all preceding commands that were issued
since the beginning or since the last flush was issued. When `--buffer`
Expand Down Expand Up @@ -290,21 +297,23 @@ newline. The available atoms are:
The full hex representation of the object name.

`objecttype`::
The type of the object (the same as `cat-file -t` reports).
The type of the object (the same as `cat-file -t` reports). See
`CAVEATS` below. Not supported by `remote-object-info`.

`objectsize`::
The size, in bytes, of the object (the same as `cat-file -s`
reports).

`objectsize:disk`::
The size, in bytes, that the object takes up on disk. See the
note about on-disk sizes in the `CAVEATS` section below.
note about on-disk sizes in the `CAVEATS` section below. Not
supported by `remote-object-info`.

`deltabase`::
If the object is stored as a delta on-disk, this expands to the
full hex representation of the delta base object name.
Otherwise, expands to the null OID (all zeroes). See `CAVEATS`
below.
below. Not supported by `remote-object-info`.

`rest`::
If this atom is used in the output string, input lines are split
Expand All @@ -314,7 +323,10 @@ newline. The available atoms are:
line) are output in place of the `%(rest)` atom.

If no format is specified, the default format is `%(objectname)
%(objecttype) %(objectsize)`.
%(objecttype) %(objectsize)`, except for `remote-object-info` commands which use
`%(objectname) %(objectsize)` for now because "%(objecttype)" is not supported yet.
WARNING: When "%(objecttype)" is supported, the default format WILL be unified, so
DO NOT RELY on the current the default format to stay the same!!!

If `--batch` is specified, or if `--batch-command` is used with the `contents`
command, the object information is followed by the object contents (consisting
Expand Down Expand Up @@ -396,6 +408,10 @@ scripting purposes.
CAVEATS
-------

Note that since %(objecttype), %(objectsize:disk) and %(deltabase) are
currently not supported by the `remote-object-info` command, we will error
and exit when they are in the format string.

Note that the sizes of objects on disk are reported accurately, but care
should be taken in drawing conclusions about which refs or objects are
responsible for disk usage. The size of a packed non-delta object may be
Expand Down
Loading
Loading