Skip to content

Commit

Permalink
Merge branch 'master' into pq-v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Chand-ra authored Aug 1, 2024
2 parents 5ac6056 + 891ee3b commit 7cbb07a
Show file tree
Hide file tree
Showing 55 changed files with 7,218 additions and 2,899 deletions.
25 changes: 25 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ AlwaysBreakAfterReturnType: None
BinPackArguments: true
BinPackParameters: true

# Add no space around the bit field
# unsigned bf:2;
BitFieldColonSpacing: None

# Attach braces to surrounding context except break before braces on function
# definitions.
# void foo()
Expand All @@ -96,6 +100,12 @@ BreakStringLiterals: false
# Switch statement body is always indented one level more than case labels.
IndentCaseLabels: false

# Indents directives before the hash.
# #if FOO
# # include <foo>
# #endif
IndentPPDirectives: AfterHash

# Don't indent a function definition or declaration if it is wrapped after the
# type
IndentWrappedFunctionNames: false
Expand All @@ -108,11 +118,18 @@ PointerAlignment: Right
# x = (int32)y; not x = (int32) y;
SpaceAfterCStyleCast: false

# No space is inserted after the logical not operator
SpaceAfterLogicalNot: false

# Insert spaces before and after assignment operators
# int a = 5; not int a=5;
# a += 42; a+=42;
SpaceBeforeAssignmentOperators: true

# Spaces will be removed before case colon.
# case 1: break; not case 1 : break;
SpaceBeforeCaseColon: false

# Put a space before opening parentheses only after control statement keywords.
# void f() {
# if (true) {
Expand All @@ -124,6 +141,14 @@ SpaceBeforeParens: ControlStatements
# Don't insert spaces inside empty '()'
SpaceInEmptyParentheses: false

# No space before first '[' in arrays
# int a[5][5]; not int a [5][5];
SpaceBeforeSquareBrackets: false

# No space will be inserted into {}
# while (true) {} not while (true) { }
SpaceInEmptyBlock: false

# The number of spaces before trailing line comments (// - comments).
# This does not affect trailing block comments (/* - comments).
SpacesBeforeTrailingComments: 1
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/check-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: check-style

# Get the repository with all commits to ensure that we can analyze
# all of the commits contributed via the Pull Request.

on:
pull_request:
types: [opened, synchronize]

# Avoid unnecessary builds. Unlike the main CI jobs, these are not
# ci-configurable (but could be).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-style:
env:
CC: clang
jobname: ClangFormat
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: ci/install-dependencies.sh

- name: git clang-format
continue-on-error: true
id: check_out
run: |
./ci/run-style-check.sh \
"${{github.event.pull_request.base.sha}}"
25 changes: 24 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,31 @@ check-whitespace:
image: ubuntu:latest
before_script:
- ./ci/install-dependencies.sh
# Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
# pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should
# be defined in all pipelines.
script:
- ./ci/check-whitespace.sh "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA"
- |
R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
./ci/check-whitespace.sh "$R"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'

check-style:
image: ubuntu:latest
allow_failure: true
variables:
CC: clang
jobname: ClangFormat
before_script:
- ./ci/install-dependencies.sh
# Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
# pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should
# be defined in all pipelines.
script:
- |
R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
./ci/run-style-check.sh "$R"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'

Expand Down
27 changes: 27 additions & 0 deletions Documentation/CodingGuidelines
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,33 @@ For shell scripts specifically (not exhaustive):
local variable="$value"
local variable="$(command args)"

- The common construct

VAR=VAL command args

to temporarily set and export environment variable VAR only while
"command args" is running is handy, but this triggers an
unspecified behaviour according to POSIX when used for a command
that is not an external command (like shell functions). Indeed,
dash 0.5.10.2-6 on Ubuntu 20.04, /bin/sh on FreeBSD 13, and AT&T
ksh all make a temporary assignment without exporting the variable,
in such a case. As it does not work portably across shells, do not
use this syntax for shell functions. A common workaround is to do
an explicit export in a subshell, like so:

(incorrect)
VAR=VAL func args

(correct)
(
VAR=VAL &&
export VAR &&
func args
)

but be careful that the effect "func" makes to the variables in the
current shell will be lost across the subshell boundary.

- Use octal escape sequences (e.g. "\302\242"), not hexadecimal (e.g.
"\xc2\xa2") in printf format strings, since hexadecimal escape
sequences are not portable.
Expand Down
6 changes: 6 additions & 0 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,15 @@ ASCIIDOC_DOCBOOK = docbook5
ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
ASCIIDOC_EXTRA += -adocinfo=shared
ASCIIDOC_DEPS = asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
DBLATEX_COMMON =
XMLTO_EXTRA += --skip-validation
XMLTO_EXTRA += -x manpage.xsl
endif

ASCIIDOC_DEPS += docinfo.html

SHELL_PATH ?= $(SHELL)
# Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
Expand Down Expand Up @@ -338,6 +341,9 @@ clean:
$(RM) $(cmds_txt) $(mergetools_txt) *.made
$(RM) GIT-ASCIIDOCFLAGS

docinfo.html: docinfo-html.in
$(QUIET_GEN)$(RM) $@ && cat $< >$@

$(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@ $<

Expand Down
17 changes: 12 additions & 5 deletions Documentation/RelNotes/2.46.0.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Git v2.46 Release Notes
=======================

Backward Compatibility Notes

(None at this moment)

UI, Workflows & Features

* The "--rfc" option of "git format-patch" learned to take an
Expand Down Expand Up @@ -212,7 +208,7 @@ Performance, Internal Implementation, Development Support etc.

* When bundleURI interface fetches multiple bundles, Git failed to
take full advantage of all bundles and ended up slurping duplicated
objects, which has been corrected..
objects, which has been corrected.

* The code to deal with modified paths that are out-of-cone in a
sparsely checked out working tree has been optimized.
Expand Down Expand Up @@ -446,6 +442,17 @@ Fixes since v2.45
with warning messages.
(merge 4f5822076f jc/http-cookiefile later to maint).

* Repacking a repository with multi-pack index started making stupid
pack selections in Git 2.45, which has been corrected.
(merge 8fb6d11fad ds/midx-write-repack-fix later to maint).

* Fix documentation mark-up regression in 2.45.
(merge 6474da0aa4 ja/doc-markup-updates-fix later to maint).

* Work around asciidoctor's css that renders `monospace` material
in the SYNOPSIS section of manual pages as block elements.
(merge d44ce6ddd5 js/doc-markup-updates-fix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 493fdae046 ew/object-convert-leakfix later to maint).
(merge 00f3661a0a ss/doc-eol-attr-fix later to maint).
Expand Down
42 changes: 42 additions & 0 deletions Documentation/RelNotes/2.47.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Git v2.47 Release Notes
=======================

UI, Workflows & Features
------------------------

* Many Porcelain commands that internally use the merge machinery
were taught to consistently honor the diff.algorithm configuration.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------

* A build tweak knob has been simplified by not setting the value
that is already the default; another unused one has been removed.

* A CI job that use clang-format to check coding style issues in new
code has been added.


Fixes since v2.46
-----------------

* "git add -p" by users with diff.suppressBlankEmpty set to true
failed to parse the patch that represents an unmodified empty line
with an empty line (not a line with a single space on it), which
has been corrected.
(merge 60cf761ed1 pw/add-patch-with-suppress-blank-empty later to maint).

* "git checkout --ours" (no other arguments) complained that the
option is incompatible with branch switching, which is technically
correct, but found confusing by some users. It now says that the
user needs to give pathspec to specify what paths to checkout.
(merge d1e6c61272 jc/checkout-no-op-switch-errors later to maint).

* It has been documented that we avoid "VAR=VAL shell_func" and why.
(merge 728a1962cd jc/doc-one-shot-export-with-shell-func later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 8db8786fc2 jt/doc-post-receive-hook-update later to maint).
(merge 1c473dd6af tn/doc-commit-fix later to maint).
(merge bb0498b1bb jc/how-to-maintain-updates later to maint).
5 changes: 5 additions & 0 deletions Documentation/docinfo-html.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<style>
pre>code {
display: inline;
}
</style>
6 changes: 3 additions & 3 deletions Documentation/git-clone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ SYNOPSIS
[`-l`] [`-s`] [`--no-hardlinks`] [`-q`] [`-n`] [`--bare`] [`--mirror`]
[`-o` _<name>_] [`-b` _<name>_] [`-u` _<upload-pack>_] [`--reference` _<repository>_]
[`--dissociate`] [`--separate-git-dir` _<git-dir>_]
[`--depth` _<depth>_] [`--`[`no-`]`single-branch`] [`--no-tags`]
[++--recurse-submodules++[++=++__<pathspec>__]] [`--`[`no-`]`shallow-submodules`]
[`--`[`no-`]`remote-submodules`] [`--jobs` _<n>_] [`--sparse`] [`--`[`no-`]`reject-shallow`]
[`--depth` _<depth>_] [`--`[`no-`]{empty}`single-branch`] [`--no-tags`]
[++--recurse-submodules++[++=++__<pathspec>__]] [++--++[++no-++]{empty}++shallow-submodules++]
[`--`[`no-`]{empty}`remote-submodules`] [`--jobs` _<n>_] [`--sparse`] [`--`[`no-`]{empty}`reject-shallow`]
[++--filter=++__<filter-spec>__] [`--also-filter-submodules`]] [`--`] _<repository>_
[_<directory>_]

Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git commit' [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
[--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]
[--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>]
[-F <file> | -m <msg>] [--reset-author] [--allow-empty]
[--allow-empty-message] [--no-verify] [-e] [--author=<author>]
[--date=<date>] [--cleanup=<mode>] [--[no-]status]
Expand Down
15 changes: 9 additions & 6 deletions Documentation/githooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,13 @@ post-receive

This hook is invoked by linkgit:git-receive-pack[1] when it reacts to
`git push` and updates reference(s) in its repository.
It executes on the remote repository once after all the refs have
been updated.
The hook executes on the remote repository once after all the proposed
ref updates are processed and if at least one ref is updated as the
result.

This hook executes once for the receive operation. It takes no
arguments, but gets the same information as the
<<pre-receive,'pre-receive'>>
hook does on its standard input.
The hook takes no arguments. It receives one line on standard input for
each ref that is successfully updated following the same format as the
<<pre-receive,'pre-receive'>> hook.

This hook does not affect the outcome of `git receive-pack`, as it
is called after the real work is done.
Expand All @@ -448,6 +448,9 @@ environment variables will not be set. If the client selects
to use push options, but doesn't transmit any, the count variable
will be set to zero, `GIT_PUSH_OPTION_COUNT=0`.

See the "post-receive" section in linkgit:git-receive-pack[1] for
additional details.

[[post-update]]
post-update
~~~~~~~~~~~
Expand Down
Loading

0 comments on commit 7cbb07a

Please sign in to comment.