Commit graph

13877 commits

Author SHA1 Message Date
Elijah Newren db757e8b8d show, log: provide a --remerge-diff capability
When this option is specified, we remerge all (two parent) merge commits
and diff the actual merge commit to the automatically created version,
in order to show how users removed conflict markers, resolved the
different conflict versions, and potentially added new changes outside
of conflict regions in order to resolve semantic merge problems (or,
possibly, just to hide other random changes).

This capability works by creating a temporary object directory and
marking it as the primary object store.  This makes it so that any blobs
or trees created during the automatic merge are easily removable
afterwards by just deleting all objects from the temporary object
directory.

There are a few ways that this implementation is suboptimal:
  * `log --remerge-diff` becomes slow, because the temporary object
    directory can fill with many loose objects while running
  * the log output can be muddied with misplaced "warning: cannot merge
    binary files" messages, since ll-merge.c unconditionally writes those
    messages to stderr while running instead of allowing callers to
    manage them.
  * important conflict and warning messages are simply dropped; thus for
    conflicts like modify/delete or rename/rename or file/directory which
    are not representable with content conflict markers, there may be no
    way for a user of --remerge-diff to know that there had been a
    conflict which was resolved (and which possibly motivated other
    changes in the merge commit).
  * when fixing the previous issue, note that some unimportant conflict
    and warning messages might start being included.  We should instead
    make sure these remain dropped.
Subsequent commits will address these issues.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-02 10:02:27 -08:00
Junio C Hamano 597af311a2 The fourth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-21 15:03:23 -08:00
Junio C Hamano ee1dc493d1 Merge branch 'fs/ssh-signing-other-keytypes'
The cryptographic signing using ssh keys can specify literal keys
for keytypes whose name do not begin with the "ssh-" prefix by
using the "key::" prefix mechanism (e.g. "key::ecdsa-sha2-nistp256").

* fs/ssh-signing-other-keytypes:
  ssh signing: make sign/amend test more resilient
  ssh signing: support non ssh-* keytypes
2021-12-21 15:03:16 -08:00
Junio C Hamano d2f0b72759 Merge branch 'fs/ssh-signing-key-lifetime'
Extend the signing of objects with SSH keys and learn to pay
attention to the key validity time range when verifying.

* fs/ssh-signing-key-lifetime:
  ssh signing: verify ssh-keygen in test prereq
  ssh signing: make fmt-merge-msg consider key lifetime
  ssh signing: make verify-tag consider key lifetime
  ssh signing: make git log verify key lifetime
  ssh signing: make verify-commit consider key lifetime
  ssh signing: add key lifetime test prereqs
  ssh signing: use sigc struct to pass payload
  t/fmt-merge-msg: make gpgssh tests more specific
  t/fmt-merge-msg: do not redirect stderr
2021-12-21 15:03:15 -08:00
Junio C Hamano 3770c21be9 Merge branch 'jc/grep-patterntype-default-doc'
Doc update.

* jc/grep-patterntype-default-doc:
  grep: clarify what `grep.patternType=default` means
2021-12-21 15:03:15 -08:00
Junio C Hamano 69a9c10c95 The third batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-15 09:40:11 -08:00
Junio C Hamano 15209c8612 Merge branch 're/color-default-reset'
"default" and "reset" colors have been added to our palette.

* re/color-default-reset:
  color: allow colors to be prefixed with "reset"
  color: support "default" to restore fg/bg color
  color: add missing GIT_COLOR_* white/black constants
2021-12-15 09:39:53 -08:00
Junio C Hamano 212962deba Merge branch 'es/doc-stdout-vs-stderr'
Coding guideline document has been updated to clarify what goes to
standard error in our system.

* es/doc-stdout-vs-stderr:
  CodingGuidelines: document which output goes to stdout vs. stderr
2021-12-15 09:39:49 -08:00
Junio C Hamano 986eb34b71 Merge branch 'es/worktree-chatty-to-stderr'
"git worktree add" showed "Preparing worktree" message to the
standard output stream, but when it failed, the message from die()
went to the standard error stream.  Depending on the order the
stdio streams are flushed at the program end, this resulted in
confusing output.  It has been corrected by sending all the chatty
messages to the standard error stream.

* es/worktree-chatty-to-stderr:
  git-worktree.txt: add missing `-v` to synopsis for `worktree list`
  worktree: send "chatty" messages to stderr
2021-12-15 09:39:49 -08:00
Junio C Hamano 6ba65f4ac3 Merge branch 'es/pretty-describe-more'
Extend "git log --format=%(describe)" placeholder to allow passing
selected command-line options to the underlying "git describe"
command.

* es/pretty-describe-more:
  pretty: add abbrev option to %(describe)
  pretty: add tag option to %(describe)
  pretty.c: rework describe options parsing for better extensibility
2021-12-15 09:39:48 -08:00
Junio C Hamano 4ce498baa3 Merge branch 'en/zdiff3'
"Zealous diff3" style of merge conflict presentation has been added.

* en/zdiff3:
  update documentation for new zdiff3 conflictStyle
  xdiff: implement a zealous diff3, or "zdiff3"
2021-12-15 09:39:47 -08:00
Junio C Hamano e773545c7f The second batch 2021-12-10 14:35:16 -08:00
Junio C Hamano cdac0caddd Merge branch 'jt/midx-doc-fix'
Docfix.

* jt/midx-doc-fix:
  Doc: no midx and partial clone relation
2021-12-10 14:35:13 -08:00
Junio C Hamano 4ee5cacc16 Merge branch 'tl/midx-docfix'
Doc mark-up fix.

* tl/midx-docfix:
  midx: fix a formatting issue in "multi-pack-index.txt"
2021-12-10 14:35:11 -08:00
Junio C Hamano 03194a1afa Merge branch 'tw/var-default-branch'
"git var GIT_DEFAULT_BRANCH" is a way to see what name is used for
the newly created branch if "git init" is run.

* tw/var-default-branch:
  var: add GIT_DEFAULT_BRANCH variable
2021-12-10 14:35:07 -08:00
Junio C Hamano 1c39c822a9 Merge branch 'jk/strbuf-addftime-seconds-since-epoch'
The "--date=format:<strftime>" gained a workaround for the lack of
system support for a non-local timezone to handle "%s" placeholder.

* jk/strbuf-addftime-seconds-since-epoch:
  strbuf_addftime(): handle "%s" manually
2021-12-10 14:35:07 -08:00
Junio C Hamano 3d2dce168f Merge branch 'jc/fix-first-object-walk'
Doc update.

* jc/fix-first-object-walk:
  docs: add headers in MyFirstObjectWalk
  docs: fix places that break compilation in MyFirstObjectWalk
2021-12-10 14:35:05 -08:00
Junio C Hamano b5e7f5e5b1 Merge branch 'if/redact-packfile-uri'
Redact the path part of packfile URI that appears in the trace output.

* if/redact-packfile-uri:
  http-fetch: redact url on die() message
  fetch-pack: redact packfile urls in traces
2021-12-10 14:35:04 -08:00
Junio C Hamano 23c83fc473 Merge branch 'ja/doc-cleanup'
Doc update.

* ja/doc-cleanup:
  init doc: --shared=0xxx does not give umask but perm bits
  doc: git-init: clarify file modes in octal.
  doc: git-http-push: describe the refs as pattern pairs
  doc: uniformize <URL> placeholders' case
  doc: use three dots for indicating repetition instead of star
  doc: git-ls-files: express options as optional alternatives
  doc: use only hyphens as word separators in placeholders
  doc: express grammar placeholders between angle brackets
  doc: split placeholders as individual tokens
  doc: fix git credential synopsis
2021-12-10 14:35:03 -08:00
Junio C Hamano 83113c4268 Merge branch 'cw/protocol-v2-doc-fix'
Doc update.

* cw/protocol-v2-doc-fix:
  protocol-v2.txt: align delim-pkt spec with usage
2021-12-10 14:35:00 -08:00
Fabian Stelzer 6393c956f4 ssh signing: make verify-commit consider key lifetime
If valid-before/after dates are configured for this signatures key in the
allowedSigners file then the verification should check if the key was valid at
the time the commit was made. This allows for graceful key rollover and
revoking keys without invalidating all previous commits.
This feature needs openssh > 8.8. Older ssh-keygen versions will simply
ignore this flag and use the current time.
Strictly speaking this feature is available in 8.7, but since 8.7 has a
bug that makes it unusable in another needed call we require 8.8.

Timestamp information is present on most invocations of check_signature.
However signer ident is not. We will need the signer email / name to be able
to implement "Trust on first use" functionality later.
Since the payload contains all necessary information we can parse it
from there. The caller only needs to provide us some info about the
payload by setting payload_type in the signature_check struct.

 - Add payload_type field & enum and payload_timestamp to struct
   signature_check
 - Populate the timestamp when not already set if we know about the
   payload type
 - Pass -Overify-time={payload_timestamp} in the users timezone to all
   ssh-keygen verification calls
 - Set the payload type when verifying commits
 - Add tests for expired, not yet valid and keys having a commit date
   outside of key validity as well as within

Signed-off-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-09 13:38:04 -08:00
Junio C Hamano 91028f7659 grep: clarify what grep.patternType=default means
We documented that with grep.patternType set to default, the "git
grep" command returns to "the default matching behavior" in 84befcd0
(grep: add a grep.patternType configuration setting, 2012-08-03).

The grep.extendedRegexp configuration variable was the only way to
configure the behavior before that, after b22520a3 (grep: allow -E
and -n to be turned on by default via configuration, 2011-03-30)
introduced it.

It is understandable that we referred to the behavior that honors
the older configuration variable as "the default matching"
behavior.  It is fairly clear in its log message:

    When grep.patternType is set to a value other than "default", the
    grep.extendedRegexp setting is ignored. The value of "default" restores
    the current default behavior, including the grep.extendedRegexp
    behavior.

But when the paragraph is read in isolation by a new person who is
not aware of that backstory (which is the synonym for "most users"),
the "default matching behavior" can be read as "how 'git grep'
behaves without any configuration variables or options", which is
"match the pattern as BRE".

Clarify what the passage means by elaborating what the phrase
"default matching behavior" wanted to mean.

Helped-by: Johannes Altmanninger <aclopte@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-05 12:26:43 -08:00
Eric Sunshine b50252484f git-worktree.txt: add missing -v to synopsis for worktree list
When verbose mode was added to `git worktree list` by 076b444a62
(worktree: teach `list` verbose mode, 2021-01-27), although the
documentation was updated to reflect the new functionality, the
synopsis was overlooked. Correct this minor oversight.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-04 23:27:25 -08:00
Eric Sunshine e258eb4800 CodingGuidelines: document which output goes to stdout vs. stderr
It has long been practice on this project for a command to emit its
primary output to stdout so that it can be captured to a file or sent
down a pipe, and to emit "chatty" messages (such as those reporting
progress) to stderr so that they don't interfere with the primary
output. However, this practice is not necessarily universal; another
common practice is to send only error messages to stderr, and all other
messages to stdout. Therefore, help newcomers out by documenting how
stdout and stderr are used on this project.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-04 17:26:41 -08:00
Elijah Newren ddfc44a898 update documentation for new zdiff3 conflictStyle
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-01 14:45:59 -08:00
Junio C Hamano abe6bb3905 The first batch to start the current cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-29 15:41:51 -08:00
Junio C Hamano 7c2abf1a83 Merge branch 'tp/send-email-completion'
The command line complation for "git send-email" options have been
tweaked to make it easier to keep it in sync with the command itself.

* tp/send-email-completion:
  send-email docs: add format-patch options
  send-email: programmatically generate bash completions
2021-11-29 15:41:49 -08:00
Junio C Hamano 44ac8fd1b4 Merge branch 'so/stash-staged'
"git stash" learned the "--staged" option to stash away what has
been added to the index (and nothing else).

* so/stash-staged:
  stash: get rid of unused argument in stash_staged()
  stash: implement '--staged' option for 'push' and 'save'
2021-11-29 15:41:47 -08:00
Junio C Hamano 9b96d91e94 Merge branch 'jc/tutorial-format-patch-base'
Teach and encourage first-time contributors to this project to
state the base commit when they submit their topic.

* jc/tutorial-format-patch-base:
  MyFirstContribution: teach to use "format-patch --base=auto"
2021-11-29 15:41:46 -08:00
Junio C Hamano dea96aae4d Merge branch 'ow/stash-count-in-status-porcelain-output'
Allow "git status --porcelain=v2" to show the number of stash
entries with --show-stash like the normal output does.

* ow/stash-count-in-status-porcelain-output:
  status: print stash info with --porcelain=v2 --show-stash
  status: count stash entries in separate function
2021-11-29 15:41:44 -08:00
Junio C Hamano 35151cf072 Git 2.34.1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4fA2sf7nIh/HeOzvsLXohpav5ssFAmGeiq4ACgkQsLXohpav
 5suKSBAAt+fTgac/b7gOj+FfsD7Eo0HSThJ2DypONxe0l8heB3vthuHe+gNb+Mqx
 Z31UMNSM7WQZ3CcUsT8CwDBBqY4J8VxWbo7UaZSUbMpPYS8EQcD2s3IBRhSmarcY
 aaYCG0JWBOGrkiTuwK6hr0Qpi3hMuXycOyyx5N24l0fb4rNXKRM4ByjXVncex4X9
 +17i7G8FRbQ9nMuH7Dd3rA+8/qC/ABqJa30GRwEEqzjv+BSx9zmvydChAgVdivim
 ggbuVLFSGXg5YzeBZYwcUi+sZB8vg0PGJSjCnandEt+YFabVd33e+7ISPCt2T8Y3
 Sgll9V+plKuycuouXBI2gvod0yQGQ7o2nWei7bmpqP0mgoS6cYphwN3B1bvngCyw
 y4xAUxiZmXFCw0imcxKijm6/zgpavX8a4N4SiH3jb0lIBRPU1PE+JxtlY0TCG95c
 z2qgRWHJ0ZAh2XvP4t6p2FdavNQAxadiY1v5Hnr22AbiS3pA2XBhRTPaZF9uz0F6
 +8K9gNh/6j1/mYD/lY2JtGpr4mDzs7x2jz1SQNabtDUQQd4PH+7FS+VtfNneJ4i/
 o+Pgsf7Z46GNs1G3rt2Udwe1U7aItAKkObS6WW0Q9GlIy6PNGjpOmYj/SjD6gVuJ
 KEiok3v58xJkPAS6dbc4T4cYGo+GNXfD6jyxvof2/3//pjYvxFY=
 =Zr5X
 -----END PGP SIGNATURE-----

Sync with 2.34.1
2021-11-24 10:56:26 -08:00
Junio C Hamano e9d7761bb9 Git 2.34.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-24 10:55:13 -08:00
Junio C Hamano bcef4ba329 Merge branch 'ab/update-submitting-patches' into maint
Doc fix.

* ab/update-submitting-patches:
  SubmittingPatches: fix Asciidoc syntax in "GitHub CI" section
2021-11-23 14:48:08 -08:00
Junio C Hamano 5f439a0ecf A bit more regression fixes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-22 18:40:11 -08:00
Jonathan Tan 7d3fc7df70 Doc: no midx and partial clone relation
The multi-pack index treats promisor packfiles (that is, packfiles that
have an accompanying .promisor file) the same as other packfiles. Remove
a section in the documentation that seems to indicate otherwise.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-22 12:46:33 -08:00
Junio C Hamano 0ea906d205 0th batch for early fixes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-21 21:57:04 -08:00
Junio C Hamano c152456453 Merge branch 'ab/update-submitting-patches'
Doc fix.

* ab/update-submitting-patches:
  SubmittingPatches: fix Asciidoc syntax in "GitHub CI" section
2021-11-21 21:57:04 -08:00
Fabian Stelzer 350a2518c8 ssh signing: support non ssh-* keytypes
The user.signingKey config for ssh signing supports either a path to a
file containing the key or for the sake of convenience a literal string
with the ssh public key. To differentiate between those two cases we
check if the first few characters contain "ssh-" which is unlikely to be
the start of a path. ssh supports other key types which are not prefixed
with "ssh-" and will currently be treated as a file path and therefore
fail to load. To remedy this we move the prefix check into its own
function and introduce the prefix `key::` for literal ssh keys. This way
we don't need to add new key types when they become available. The
existing `ssh-` prefix is retained for compatibility with current user
configs but removed from the official documentation to discourage its
use.

Signed-off-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-19 09:05:25 -08:00
Teng Long ad506e6780 midx: fix a formatting issue in "multi-pack-index.txt"
There is a formatting issue  in "multi-pack-index.html", corresponding
to the nesting bulleted list of a wrong usage in "multi-pack-index.txt"
and this commit fix the problem.

In ASCIIDOC, it doesn't treat an indented character as the
beginning of a sub-list. If we want to write a nested bulleted list, we
could just use ASTERISK without any DASH like:

      "
      * Level 1 list item
      ** Level 2 list item
      *** Level 3 list item
      ** Level 2 list item
      * Level 1 list item
      ** Level 2 list item
      * Level 1 list item
      "

The DASH can be used for bulleted list too, But the DASH is suggested
only to be used as the marker for the first level because the DASH
doesn’t work well or a best practice for nested lists,
like (dash is as level 2 below):

      "
      * Level 1 list item
      - Level 2 list item
      * Level 1 list item
      "

ASTERISK is recommanded to use because it works intuitively and clearly
("marker length = nesting level") in nested lists, but the DASH can't.
However, when you want to write a non-nested bulleted lists, DASH works
too, like:

      "
      - Level 1 list item
      - Level 1 list item
      - Level 1 list item
      "

Reviewed-by: Taylor Blau <me@ttaylorr.com>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-18 11:31:07 -08:00
Junio C Hamano cd3e606211 Git 2.34
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-14 22:50:52 -08:00
Philippe Blain edbd9f3715 SubmittingPatches: fix Asciidoc syntax in "GitHub CI" section
A superfluous ']' was added to the title of the GitHub CI section in
f003a91f5c (SubmittingPatches: replace discussion of Travis with GitHub
Actions, 2021-07-22). Remove it.

While at it, format the URL for a GitHub user's workflow runs of Git
between backticks, since if not Asciidoc formats only the first part,
"https://github.com/<Your", as a link, which is not very useful.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-13 23:41:54 -08:00
Junio C Hamano 5a73c6bdc7 Merge branch 'js/trace2-raise-format-version'
When we added a new event type to trace2 event stream, we forgot to
raise the format version number, which has been corrected.

* js/trace2-raise-format-version:
  trace2: increment event format version
2021-11-12 15:29:25 -08:00
Junio C Hamano 8996d68ac7 Merge branch 'ps/connectivity-optim'
Regression fix.

* ps/connectivity-optim:
  Revert "connected: do not sort input revisions"
2021-11-12 15:29:24 -08:00
Josh Steadmon 04480e67fe trace2: increment event format version
In 64bc752 (trace2: add trace2_child_ready() to report on background
children, 2021-09-20), we added a new "child_ready" event. In
Documentation/technical/api-trace2.txt, we promise that adding a new
event type will result in incrementing the trace2 event format version
number, but this was not done. Correct this in code & docs.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-11 15:01:04 -08:00
Calvin Wan 74db416c9c protocol-v2.txt: align delim-pkt spec with usage
The current protocol EBNF allows command-request to end with the
capability list, if no command specific arguments follow, but the
protocol requires that after the capability list, there must be a
delim-pkt regardless of the number of command specific arguments.  Fixed
the EBNF to match. Both JGit and libgit2's implementation has the
delim-pkt as mandatory. JGit's code is not publicly linkable, but
libgit2 is linked below[1]. As for currently implemented commands on v2
(ls-ref and fetch), the delim packet is already being passed through

[1]: https://github.com/libgit2/libgit2/blob/main/src/transports/git.c

Reported-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-11 14:53:18 -08:00
Junio C Hamano a7df4f52af Revert "connected: do not sort input revisions"
This reverts commit f45022dc2f,
as this is like breakage in the traversal more likely.  In a
history with 10 single strand of pearls,

   1-->2-->3--...->7-->8-->9-->10

asking "rev-list --unsorted-input 1 10 --not 9 8 7 6 5 4" fails to
paint the bottom 1 uninteresting as the traversal stops, without
completing the propagation of uninteresting bit starting at 4 down
through 3 and 2 to 1.
2021-11-11 12:34:41 -08:00
Ivan Frade 88e9b1e3fc fetch-pack: redact packfile urls in traces
In some setups, packfile uris act as bearer token. It is not
recommended to expose them plainly in logs, although in special
circunstances (e.g. debug) it makes sense to write them.

Redact the packfile URL paths by default, unless the GIT_TRACE_REDACT
variable is set to false. This mimics the redacting of the Authorization
header in HTTP.

Signed-off-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-11 10:07:43 -08:00
Junio C Hamano 4d53e91c6b A few hotfixes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-10 15:01:21 -08:00
Junio C Hamano 6c220937e2 Git 2.34-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-09 13:19:51 -08:00
Junio C Hamano f9b2b6684d init doc: --shared=0xxx does not give umask but perm bits
The description that 0640 makes sure that the group members can read
the repository is correct, but calling that octal number a <umask>
is wrong.  Let's call it <perm>, as the value is used to set the
permission bits.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-09 09:39:11 -08:00