summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/main.yml4
-rw-r--r--Documentation/RelNotes/2.30.1.txt55
-rw-r--r--Documentation/RelNotes/2.31.0.txt53
-rw-r--r--Documentation/diff-generate-patch.txt6
-rw-r--r--Documentation/diff-options.txt51
-rw-r--r--Documentation/git-fsck.txt8
-rw-r--r--Documentation/git-log.txt46
-rw-r--r--Documentation/git-ls-files.txt8
-rw-r--r--Documentation/git-show.txt7
-rw-r--r--Documentation/rev-list-options.txt5
-rw-r--r--Documentation/technical/index-format.txt42
-rw-r--r--Documentation/technical/packfile-uri.txt7
-rw-r--r--Makefile29
-rw-r--r--builtin/branch.c47
-rw-r--r--builtin/describe.c2
-rw-r--r--builtin/diff-files.c5
-rw-r--r--builtin/diff.c9
-rw-r--r--builtin/gc.c8
-rw-r--r--builtin/log.c22
-rw-r--r--builtin/ls-files.c81
-rw-r--r--builtin/merge.c3
-rw-r--r--builtin/pack-objects.c10
-rw-r--r--builtin/show-ref.c2
-rw-r--r--builtin/tag.c44
-rw-r--r--cache-tree.c30
-rw-r--r--commit-graph.c2
-rw-r--r--diff-merges.c146
-rw-r--r--diff-merges.h24
-rw-r--r--fmt-merge-msg.c3
-rw-r--r--git-compat-util.h7
-rw-r--r--log-tree.c30
-rw-r--r--ls-refs.c8
-rw-r--r--merge-ort.c671
-rw-r--r--ref-filter.c74
-rw-r--r--refs.c116
-rw-r--r--refs.h27
-rw-r--r--revision.c38
-rw-r--r--revision.h9
-rw-r--r--run-command.h9
-rw-r--r--t/annotate-tests.sh8
-rw-r--r--t/helper/test-ref-store.c13
-rwxr-xr-xt/perf/p5303-many-packs.sh12
-rwxr-xr-xt/t1405-main-ref-store.sh8
-rwxr-xr-xt/t1406-submodule-ref-store.sh10
-rwxr-xr-xt/t3012-ls-files-dedup.sh66
-rwxr-xr-xt/t4013-diff-various.sh11
-rw-r--r--t/t4013/diff.log_--cc_-m_-p_master200
-rw-r--r--t/t4013/diff.log_--diff-merges=first-parent_master56
-rw-r--r--t/t4013/diff.log_-c_-m_-p_master200
-rw-r--r--t/t4013/diff.log_-p_--diff-merges=first-parent_master137
-rwxr-xr-xt/t7104-reset-hard.sh2
-rwxr-xr-xt/t7900-maintenance.sh33
-rw-r--r--t/test-lib.sh8
-rw-r--r--tree-walk.c33
-rw-r--r--unpack-trees.c5
-rw-r--r--upload-pack.c2
56 files changed, 2155 insertions, 397 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index aef6643648..f6885e88ee 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -123,6 +123,7 @@ jobs:
runs-on: windows-latest
needs: [windows-build]
strategy:
+ fail-fast: false
matrix:
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
@@ -227,6 +228,7 @@ jobs:
runs-on: windows-latest
needs: [vs-build, windows-build]
strategy:
+ fail-fast: false
matrix:
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
@@ -272,6 +274,7 @@ jobs:
needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes'
strategy:
+ fail-fast: false
matrix:
vector:
- jobname: linux-clang
@@ -309,6 +312,7 @@ jobs:
needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes'
strategy:
+ fail-fast: false
matrix:
vector:
- jobname: linux-musl
diff --git a/Documentation/RelNotes/2.30.1.txt b/Documentation/RelNotes/2.30.1.txt
new file mode 100644
index 0000000000..249ef1492f
--- /dev/null
+++ b/Documentation/RelNotes/2.30.1.txt
@@ -0,0 +1,55 @@
+Git v2.30.1 Release Notes
+=========================
+
+This release is primarily to merge fixes accumulated on the 'master'
+front to prepare for 2.31 release that are still relevant to 2.30.x
+maintenance track.
+
+Fixes since v2.30
+-----------------
+
+ * "git fetch --recurse-submodules" failed to update a submodule
+ when it has an uninitialized (hence of no interest to the user)
+ sub-submodule, which has been corrected.
+
+ * Command line error of "git rebase" are diagnosed earlier.
+
+ * "git stash" did not work well in a sparsely checked out working
+ tree.
+
+ * Some tests expect that "ls -l" output has either '-' or 'x' for
+ group executable bit, but setgid bit can be inherited from parent
+ directory and make these fields 'S' or 's' instead, causing test
+ failures.
+
+ * "git for-each-repo --config=<var> <cmd>" should not run <cmd> for
+ any repository when the configuration variable <var> is not defined
+ even once.
+
+ * "git mergetool --tool-help" was broken in 2.29 and failed to list
+ all the available tools.
+
+ * Fix for procedure to building CI test environment for mac.
+
+ * Newline characters in the host and path part of git:// URL are
+ now forbidden.
+
+ * When more than one commit with the same patch ID appears on one
+ side, "git log --cherry-pick A...B" did not exclude them all when a
+ commit with the same patch ID appears on the other side. Now it
+ does.
+
+ * Documentation for "git fsck" lost stale bits that has become
+ incorrect.
+
+ * Doc for packfile URI feature has been clarified.
+
+ * The implementation of "git branch --sort" wrt the detached HEAD
+ display has always been hacky, which has been cleaned up.
+
+ * Our setting of GitHub CI test jobs were a bit too eager to give up
+ once there is even one failure found. Tweak the knob to allow
+ other jobs keep running even when we see a failure, so that we can
+ find more failures in a single run.
+
+Also contains minor documentation updates and code clean-ups.
diff --git a/Documentation/RelNotes/2.31.0.txt b/Documentation/RelNotes/2.31.0.txt
index 7f53db7de9..905c9aa52b 100644
--- a/Documentation/RelNotes/2.31.0.txt
+++ b/Documentation/RelNotes/2.31.0.txt
@@ -48,6 +48,13 @@ UI, Workflows & Features
standard input. Also, it now does not lose refs whey they point
at the same object.
+ * "git log" learned a new "--diff-merges=<how>" option.
+
+ * "git ls-files" can and does show multiple entries when the index is
+ unmerged, which is a source for confusion unless -s/-u option is in
+ use. A new option --deduplicate has been introduced.
+
+
Performance, Internal Implementation, Development Support etc.
* A 3-year old test that was not testing anything useful has been
@@ -75,6 +82,43 @@ Performance, Internal Implementation, Development Support etc.
* "git fetch" learns to treat ref updates atomically in all-or-none
fashion, just like "git push" does, with the new "--atomic" option.
+ * The peel_ref() API has been replaced with peel_iterated_oid().
+
+ * The .use_shell flag in struct child_process that is passed to
+ run_command() API has been clarified with a bit more documentation.
+
+ * Document, clean-up and optimize the code around the cache-tree
+ extension in the index.
+
+ * The ls-refs protocol operation has been optimized to narrow the
+ sub-hierarchy of refs/ it walks to produce response.
+
+ * When removing many branches and tags, the code used to do so one
+ ref at a time. There is another API it can use to delete multiple
+ refs, and it makes quite a lot of performance difference when the
+ refs are packed.
+
+ * The "pack-objects" command needs to iterate over all the tags when
+ automatic tag following is enabled, but it actually iterated over
+ all refs and then discarded everything outside "refs/tags/"
+ hierarchy, which was quite wasteful.
+
+ * A perf script was made more portable.
+ (merge f08b6c553d jk/p5303-sed-portability-fix later to maint).
+
+ * Our setting of GitHub CI test jobs were a bit too eager to give up
+ once there is even one failure found. Tweak the knob to allow
+ other jobs keep running even when we see a failure, so that we can
+ find more failures in a single run.
+ (merge 2b0e14f640 pb/ci-matrix-wo-shortcut later to maint).
+
+ * We've carried compatibility codepaths for compilers without
+ variadic macros for quite some time, but the world may be ready for
+ them to be removed. Force compilation failure on exotic platforms
+ where variadic macros are not available to find out who screams in
+ such a way that we can easily revert if it turns out that the world
+ is not yet ready.
+
Fixes since v2.30
-----------------
@@ -127,6 +171,13 @@ Fixes since v2.30
does.
(merge c9e3a4e76d jk/log-cherry-pick-duplicate-patches later to maint).
+ * Documentation for "git fsck" lost stale bits that has become
+ incorrect.
+ (merge 28cc00a13d ab/fsck-doc-fix later to maint).
+
+ * Doc fix for packfile URI feature.
+ (merge bfc2a36ff2 jt/packfile-as-uri-doc later to maint).
+
* Other code cleanup, docfix, build fix, etc.
(merge 505a276596 pk/subsub-fetch-fix-take-2 later to maint).
(merge 33fc56253b fc/t6030-bisect-reset-removes-auxiliary-files later to maint).
@@ -146,3 +197,5 @@ Fixes since v2.30
(merge 4eb56b56e7 bc/doc-status-short later to maint).
(merge a4a1ca22ef tb/local-clone-race-doc later to maint).
(merge 6a8c89d053 ma/more-opaque-lock-file later to maint).
+ (merge 4a5ec7d166 js/skip-dashed-built-ins-from-config-mak later to maint).
+ (merge 6eaf624dea pb/blame-funcname-range-userdiff later to maint).
diff --git a/Documentation/diff-generate-patch.txt b/Documentation/diff-generate-patch.txt
index b10ff4caa6..2db8eacc3e 100644
--- a/Documentation/diff-generate-patch.txt
+++ b/Documentation/diff-generate-patch.txt
@@ -81,9 +81,9 @@ Combined diff format
Any diff-generating command can take the `-c` or `--cc` option to
produce a 'combined diff' when showing a merge. This is the default
format when showing merges with linkgit:git-diff[1] or
-linkgit:git-show[1]. Note also that you can give the `-m` option to any
-of these commands to force generation of diffs with individual parents
-of a merge.
+linkgit:git-show[1]. Note also that you can give suitable
+`--diff-merges` option to any of these commands to force generation of
+diffs in specific format.
A "combined diff" format looks like this:
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 746b144c76..e5733ccb2d 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -33,6 +33,57 @@ endif::git-diff[]
show the patch by default, or to cancel the effect of `--patch`.
endif::git-format-patch[]
+ifdef::git-log[]
+--diff-merges=(off|none|first-parent|1|separate|m|combined|c|dense-combined|cc)::
+--no-diff-merges::
+ Specify diff format to be used for merge commits. Default is
+ {diff-merges-default} unless `--first-parent` is in use, in which case
+ `first-parent` is the default.
++
+--diff-merges=(off|none):::
+--no-diff-merges:::
+ Disable output of diffs for merge commits. Useful to override
+ implied value.
++
+--diff-merges=first-parent:::
+--diff-merges=1:::
+ This option makes merge commits show the full diff with
+ respect to the first parent only.
++
+--diff-merges=separate:::
+--diff-merges=m:::
+-m:::
+ This makes merge commits show the full diff with respect to
+ each of the parents. Separate log entry and diff is generated
+ for each parent. `-m` doesn't produce any output without `-p`.
++
+--diff-merges=combined:::
+--diff-merges=c:::
+-c:::
+ With this option, diff output for a merge commit shows the
+ differences from each of the parents to the merge result
+ simultaneously instead of showing pairwise diff between a
+ parent and the result one at a time. Furthermore, it lists
+ only files which were modified from all parents. `-c` implies
+ `-p`.
++
+--diff-merges=dense-combined:::
+--diff-merges=cc:::
+--cc:::
+ With this option the output produced by
+ `--diff-merges=combined` is further compressed by omitting
+ uninteresting hunks whose contents in the parents have only
+ two variants and the merge result picks one of them without
+ modification. `--cc` implies `-p`.
+
+--combined-all-paths::
+ This flag causes combined diffs (used for merge commits) to
+ list the name of the file from all parents. It thus only has
+ effect when `--diff-merges=[dense-]combined` is in use, and
+ is likely only useful if filename changes are detected (i.e.
+ when either rename or copy detection have been requested).
+endif::git-log[]
+
-U<n>::
--unified=<n>::
Generate diffs with <n> lines of context instead of
diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt
index d72d15be5b..bd596619c0 100644
--- a/Documentation/git-fsck.txt
+++ b/Documentation/git-fsck.txt
@@ -129,14 +129,6 @@ using 'git commit-graph verify'. See linkgit:git-commit-graph[1].
Extracted Diagnostics
---------------------
-expect dangling commits - potential heads - due to lack of head information::
- You haven't specified any nodes as heads so it won't be
- possible to differentiate between un-parented commits and
- root nodes.
-
-missing sha1 directory '<dir>'::
- The directory holding the sha1 objects is missing.
-
unreachable <type> <object>::
The <type> object <object>, isn't actually referred to directly
or indirectly in any of the trees or commits seen. This can
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index dd189a353a..1bbf865a1b 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -107,47 +107,15 @@ DIFF FORMATTING
By default, `git log` does not generate any diff output. The options
below can be used to show the changes made by each commit.
-Note that unless one of `-c`, `--cc`, or `-m` is given, merge commits
-will never show a diff, even if a diff format like `--patch` is
-selected, nor will they match search options like `-S`. The exception is
-when `--first-parent` is in use, in which merges are treated like normal
-single-parent commits (this can be overridden by providing a
-combined-diff option or with `--no-diff-merges`).
-
--c::
- With this option, diff output for a merge commit
- shows the differences from each of the parents to the merge result
- simultaneously instead of showing pairwise diff between a parent
- and the result one at a time. Furthermore, it lists only files
- which were modified from all parents.
-
---cc::
- This flag implies the `-c` option and further compresses the
- patch output by omitting uninteresting hunks whose contents in
- the parents have only two variants and the merge result picks
- one of them without modification.
-
---combined-all-paths::
- This flag causes combined diffs (used for merge commits) to
- list the name of the file from all parents. It thus only has
- effect when -c or --cc are specified, and is likely only
- useful if filename changes are detected (i.e. when either
- rename or copy detection have been requested).
-
--m::
- This flag makes the merge commits show the full diff like
- regular commits; for each merge parent, a separate log entry
- and diff is generated. An exception is that only diff against
- the first parent is shown when `--first-parent` option is given;
- in that case, the output represents the changes the merge
- brought _into_ the then-current branch.
-
---diff-merges=off::
---no-diff-merges::
- Disable output of diffs for merge commits (default). Useful to
- override `-m`, `-c`, or `--cc`.
+Note that unless one of `--diff-merges` variants (including short
+`-m`, `-c`, and `--cc` options) is explicitly given, merge commits
+will not show a diff, even if a diff format like `--patch` is
+selected, nor will they match search options like `-S`. The exception
+is when `--first-parent` is in use, in which case `first-parent` is
+the default format.
:git-log: 1
+:diff-merges-default: `off`
include::diff-options.txt[]
include::diff-generate-patch.txt[]
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index 0a3b5265b3..6d11ab506b 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -13,6 +13,7 @@ SYNOPSIS
(--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*
(-[c|d|o|i|s|u|k|m])*
[--eol]
+ [--deduplicate]
[-x <pattern>|--exclude=<pattern>]
[-X <file>|--exclude-from=<file>]
[--exclude-per-directory=<file>]
@@ -80,6 +81,13 @@ OPTIONS
\0 line termination on output and do not quote filenames.
See OUTPUT below for more information.
+--deduplicate::
+ When only filenames are shown, suppress duplicates that may
+ come from having multiple stages during a merge, or giving
+ `--deleted` and `--modified` option at the same time.
+ When any of the `-t`, `--unmerged`, or `--stage` option is
+ in use, this option has no effect.
+
-x <pattern>::
--exclude=<pattern>::
Skip untracked files matching pattern.
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index fcf528c1b3..2b1bc7288d 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -45,10 +45,13 @@ include::pretty-options.txt[]
include::pretty-formats.txt[]
-COMMON DIFF OPTIONS
--------------------
+DIFF FORMATTING
+---------------
+The options below can be used to change the way `git show` generates
+diff output.
:git-log: 1
+:diff-merges-default: `dense-combined`
include::diff-options.txt[]
include::diff-generate-patch.txt[]
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 002379056a..96cc89d157 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -130,6 +130,11 @@ parents) and `--max-parents=-1` (negative numbers denote no upper limit).
this option allows you to ignore the individual commits
brought in to your history by such a merge.
+ifdef::git-log[]
+ This option also changes default diff format for merge commits
+ to `first-parent`, see `--diff-merges=first-parent` for details.
+endif::git-log[]
+
--not::
Reverses the meaning of the '{caret}' prefix (or lack thereof)
for all following revision specifiers, up to the next `--not`.
diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt
index 69edf46c03..b633482b1b 100644
--- a/Documentation/technical/index-format.txt
+++ b/Documentation/technical/index-format.txt
@@ -26,7 +26,7 @@ Git index format
Extensions are identified by signature. Optional extensions can
be ignored if Git does not understand them.
- Git currently supports cached tree and resolve undo extensions.
+ Git currently supports cache tree and resolve undo extensions.
4-byte extension signature. If the first byte is 'A'..'Z' the
extension is optional and can be ignored.
@@ -136,14 +136,35 @@ Git index format
== Extensions
-=== Cached tree
-
- Cached tree extension contains pre-computed hashes for trees that can
- be derived from the index. It helps speed up tree object generation
- from index for a new commit.
-
- When a path is updated in index, the path must be invalidated and
- removed from tree cache.
+=== Cache tree
+
+ Since the index does not record entries for directories, the cache
+ entries cannot describe tree objects that already exist in the object
+ database for regions of the index that are unchanged from an existing
+ commit. The cache tree extension stores a recursive tree structure that
+ describes the trees that already exist and completely match sections of
+ the cache entries. This speeds up tree object generation from the index
+ for a new commit by only computing the trees that are "new" to that
+ commit. It also assists when comparing the index to another tree, such
+ as `HEAD^{tree}`, since sections of the index can be skipped when a tree
+ comparison demonstrates equality.
+
+ The recursive tree structure uses nodes that store a number of cache
+ entries, a list of subnodes, and an object ID (OID). The OID references
+ the existing tree for that node, if it is known to exist. The subnodes
+ correspond to subdirectories that themselves have cache tree nodes. The
+ number of cache entries corresponds to the number of cache entries in
+ the index that describe paths within that tree's directory.
+
+ The extension tracks the full directory structure in the cache tree
+ extension, but this is generally smaller than the full cache entry list.
+
+ When a path is updated in index, Git invalidates all nodes of the
+ recursive cache tree corresponding to the parent directories of that
+ path. We store these tree nodes as being "invalid" by using "-1" as the
+ number of cache entries. Invalid nodes still store a span of index
+ entries, allowing Git to focus its efforts when reconstructing a full
+ cache tree.
The signature for this extension is { 'T', 'R', 'E', 'E' }.
@@ -174,7 +195,8 @@ Git index format
first entry represents the root level of the repository, followed by the
first subtree--let's call this A--of the root level (with its name
relative to the root level), followed by the first subtree of A (with
- its name relative to A), ...
+ its name relative to A), and so on. The specified number of subtrees
+ indicates when the current level of the recursive stack is complete.
=== Resolve undo
diff --git a/Documentation/technical/packfile-uri.txt b/Documentation/technical/packfile-uri.txt
index 318713abc3..f7eabc6c76 100644
--- a/Documentation/technical/packfile-uri.txt
+++ b/Documentation/technical/packfile-uri.txt
@@ -37,8 +37,11 @@ at least so that we can test the client.
This is the implementation: a feature, marked experimental, that allows the
server to be configured by one or more `uploadpack.blobPackfileUri=<sha1>
<uri>` entries. Whenever the list of objects to be sent is assembled, all such
-blobs are excluded, replaced with URIs. The client will download those URIs,
-expecting them to each point to packfiles containing single blobs.
+blobs are excluded, replaced with URIs. As noted in "Future work" below, the
+server can evolve in the future to support excluding other objects (or other
+implementations of servers could be made that support excluding other objects)
+without needing a protocol change, so clients should not expect that packfiles
+downloaded in this way only contain single blobs.
Client design
-------------
diff --git a/Makefile b/Makefile
index 4edfda3e00..b797033c58 100644
--- a/Makefile
+++ b/Makefile
@@ -777,20 +777,6 @@ BUILT_INS += git-status$X
BUILT_INS += git-switch$X
BUILT_INS += git-whatchanged$X
-# what 'all' will build and 'install' will install in gitexecdir,
-# excluding programs for built-in commands
-ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
-ALL_COMMANDS_TO_INSTALL = $(ALL_PROGRAMS)
-ifeq (,$(SKIP_DASHED_BUILT_INS))
-ALL_COMMANDS_TO_INSTALL += $(BUILT_INS)
-else
-# git-upload-pack, git-receive-pack and git-upload-archive are special: they
-# are _expected_ to be present in the `bin/` directory in their dashed form.
-ALL_COMMANDS_TO_INSTALL += git-receive-pack$(X)
-ALL_COMMANDS_TO_INSTALL += git-upload-archive$(X)
-ALL_COMMANDS_TO_INSTALL += git-upload-pack$(X)
-endif
-
# what 'all' will build but not install in gitexecdir
OTHER_PROGRAMS = git$X
@@ -874,6 +860,7 @@ LIB_OBJS += date.o
LIB_OBJS += decorate.o
LIB_OBJS += delta-islands.o
LIB_OBJS += diff-delta.o
+LIB_OBJS += diff-merges.o
LIB_OBJS += diff-lib.o
LIB_OBJS += diff-no-index.o
LIB_OBJS += diff.o
@@ -1226,6 +1213,20 @@ ifdef DEVELOPER
include config.mak.dev
endif
+# what 'all' will build and 'install' will install in gitexecdir,
+# excluding programs for built-in commands
+ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
+ALL_COMMANDS_TO_INSTALL = $(ALL_PROGRAMS)
+ifeq (,$(SKIP_DASHED_BUILT_INS))