Compare commits

..

38 Commits

Author SHA1 Message Date
f2eed22852 Git 2.34.4
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-23 12:35:49 +02:00
378eaded1a Sync with 2.33.4
* maint-2.33:
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
2022-06-23 12:35:47 +02:00
80c525c4ac Git 2.33.4
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-23 12:35:41 +02:00
eebfde3f21 Sync with 2.32.3
* maint-2.32:
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
2022-06-23 12:35:38 +02:00
656d9a24f6 Git 2.32.3
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-23 12:35:32 +02:00
fc0c773028 Sync with 2.31.4
* maint-2.31:
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
2022-06-23 12:35:30 +02:00
5b1c746c35 Git 2.31.4
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-23 12:35:25 +02:00
2f8809f9a1 Sync with 2.30.5
* maint-2.30:
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
2022-06-23 12:35:23 +02:00
88b7be68a4 Git 2.30.5
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-23 12:31:05 +02:00
3b0bf27049 setup: tighten ownership checks post CVE-2022-24765
8959555cee (setup_git_directory(): add an owner check for the top-level
directory, 2022-03-02), adds a function to check for ownership of
repositories using a directory that is representative of it, and ways to
add exempt a specific repository from said check if needed, but that
check didn't account for owership of the gitdir, or (when used) the
gitfile that points to that gitdir.

An attacker could create a git repository in a directory that they can
write into but that is owned by the victim to work around the fix that
was introduced with CVE-2022-24765 to potentially run code as the
victim.

An example that could result in privilege escalation to root in *NIX would
be to set a repository in a shared tmp directory by doing (for example):

  $ git -C /tmp init

To avoid that, extend the ensure_valid_ownership function to be able to
check for all three paths.

This will have the side effect of tripling the number of stat() calls
when a repository is detected, but the effect is expected to be likely
minimal, as it is done only once during the directory walk in which Git
looks for a repository.

Additionally make sure to resolve the gitfile (if one was used) to find
the relevant gitdir for checking.

While at it change the message printed on failure so it is clear we are
referring to the repository by its worktree (or gitdir if it is bare) and
not to a specific directory.

Helped-by: Junio C Hamano <junio@pobox.com>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
2022-06-23 12:31:05 +02:00
b779214eaf Merge branch 'cb/path-owner-check-with-sudo'
With a recent update to refuse access to repositories of other
people by default, "sudo make install" and "sudo git describe"
stopped working.  This series intends to loosen it while keeping
the safety.

* cb/path-owner-check-with-sudo:
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-23 12:31:04 +02:00
6b11e3d52e git-compat-util: allow root to access both SUDO_UID and root owned
Previous changes introduced a regression which will prevent root for
accessing repositories owned by thyself if using sudo because SUDO_UID
takes precedence.

Loosen that restriction by allowing root to access repositories owned
by both uid by default and without having to add a safe.directory
exception.

A previous workaround that was documented in the tests is no longer
needed so it has been removed together with its specially crafted
prerequisite.

Helped-by: Johanness Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-06-17 14:03:08 -07:00
b9063afda1 t0034: add negative tests and allow git init to mostly work under sudo
Add a support library that provides one function that can be used
to run a "scriplet" of commands through sudo and that helps invoking
sudo in the slightly awkward way that is required to ensure it doesn't
block the call (if shell was allowed as tested in the prerequisite)
and it doesn't run the command through a different shell than the one
we intended.

Add additional negative tests as suggested by Junio and that use a
new workspace that is owned by root.

Document a regression that was introduced by previous commits where
root won't be able anymore to access directories they own unless
SUDO_UID is removed from their environment.

The tests document additional ways that this new restriction could
be worked around and the documentation explains why it might be instead
considered a feature, but a "fix" is planned for a future change.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12 18:12:23 -07:00
ae9abbb63e git-compat-util: avoid failing dir ownership checks if running privileged
bdc77d1d68 (Add a function to determine whether a path is owned by the
current user, 2022-03-02) checks for the effective uid of the running
process using geteuid() but didn't account for cases where that user was
root (because git was invoked through sudo or a compatible tool) and the
original uid that repository trusted for its config was no longer known,
therefore failing the following otherwise safe call:

  guy@renard ~/Software/uncrustify $ sudo git describe --always --dirty
  [sudo] password for guy:
  fatal: unsafe repository ('/home/guy/Software/uncrustify' is owned by someone else)

Attempt to detect those cases by using the environment variables that
those tools create to keep track of the original user id, and do the
ownership check using that instead.

This assumes the environment the user is running on after going
privileged can't be tampered with, and also adds code to restrict that
the new behavior only applies if running as root, therefore keeping the
most common case, which runs unprivileged, from changing, but because of
that, it will miss cases where sudo (or an equivalent) was used to change
to another unprivileged user or where the equivalent tool used to raise
privileges didn't track the original id in a sudo compatible way.

Because of compatibility with sudo, the code assumes that uid_t is an
unsigned integer type (which is not required by the standard) but is used
that way in their codebase to generate SUDO_UID.  In systems where uid_t
is signed, sudo might be also patched to NOT be unsigned and that might
be able to trigger an edge case and a bug (as described in the code), but
it is considered unlikely to happen and even if it does, the code would
just mostly fail safely, so there was no attempt either to detect it or
prevent it by the code, which is something that might change in the future,
based on expected user feedback.

Reported-by: Guy Maurel <guy.j@maurel.de>
Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Helped-by: Randall Becker <rsbecker@nexbridge.com>
Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Suggested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12 18:12:23 -07:00
5f1a3fec8c t: regression git needs safe.directory when using sudo
Originally reported after release of v2.35.2 (and other maint branches)
for CVE-2022-24765 and blocking otherwise harmless commands that were
done using sudo in a repository that was owned by the user.

Add a new test script with very basic support to allow running git
commands through sudo, so a reproduction could be implemented and that
uses only `git status` as a proxy of the issue reported.

Note that because of the way sudo interacts with the system, a much
more complete integration with the test framework will require a lot
more work and that was therefore intentionally punted for now.

The current implementation requires the execution of a special cleanup
function which should always be kept as the last "test" or otherwise
the standard cleanup functions will fail because they can't remove
the root owned directories that are used.  This also means that if
failures are found while running, the specifics of the failure might
not be kept for further debugging and if the test was interrupted, it
will be necessary to clean the working directory manually before
restarting by running:

  $ sudo rm -rf trash\ directory.t0034-root-safe-directory/

The test file also uses at least one initial "setup" test that creates
a parallel execution directory under the "root" sub directory, which
should be used as top level directory for all repositories that are
used in this test file.  Unlike all other tests the repository provided
by the test framework should go unused.

Special care should be taken when invoking commands through sudo, since
the environment is otherwise independent from what the test framework
setup and might have changed the values for HOME, SHELL and dropped
several relevant environment variables for your test.  Indeed `git status`
was used as a proxy because it doesn't even require commits in the
repository to work and usually doesn't require much from the environment
to run, but a future patch will add calls to `git init` and that will
fail to honor the default branch name, unless that setting is NOT
provided through an environment variable (which means even a CI run
could fail that test if enabled incorrectly).

A new SUDO prerequisite is provided that does some sanity checking
to make sure the sudo command that will be used allows for passwordless
execution as root without restrictions and doesn't mess with git's
execution path.  This matches what is provided by the macOS agents that
are used as part of GitHub actions and probably nowhere else.

Most of those characteristics make this test mostly only suitable for
CI, but it might be executed locally if special care is taken to provide
for all of them in the local configuration and maybe making use of the
sudo credential cache by first invoking sudo, entering your password if
needed, and then invoking the test with:

  $ GIT_TEST_ALLOW_SUDO=YES ./t0034-root-safe-directory.sh

If it fails to run, then it means your local setup wouldn't work for the
test because of the configuration sudo has or other system settings, and
things that might help are to comment out sudo's secure_path config, and
make sure that the account you are using has no restrictions on the
commands it can run through sudo, just like is provided for the user in
the CI.

For example (assuming a username of marta for you) something probably
similar to the following entry in your /etc/sudoers (or equivalent) file:

  marta	ALL=(ALL:ALL) NOPASSWD: ALL

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12 18:12:23 -07:00
2f0dde7852 Git 2.34.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 15:21:31 -07:00
1f65dd6ae6 Git 2.33.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 15:21:28 -07:00
1530434434 Git 2.32.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 15:21:26 -07:00
09f66d65f8 Git 2.31.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 15:21:08 -07:00
17083c79ae Git 2.30.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 13:31:29 -07:00
0f85c4a30b setup: opt-out of check with safe.directory=*
With the addition of the safe.directory in 8959555ce
(setup_git_directory(): add an owner check for the top-level directory,
2022-03-02) released in v2.35.2, we are receiving feedback from a
variety of users about the feature.

Some users have a very large list of shared repositories and find it
cumbersome to add this config for every one of them.

In a more difficult case, certain workflows involve running Git commands
within containers. The container boundary prevents any global or system
config from communicating `safe.directory` values from the host into the
container. Further, the container almost always runs as a different user
than the owner of the directory in the host.

To simplify the reactions necessary for these users, extend the
definition of the safe.directory config value to include a possible '*'
value. This value implies that all directories are safe, providing a
single setting to opt-out of this protection.

Note that an empty assignment of safe.directory clears all previous
values, and this is already the case with the "if (!value || !*value)"
condition.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 12:42:51 -07:00
bb50ec3cc3 setup: fix safe.directory key not being checked
It seems that nothing is ever checking to make sure the safe directories
in the configs actually have the key safe.directory, so some unrelated
config that has a value with a certain directory would also make it a
safe directory.

Signed-off-by: Matheus Valadares <me@m28.io>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 12:42:51 -07:00
e47363e5a8 t0033: add tests for safe.directory
It is difficult to change the ownership on a directory in our test
suite, so insert a new GIT_TEST_ASSUME_DIFFERENT_OWNER environment
variable to trick Git into thinking we are in a differently-owned
directory. This allows us to test that the config is parsed correctly.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 12:42:49 -07:00
4d0b43aa76 Git 2.34.2
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-24 00:31:36 +01:00
93fbff09eb Sync with 2.33.2
* maint-2.33:
  Git 2.33.2
  Git 2.32.1
  Git 2.31.2
  GIT-VERSION-GEN: bump to v2.33.1
  Git 2.30.3
  setup_git_directory(): add an owner check for the top-level directory
  Add a function to determine whether a path is owned by the current user
2022-03-24 00:31:36 +01:00
87ed4fc046 Git 2.33.2
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-24 00:31:32 +01:00
303b876f76 Sync with 2.32.1
* maint-2.32:
  Git 2.32.1
  Git 2.31.2
  Git 2.30.3
  setup_git_directory(): add an owner check for the top-level directory
  Add a function to determine whether a path is owned by the current user
2022-03-24 00:31:32 +01:00
9bcd7a8eca Git 2.32.1
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-24 00:31:29 +01:00
201b0c7af6 Sync with 2.31.2
* maint-2.31:
  Git 2.31.2
  Git 2.30.3
  setup_git_directory(): add an owner check for the top-level directory
  Add a function to determine whether a path is owned by the current user
2022-03-24 00:31:28 +01:00
44de39c45c Git 2.31.2
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-24 00:24:29 +01:00
6a2381a3e5 Sync with 2.30.3
* maint-2.30:
  Git 2.30.3
  setup_git_directory(): add an owner check for the top-level directory
  Add a function to determine whether a path is owned by the current user
2022-03-24 00:24:29 +01:00
cb95038137 Git 2.30.3
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-24 00:22:17 +01:00
fdcad5a53e Fix GIT_CEILING_DIRECTORIES with C:\ and the likes
When determining the length of the longest ancestor of a given path with
respect to to e.g. `GIT_CEILING_DIRECTORIES`, we special-case the root
directory by returning 0 (i.e. we pretend that the path `/` does not end
in a slash by virtually stripping it).

That is the correct behavior because when normalizing paths, the root
directory is special: all other directory paths have their trailing
slash stripped, but not the root directory's path (because it would
become the empty string, which is not a legal path).

However, this special-casing of the root directory in
`longest_ancestor_length()` completely forgets about Windows-style root
directories, e.g. `C:\`. These _also_ get normalized with a trailing
slash (because `C:` would actually refer to the current directory on
that drive, not necessarily to its root directory).

In fc56c7b34b (mingw: accomodate t0060-path-utils for MSYS2,
2016-01-27), we almost got it right. We noticed that
`longest_ancestor_length()` expects a slash _after_ the matched prefix,
and if the prefix already ends in a slash, the normalized path won't
ever match and -1 is returned.

But then that commit went astray: The correct fix is not to adjust the
_tests_ to expect an incorrect -1 when that function is fed a prefix
that ends in a slash, but instead to treat such a prefix as if the
trailing slash had been removed.

Likewise, that function needs to handle the case where it is fed a path
that ends in a slash (not only a prefix that ends in a slash): if it
matches the prefix (plus trailing slash), we still need to verify that
the path does not end there, otherwise the prefix is not actually an
ancestor of the path but identical to it (and we need to return -1 in
that case).

With these two adjustments, we no longer need to play games in t0060
where we only add `$rootoff` if the passed prefix is different from the
MSYS2 pseudo root, instead we also add it for the MSYS2 pseudo root
itself. We do have to be careful to skip that logic entirely for Windows
paths, though, because they do are not subject to that MSYS2 pseudo root
treatment.

This patch fixes the scenario where a user has set
`GIT_CEILING_DIRECTORIES=C:\`, which would be ignored otherwise.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-24 00:21:08 +01:00
8959555cee setup_git_directory(): add an owner check for the top-level directory
It poses a security risk to search for a git directory outside of the
directories owned by the current user.

For example, it is common e.g. in computer pools of educational
institutes to have a "scratch" space: a mounted disk with plenty of
space that is regularly swiped where any authenticated user can create
a directory to do their work. Merely navigating to such a space with a
Git-enabled `PS1` when there is a maliciously-crafted `/scratch/.git/`
can lead to a compromised account.

The same holds true in multi-user setups running Windows, as `C:\` is
writable to every authenticated user by default.

To plug this vulnerability, we stop Git from accepting top-level
directories owned by someone other than the current user. We avoid
looking at the ownership of each and every directories between the
current and the top-level one (if there are any between) to avoid
introducing a performance bottleneck.

This new default behavior is obviously incompatible with the concept of
shared repositories, where we expect the top-level directory to be owned
by only one of its legitimate users. To re-enable that use case, we add
support for adding exceptions from the new default behavior via the
config setting `safe.directory`.

The `safe.directory` config setting is only respected in the system and
global configs, not from repository configs or via the command-line, and
can have multiple values to allow for multiple shared repositories.

We are particularly careful to provide a helpful message to any user
trying to use a shared repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-21 13:16:26 +01:00
bdc77d1d68 Add a function to determine whether a path is owned by the current user
This function will be used in the next commit to prevent
`setup_git_directory()` from discovering a repository in a directory
that is owned by someone other than the current user.

Note: We cannot simply use `st.st_uid` on Windows just like we do on
Linux and other Unix-like platforms: according to
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions
this field is always zero on Windows (because Windows' idea of a user ID
does not fit into a single numerical value). Therefore, we have to do
something a little involved to replicate the same functionality there.

Also note: On Windows, a user's home directory is not actually owned by
said user, but by the administrator. For all practical purposes, it is
under the user's control, though, therefore we pretend that it is owned
by the user.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-21 13:16:26 +01:00
2a9a5862e5 Merge branch 'cb/mingw-gmtime-r'
Build fix on Windows.

* cb/mingw-gmtime-r:
  mingw: avoid fallback for {local,gm}time_r()

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-17 12:52:12 +01:00
6e7ad1e4c2 mingw: avoid fallback for {local,gm}time_r()
mingw-w64's pthread_unistd.h had a bug that mistakenly (because there is
no support for the *lockfile() functions required[1]) defined
_POSIX_THREAD_SAFE_FUNCTIONS and that was being worked around since
3ecd153a3b (compat/mingw: support MSys2-based MinGW build, 2016-01-14).

The bug was fixed in winphtreads, but as a side effect, leaves the
reentrant functions from time.h no longer visible and therefore breaks
the build.

Since the intention all along was to avoid using the fallback functions,
formalize the use of POSIX by setting the corresponding feature flag and
compile out the implementation for the fallback functions.

[1] https://unix.org/whitepapers/reentrant.html

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-17 12:52:12 +01:00
898225ba04 GIT-VERSION-GEN: bump to v2.33.1
This was missed in af6d1d602a (Git 2.33.1, 2021-10-12).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-03-17 10:35:52 +01:00
795 changed files with 4883 additions and 21361 deletions

View File

@ -1,9 +1,8 @@
name: check-whitespace name: check-whitespace
# Get the repository with all commits to ensure that we can analyze # Get the repo with the commits(+1) in the series.
# all of the commits contributed via the Pull Request.
# Process `git log --check` output to extract just the check errors. # Process `git log --check` output to extract just the check errors.
# Exit with failure upon white-space issues. # Add a comment to the pull request with the check errors.
on: on:
pull_request: pull_request:

View File

@ -1,4 +1,4 @@
name: CI name: CI/PR
on: [push, pull_request] on: [push, pull_request]
@ -7,7 +7,6 @@ env:
jobs: jobs:
ci-config: ci-config:
name: config
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }} enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }}
@ -78,7 +77,6 @@ jobs:
} }
windows-build: windows-build:
name: win build
needs: ci-config needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes' if: needs.ci-config.outputs.enabled == 'yes'
runs-on: windows-latest runs-on: windows-latest
@ -99,7 +97,6 @@ jobs:
name: windows-artifacts name: windows-artifacts
path: artifacts path: artifacts
windows-test: windows-test:
name: win test
runs-on: windows-latest runs-on: windows-latest
needs: [windows-build] needs: [windows-build]
strategy: strategy:
@ -130,7 +127,6 @@ jobs:
name: failed-tests-windows name: failed-tests-windows
path: ${{env.FAILED_TEST_ARTIFACTS}} path: ${{env.FAILED_TEST_ARTIFACTS}}
vs-build: vs-build:
name: win+VS build
needs: ci-config needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes' if: needs.ci-config.outputs.enabled == 'yes'
env: env:
@ -182,7 +178,6 @@ jobs:
name: vs-artifacts name: vs-artifacts
path: artifacts path: artifacts
vs-test: vs-test:
name: win+VS test
runs-on: windows-latest runs-on: windows-latest
needs: vs-build needs: vs-build
strategy: strategy:
@ -215,7 +210,6 @@ jobs:
name: failed-tests-windows name: failed-tests-windows
path: ${{env.FAILED_TEST_ARTIFACTS}} path: ${{env.FAILED_TEST_ARTIFACTS}}
regular: regular:
name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}})
needs: ci-config needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes' if: needs.ci-config.outputs.enabled == 'yes'
strategy: strategy:
@ -225,25 +219,14 @@ jobs:
- jobname: linux-clang - jobname: linux-clang
cc: clang cc: clang
pool: ubuntu-latest pool: ubuntu-latest
- jobname: linux-sha256
cc: clang
os: ubuntu
pool: ubuntu-latest
- jobname: linux-gcc - jobname: linux-gcc
cc: gcc cc: gcc
cc_package: gcc-8
pool: ubuntu-latest
- jobname: linux-TEST-vars
cc: gcc
os: ubuntu
cc_package: gcc-8
pool: ubuntu-latest pool: ubuntu-latest
- jobname: osx-clang - jobname: osx-clang
cc: clang cc: clang
pool: macos-latest pool: macos-latest
- jobname: osx-gcc - jobname: osx-gcc
cc: gcc cc: gcc
cc_package: gcc-9
pool: macos-latest pool: macos-latest
- jobname: linux-gcc-default - jobname: linux-gcc-default
cc: gcc cc: gcc
@ -253,9 +236,7 @@ jobs:
pool: ubuntu-latest pool: ubuntu-latest
env: env:
CC: ${{matrix.vector.cc}} CC: ${{matrix.vector.cc}}
CC_PACKAGE: ${{matrix.vector.cc_package}}
jobname: ${{matrix.vector.jobname}} jobname: ${{matrix.vector.jobname}}
runs_on_pool: ${{matrix.vector.pool}}
runs-on: ${{matrix.vector.pool}} runs-on: ${{matrix.vector.pool}}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -270,7 +251,6 @@ jobs:
name: failed-tests-${{matrix.vector.jobname}} name: failed-tests-${{matrix.vector.jobname}}
path: ${{env.FAILED_TEST_ARTIFACTS}} path: ${{env.FAILED_TEST_ARTIFACTS}}
dockerized: dockerized:
name: ${{matrix.vector.jobname}} (${{matrix.vector.image}})
needs: ci-config needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes' if: needs.ci-config.outputs.enabled == 'yes'
strategy: strategy:
@ -279,8 +259,7 @@ jobs:
vector: vector:
- jobname: linux-musl - jobname: linux-musl
image: alpine image: alpine
- jobname: linux32 - jobname: Linux32
os: ubuntu32
image: daald/ubuntu32:xenial image: daald/ubuntu32:xenial
- jobname: pedantic - jobname: pedantic
image: fedora image: fedora
@ -310,7 +289,6 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: ci/install-dependencies.sh - run: ci/install-dependencies.sh
- run: ci/run-static-analysis.sh - run: ci/run-static-analysis.sh
- run: ci/check-directional-formatting.bash
sparse: sparse:
needs: ci-config needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes' if: needs.ci-config.outputs.enabled == 'yes'
@ -332,7 +310,6 @@ jobs:
run: ci/install-dependencies.sh run: ci/install-dependencies.sh
- run: make sparse - run: make sparse
documentation: documentation:
name: documentation
needs: ci-config needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes' if: needs.ci-config.outputs.enabled == 'yes'
env: env:

60
.travis.yml Normal file
View File

@ -0,0 +1,60 @@
language: c
cache:
directories:
- $HOME/travis-cache
os:
- linux
- osx
osx_image: xcode10.1
compiler:
- clang
- gcc
matrix:
include:
- env: jobname=linux-gcc-default
os: linux
compiler:
addons:
before_install:
- env: jobname=linux-gcc-4.8
os: linux
dist: trusty
compiler:
- env: jobname=Linux32
os: linux
compiler:
addons:
services:
- docker
before_install:
script: ci/run-docker.sh
- env: jobname=linux-musl
os: linux
compiler:
addons:
services:
- docker
before_install:
script: ci/run-docker.sh
- env: jobname=StaticAnalysis
os: linux
compiler:
script: ci/run-static-analysis.sh
after_failure:
- env: jobname=Documentation
os: linux
compiler:
script: ci/test-documentation.sh
after_failure:
before_install: ci/install-dependencies.sh
script: ci/run-build-and-tests.sh
after_failure: ci/print-test-failures.sh
notifications:
email: false

View File

@ -499,33 +499,6 @@ For Python scripts:
- Where required libraries do not restrict us to Python 2, we try to - Where required libraries do not restrict us to Python 2, we try to
also be compatible with Python 3.1 and later. also be compatible with Python 3.1 and later.
Program Output
We make a distinction between a Git command's primary output and
output which is merely chatty feedback (for instance, status
messages, running transcript, or progress display), as well as error
messages. Roughly speaking, a Git command's primary output is that
which one might want to capture to a file or send down a pipe; its
chatty output should not interfere with these use-cases.
As such, primary output should be sent to the standard output stream
(stdout), and chatty output should be sent to the standard error
stream (stderr). Examples of commands which produce primary output
include `git log`, `git show`, and `git branch --list` which generate
output on the stdout stream.
Not all Git commands have primary output; this is often true of
commands whose main function is to perform an action. Some action
commands are silent, whereas others are chatty. An example of a
chatty action commands is `git clone` with its "Cloning into
'<path>'..." and "Checking connectivity..." status messages which it
sends to the stderr stream.
Error messages from Git commands should always be sent to the stderr
stream.
Error Messages Error Messages
- Do not end error messages with a full stop. - Do not end error messages with a full stop.

View File

@ -905,34 +905,19 @@ Sending emails with Git is a two-part process; before you can prepare the emails
themselves, you'll need to prepare the patches. Luckily, this is pretty simple: themselves, you'll need to prepare the patches. Luckily, this is pretty simple:
---- ----
$ git format-patch --cover-letter -o psuh/ --base=auto psuh@{u}..psuh $ git format-patch --cover-letter -o psuh/ master..psuh
---- ----
. The `--cover-letter` option tells `format-patch` to create a The `--cover-letter` parameter tells `format-patch` to create a cover letter
cover letter template for you. You will need to fill in the template for you. You will need to fill in the template before you're ready
template before you're ready to send - but for now, the template to send - but for now, the template will be next to your other patches.
will be next to your other patches.
. The `-o psuh/` option tells `format-patch` to place the patch The `-o psuh/` parameter tells `format-patch` to place the patch files into a
files into a directory. This is useful because `git send-email` directory. This is useful because `git send-email` can take a directory and
can take a directory and send out all the patches from there. send out all the patches from there.
. The `--base=auto` option tells the command to record the "base `master..psuh` tells `format-patch` to generate patches for the difference
commit", on which the recipient is expected to apply the patch between `master` and `psuh`. It will make one patch file per commit. After you
series. The `auto` value will cause `format-patch` to compute
the base commit automatically, which is the merge base of tip
commit of the remote-tracking branch and the specified revision
range.
. The `psuh@{u}..psuh` option tells `format-patch` to generate
patches for the commits you created on the `psuh` branch since it
forked from its upstream (which is `origin/master` if you
followed the example in the "Set up your workspace" section). If
you are already on the `psuh` branch, you can just say `@{u}`,
which means "commits on the current branch since it forked from
its upstream", which is the same thing.
The command will make one patch file per commit. After you
run, you can go have a look at each of the patches with your favorite text run, you can go have a look at each of the patches with your favorite text
editor and make sure everything looks alright; however, it's not recommended to editor and make sure everything looks alright; however, it's not recommended to
make code fixups via the patch file. It's a better idea to make the change the make code fixups via the patch file. It's a better idea to make the change the

View File

@ -58,19 +58,14 @@ running, enable trace output by setting the environment variable `GIT_TRACE`.
Add usage text and `-h` handling, like all subcommands should consistently do Add usage text and `-h` handling, like all subcommands should consistently do
(our test suite will notice and complain if you fail to do so). (our test suite will notice and complain if you fail to do so).
We'll need to include the `parse-options.h` header.
---- ----
#include "parse-options.h"
...
int cmd_walken(int argc, const char **argv, const char *prefix) int cmd_walken(int argc, const char **argv, const char *prefix)
{ {
const char * const walken_usage[] = { const char * const walken_usage[] = {
N_("git walken"), N_("git walken"),
NULL, NULL,
}; }
struct option options[] = { struct option options[] = {
OPT_END() OPT_END()
}; };
@ -200,14 +195,9 @@ Similarly to the default values, we don't have anything to do here yet
ourselves; however, we should call `git_default_config()` if we aren't calling ourselves; however, we should call `git_default_config()` if we aren't calling
any other existing config callbacks. any other existing config callbacks.
Add a new function to `builtin/walken.c`. Add a new function to `builtin/walken.c`:
We'll also need to include the `config.h` header:
---- ----
#include "config.h"
...
static int git_walken_config(const char *var, const char *value, void *cb) static int git_walken_config(const char *var, const char *value, void *cb)
{ {
/* /*
@ -239,14 +229,8 @@ typically done by calling `repo_init_revisions()` with the repository you intend
to target, as well as the `prefix` argument of `cmd_walken` and your `rev_info` to target, as well as the `prefix` argument of `cmd_walken` and your `rev_info`
struct. struct.
Add the `struct rev_info` and the `repo_init_revisions()` call. Add the `struct rev_info` and the `repo_init_revisions()` call:
We'll also need to include the `revision.h` header:
---- ----
#include "revision.h"
...
int cmd_walken(int argc, const char **argv, const char *prefix) int cmd_walken(int argc, const char **argv, const char *prefix)
{ {
/* This can go wherever you like in your declarations.*/ /* This can go wherever you like in your declarations.*/
@ -640,14 +624,9 @@ static void walken_object_walk(struct rev_info *rev)
---- ----
Let's start by calling just the unfiltered walk and reporting our counts. Let's start by calling just the unfiltered walk and reporting our counts.
Complete your implementation of `walken_object_walk()`. Complete your implementation of `walken_object_walk()`:
We'll also need to include the `list-objects.h` header.
---- ----
#include "list-objects.h"
...
traverse_commit_list(rev, walken_show_commit, walken_show_object, NULL); traverse_commit_list(rev, walken_show_commit, walken_show_object, NULL);
printf("commits %d\nblobs %d\ntags %d\ntrees %d\n", commit_count, printf("commits %d\nblobs %d\ntags %d\ntrees %d\n", commit_count,
@ -718,7 +697,7 @@ First, we'll need to `#include "list-objects-filter-options.h"` and set up the
---- ----
static void walken_object_walk(struct rev_info *rev) static void walken_object_walk(struct rev_info *rev)
{ {
struct list_objects_filter_options filter_options = { 0 }; struct list_objects_filter_options filter_options = {};
... ...
---- ----

View File

@ -0,0 +1,24 @@
Git v2.30.2 Release Notes
=========================
This release addresses the security issue CVE-2022-24765.
Fixes since v2.30.2
-------------------
* Build fix on Windows.
* Fix `GIT_CEILING_DIRECTORIES` with Windows-style root directories.
* CVE-2022-24765:
On multi-user machines, Git users might find themselves
unexpectedly in a Git worktree, e.g. when another user created a
repository in `C:\.git`, in a mounted network drive or in a
scratch space. Merely having a Git-aware prompt that runs `git
status` (or `git diff`) and navigating to a directory which is
supposedly not a Git worktree, or opening such a directory in an
editor or IDE such as VS Code or Atom, will potentially run
commands defined by that other user.
Credit for finding this vulnerability goes to 俞晨东; The fix was
authored by Johannes Schindelin.

View File

@ -0,0 +1,21 @@
Git v2.30.4 Release Notes
=========================
This release contains minor fix-ups for the changes that went into
Git 2.30.3, which was made to address CVE-2022-24765.
* The code that was meant to parse the new `safe.directory`
configuration variable was not checking what configuration
variable was being fed to it, which has been corrected.
* '*' can be used as the value for the `safe.directory` variable to
signal that the user considers that any directory is safe.
Derrick Stolee (2):
t0033: add tests for safe.directory
setup: opt-out of check with safe.directory=*
Matheus Valadares (1):
setup: fix safe.directory key not being checked

View File

@ -0,0 +1,12 @@
Git v2.30.5 Release Notes
=========================
This release contains minor fix-ups for the changes that went into
Git 2.30.3 and 2.30.4, addressing CVE-2022-29187.
* The safety check that verifies a safe ownership of the Git
worktree is now extended to also cover the ownership of the Git
directory (and the `.git` file, if there is any).
Carlo Marcelo Arenas Belón (1):
setup: tighten ownership checks post CVE-2022-24765

View File

@ -0,0 +1,6 @@
Git v2.31.2 Release Notes
=========================
This release merges up the fixes that appear in v2.30.3 to address
the security issue CVE-2022-24765; see the release notes for that
version for details.

View File

@ -0,0 +1,4 @@
Git Documentation/RelNotes/2.31.3.txt Release Notes
=========================
This release merges up the fixes that appear in v2.31.3.

View File

@ -0,0 +1,6 @@
Git v2.31.4 Release Notes
=========================
This release merges up the fixes that appear in v2.30.5 to address
the security issue CVE-2022-29187; see the release notes for that
version for details.

View File

@ -0,0 +1,6 @@
Git v2.32.1 Release Notes
=========================
This release merges up the fixes that appear in v2.30.3 and
v2.31.2 to address the security issue CVE-2022-24765; see the
release notes for these versions for details.

View File

@ -0,0 +1,4 @@
Git Documentation/RelNotes/2.32.2.txt Release Notes
=========================
This release merges up the fixes that appear in v2.32.2.

View File

@ -0,0 +1,6 @@
Git v2.32.3 Release Notes
=========================
This release merges up the fixes that appear in v2.30.5 and
v2.31.4 to address the security issue CVE-2022-29187; see the
release notes for these versions for details.

View File

@ -0,0 +1,15 @@
Git v2.33.2 Release Notes
=========================
This release merges up the fixes that appear in v2.30.3, v2.31.2
and v2.32.1 to address the security issue CVE-2022-24765; see
the release notes for these versions for details.
In addition, it contains the following fixes:
* Squelch over-eager warning message added during this cycle.
* A bug in "git rebase -r" has been fixed.
* One CI task based on Fedora image noticed a not-quite-kosher
construct recently, which has been corrected.

View File

@ -0,0 +1,4 @@
Git Documentation/RelNotes/2.33.3.txt Release Notes
=========================
This release merges up the fixes that appear in v2.33.3.

View File

@ -0,0 +1,6 @@
Git v2.33.4 Release Notes
=========================
This release merges up the fixes that appear in v2.30.5, v2.31.4
and v2.32.3 to address the security issue CVE-2022-29187; see
the release notes for these versions for details.

View File

@ -0,0 +1,6 @@
Git v2.34.2 Release Notes
=========================
This release merges up the fixes that appear in v2.30.3, v2.31.2,
v2.32.1 and v2.33.2 to address the security issue CVE-2022-24765;
see the release notes for these versions for details.

View File

@ -0,0 +1,4 @@
Git Documentation/RelNotes/2.34.3.txt Release Notes
=========================
This release merges up the fixes that appear in v2.34.3.

View File

@ -0,0 +1,6 @@
Git v2.34.4 Release Notes
=========================
This release merges up the fixes that appear in v2.30.5, v2.31.4,
v2.32.3 and v2.33.4 to address the security issue CVE-2022-29187;
see the release notes for these versions for details.

View File

@ -1,393 +0,0 @@
Git 2.35 Release Notes
======================
Updates since Git 2.34
----------------------
Backward compatibility warts
* "_" is now treated as any other URL-valid characters in an URL when
matching the per-URL configuration variable names.
* The color palette used by "git grep" has been updated to match that
of GNU grep.
UI, Workflows & Features
* "git status --porcelain=v2" now show the number of stash entries
with --show-stash like the normal output does.
* "git stash" learned the "--staged" option to stash away what has
been added to the index (and nothing else).
* "git var GIT_DEFAULT_BRANCH" is a way to see what name is used for
the newly created branch if "git init" is run.
* Various operating modes of "git reset" have been made to work
better with the sparse index.
* "git submodule deinit" for a submodule whose .git metadata
directory is embedded in its working tree refused to work, until
the submodule gets converted to use the "absorbed" form where the
metadata directory is stored in superproject, and a gitfile at the
top-level of the working tree of the submodule points at it. The
command is taught to convert such submodules to the absorbed form
as needed.
* The completion script (in contrib/) learns that the "--date"
option of commands from the "git log" family takes "human" and
"auto" as valid values.
* "Zealous diff3" style of merge conflict presentation has been added.
* The "git log --format=%(describe)" placeholder has been extended to
allow passing selected command-line options to the underlying "git
describe" command.
* "default" and "reset" have been added to our color palette.
* 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").
* "git fetch" without the "--update-head-ok" option ought to protect
a checked out branch from getting updated, to prevent the working
tree that checks it out to go out of sync. The code was written
before the use of "git worktree" got widespread, and only checked
the branch that was checked out in the current worktree, which has
been updated.
* "git name-rev" has been tweaked to give output that is shorter and
easier to understand.
* "git apply" has been taught to ignore a message without a patch
with the "--allow-empty" option. It also learned to honor the
"--quiet" option given from the command line.
* The "init" and "set" subcommands in "git sparse-checkout" have been
unified for a better user experience and performance.
* Many git commands that deal with working tree files try to remove a
directory that becomes empty (i.e. "git switch" from a branch that
has the directory to another branch that does not would attempt
remove all files in the directory and the directory itself). This
drops users into an unfamiliar situation if the command was run in
a subdirectory that becomes subject to removal due to the command.
The commands have been taught to keep an empty directory if it is
the directory they were started in to avoid surprising users.
* "git am" learns "--empty=(stop|drop|keep)" option to tweak what is
done to a piece of e-mail without a patch in it.
* The default merge message prepared by "git merge" records the name
of the current branch; the name can be overridden with a new option
to allow users to pretend a merge is made on a different branch.
* The way "git p4" shows file sizes in its output has been updated to
use human-readable units.
* "git -c branch.autosetupmerge=inherit branch new old" makes "new"
to have the same upstream as the "old" branch, instead of marking
"old" itself as its upstream.
Performance, Internal Implementation, Development Support etc.
* The use of errno as a means to carry the nature of error in the ref
API implementation has been reworked and reduced.
* Teach and encourage first-time contributors to this project to
state the base commit when they submit their topic.
* 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.
* Ensure that the sparseness of the in-core index matches the
index.sparse configuration specified by the repository immediately
after the on-disk index file is read.
* Code clean-up to eventually allow information on remotes defined
for an arbitrary repository to be read.
* Build optimization.
* Tighten code for testing pack-bitmap.
* Weather balloon to break people with compilers that do not support
C99.
* The "reftable" backend for the refs API, without integrating into
the refs subsystem, has been added.
* More tests are marked as leak-free.
* The test framework learns to list unsatisfied test prerequisites,
and optionally error out when prerequisites that are expected to be
satisfied are not.
* The default setting for trace2 event nesting was too low to cause
test failures, which is worked around by bumping it up in the test
framework.
* Drop support for TravisCI and update test workflows at GitHub.
* Many tests that used to need GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
mechanism to force "git" to use 'master' as the default name for
the initial branch no longer need it; the use of the mechanism from
them have been removed.
* Allow running our tests while disabling fsync.
* Document the parameters given to the reflog entry iterator callback
functions.
(merge e6e94f34b2 jc/reflog-iterator-callback-doc later to maint).
* The test helper for refs subsystem learned to write bogus and/or
nonexistent object name to refs to simulate error situations we
want to test Git in.
* "diff --histogram" optimization.
* Weather balloon to find compilers that do not grok variable
declaration in the for() loop.
* diff and blame commands have been taught to work better with sparse
index.
* The chainlint test script linter in the test suite has been updated.
* The DEVELOPER=yes build uses -std=gnu99 now.
* "git format-patch" uses a single rev_info instance and then exits.
Mark the structure with UNLEAK() macro to squelch leak sanitizer.
* New interface into the tmp-objdir API to help in-core use of the
quarantine feature.
* Broken &&-chains in the test scripts have been corrected.
* The RCS keyword substitution in "git p4" used to be done assuming
that the contents are UTF-8 text, which can trigger decoding
errors. We now treat the contents as a bytestring for robustness
and correctness.
* The conditions to choose different definitions of the FLEX_ARRAY
macro for vendor compilers has been simplified to make it easier to
maintain.
* Correctness and performance update to "diff --color-moved" feature.
* "git upload-pack" (the other side of "git fetch") used a 8kB buffer
but most of its payload came on 64kB "packets". The buffer size
has been enlarged so that such a packet fits.
* "git fetch" and "git pull" are now declared sparse-index clean.
Also "git ls-files" learns the "--sparse" option to help debugging.
* Similar message templates have been consolidated so that
translators need to work on fewer number of messages.
Fixes since v2.34
-----------------
* "git grep" looking in a blob that has non-UTF8 payload was
completely broken when linked with certain versions of PCREv2
library in the latest release.
* Other code cleanup, docfix, build fix, etc.
* "git pull" with any strategy when the other side is behind us
should succeed as it is a no-op, but doesn't.
* An earlier change in 2.34.0 caused JGit application (that abused
GIT_EDITOR mechanism when invoking "git config") to get stuck with
a SIGTTOU signal; it has been reverted.
* An earlier change that broke .gitignore matching has been reverted.
* Things like "git -c branch.sort=bogus branch new HEAD", i.e. the
operation modes of the "git branch" command that do not need the
sort key information, no longer errors out by seeing a bogus sort
key.
(merge 98e7ab6d42 jc/fix-ref-sorting-parse later to maint).
* The compatibility implementation for unsetenv(3) were written to
mimic ancient, non-POSIX, variant seen in an old glibc; it has been
changed to return an integer to match the more modern era.
(merge a38989bd5b jc/unsetenv-returns-an-int later to maint).
* The clean/smudge conversion code path has been prepared to better
work on platforms where ulong is narrower than size_t.
(merge 596b5e77c9 mc/clean-smudge-with-llp64 later to maint).
* Redact the path part of packfile URI that appears in the trace output.
(merge 0ba558ffb1 if/redact-packfile-uri later to maint).
* CI has been taught to catch some Unicode directional formatting
sequence that can be used in certain mischief.
(merge 0e7696c64d js/ci-no-directional-formatting later to maint).
* The "--date=format:<strftime>" gained a workaround for the lack of
system support for a non-local timezone to handle "%s" placeholder.
(merge 9b591b9403 jk/strbuf-addftime-seconds-since-epoch later to maint).
* The "merge" subcommand of "git jump" (in contrib/) silently ignored
pathspec and other parameters.
(merge 67ba13e5a4 jk/jump-merge-with-pathspec later to maint).
* The code to decode the length of packed object size has been
corrected.
(merge 34de5b8eac jt/pack-header-lshift-overflow later to maint).
* The advice message given by "git pull" when the user hasn't made a
choice between merge and rebase still said that the merge is the
default, which no longer is the case. This has been corrected.
(merge 71076d0edd ah/advice-pull-has-no-preference-between-rebase-and-merge later to maint).
* "git fetch", when received a bad packfile, can fail with SIGPIPE.
This wasn't wrong per-se, but we now detect the situation and fail
in a more predictable way.
(merge 2a4aed42ec jk/fetch-pack-avoid-sigpipe-to-index-pack later to maint).
* The function to cull a child process and determine the exit status
had two separate code paths for normal callers and callers in a
signal handler, and the latter did not yield correct value when the
child has caught a signal. The handling of the exit status has
been unified for these two code paths. An existing test with
flakiness has also been corrected.
(merge 5263e22cba jk/t7006-sigpipe-tests-fix later to maint).
* When a non-existent program is given as the pager, we tried to
reuse an uninitialized child_process structure and crashed, which
has been fixed.
(merge f917f57f40 em/missing-pager later to maint).
* The single-key-input mode in "git add -p" had some code to handle
keys that generate a sequence of input via ReadKey(), which did not
handle end-of-file correctly, which has been fixed.
(merge fc8a8126df cb/add-p-single-key-fix later to maint).
* "git rebase -x" added an unnecessary 'exec' instructions before
'noop', which has been corrected.
(merge cc9dcdee61 en/rebase-x-fix later to maint).
* When the "git push" command is killed while the receiving end is
trying to report what happened to the ref update proposals, the
latter used to die, due to SIGPIPE. The code now ignores SIGPIPE
to increase our chances to run the post-receive hook after it
happens.
(merge d34182b9e3 rj/receive-pack-avoid-sigpipe-during-status-reporting later to maint).
* "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.
(merge b50252484f es/worktree-chatty-to-stderr later to maint).
* Coding guideline document has been updated to clarify what goes to
standard error in our system.
(merge e258eb4800 es/doc-stdout-vs-stderr later to maint).
* The sparse-index/sparse-checkout feature had a bug in its use of
the matching code to determine which path is in or outside the
sparse checkout patterns.
(merge 8c5de0d265 ds/sparse-deep-pattern-checkout-fix later to maint).
* "git rebase -x" by mistake started exporting the GIT_DIR and
GIT_WORK_TREE environment variables when the command was rewritten
in C, which has been corrected.
(merge 434e0636db en/rebase-x-wo-git-dir-env later to maint).
* When "git log" implicitly enabled the "decoration" processing
without being explicitly asked with "--decorate" option, it failed
to read and honor the settings given by the "--decorate-refs"
option.
* "git fetch --set-upstream" did not check if there is a current
branch, leading to a segfault when it is run on a detached HEAD,
which has been corrected.
(merge 17baeaf82d ab/fetch-set-upstream-while-detached later to maint).
* Among some code paths that ask an yes/no question, only one place
gave a prompt that looked different from the others, which has been
updated to match what the others create.
(merge 0fc8ed154c km/help-prompt-fix later to maint).
* "git log --invert-grep --author=<name>" used to exclude commits
written by the given author, but now "--invert-grep" only affects
the matches made by the "--grep=<pattern>" option.
(merge 794c000267 rs/log-invert-grep-with-headers later to maint).
* "git grep --perl-regexp" failed to match UTF-8 characters with
wildcard when the pattern consists only of ASCII letters, which has
been corrected.
(merge 32e3e8bc55 rs/pcre2-utf later to maint).
* Certain sparse-checkout patterns that are valid in non-cone mode
led to segfault in cone mode, which has been corrected.
* Use of certain "git rev-list" options with "git fast-export"
created nonsense results (the worst two of which being "--reverse"
and "--invert-grep --grep=<foo>"). The use of "--first-parent" is
made to behave a bit more sensible than before.
(merge 726a228dfb ws/fast-export-with-revision-options later to maint).
* Perf tests were run with end-user's shell, but it has been
corrected to use the shell specified by $TEST_SHELL_PATH.
(merge 9ccab75608 ja/perf-use-specified-shell later to maint).
* Fix dependency rules to generate hook-list.h header file.
(merge d3fd1a6667 ab/makefile-hook-list-dependency-fix later to maint).
* "git stash" by default triggers its "push" action, but its
implementation also made "git stash -h" to show short help only for
"git stash push", which has been corrected.
(merge ca7990cea5 ab/do-not-limit-stash-help-to-push later to maint).
* "git apply --3way" bypasses the attempt to do a three-way
application in more cases to address the regression caused by the
recent change to use direct application as a fallback.
(merge 34d607032c jz/apply-3-corner-cases later to maint).
* Fix performance-releated bug in "git subtree" (in contrib/).
(merge 3ce8888fb4 jl/subtree-check-parents-argument-passing-fix later to maint).
* Extend the guidance to choose the base commit to build your work
on, and hint/nudge contributors to read others' changes.
(merge fdfae830f8 jc/doc-submitting-patches-choice-of-base later to maint).
* A corner case bug in the ort merge strategy has been corrected.
(merge d30126c20d en/merge-ort-renorm-with-rename-delete-conflict-fix later to maint).
* "git stash apply" forgot to attempt restoring untracked files when
it failed to restore changes to tracked ones.
(merge 71cade5a0b en/stash-df-fix later to maint).
* Other code cleanup, docfix, build fix, etc.
(merge 74db416c9c cw/protocol-v2-doc-fix later to maint).
(merge f9b2b6684d ja/doc-cleanup later to maint).
(merge 7d1b866778 jc/fix-first-object-walk later to maint).
(merge 538ac74604 js/trace2-avoid-recursive-errors later to maint).
(merge 152923b132 jk/t5319-midx-corruption-test-deflake later to maint).
(merge 9081a421a6 ab/checkout-branch-info-leakfix later to maint).
(merge 42c456ff81 rs/mergesort later to maint).
(merge ad506e6780 tl/midx-docfix later to maint).
(merge bf5b83fd8a hk/ci-checkwhitespace-commentfix later to maint).
(merge 49f1eb3b34 jk/refs-g11-workaround later to maint).
(merge 7d3fc7df70 jt/midx-doc-fix later to maint).
(merge 7b089120d9 hn/create-reflog-simplify later to maint).
(merge 9e12400da8 cb/mingw-gmtime-r later to maint).
(merge 0bf0de6cc7 tb/pack-revindex-on-disk-cleanup later to maint).
(merge 2c68f577fc ew/cbtree-remove-unused-and-broken-cb-unlink later to maint).
(merge eafd6e7e55 ab/die-with-bug later to maint).
(merge 91028f7659 jc/grep-patterntype-default-doc later to maint).
(merge 47ca93d071 ds/repack-fixlets later to maint).
(merge e6a9bc0c60 rs/t4202-invert-grep-test-fix later to maint).
(merge deb5407a42 gh/gpg-doc-markup-fix later to maint).
(merge 999bba3e0b rs/daemon-plug-leak later to maint).
(merge 786eb1ba39 js/l10n-mention-ngettext-early-in-readme later to maint).
(merge 2f12b31b74 ab/makefile-msgfmt-wo-stats later to maint).

View File

@ -19,10 +19,8 @@ change is relevant to.
base your work on the tip of the topic. base your work on the tip of the topic.
* A new feature should be based on `master` in general. If the new * A new feature should be based on `master` in general. If the new
feature depends on other topics that are in `next`, but not in feature depends on a topic that is in `seen`, but not in `master`,
`master`, fork a branch from the tip of `master`, merge these topics base your work on the tip of that topic.
to the branch, and work on that branch. You can remind yourself of
how you prepared the base with `git log --first-parent master..`.
* Corrections and enhancements to a topic not yet in `master` should * Corrections and enhancements to a topic not yet in `master` should
be based on the tip of that topic. If the topic has not been merged be based on the tip of that topic. If the topic has not been merged
@ -30,10 +28,10 @@ change is relevant to.
into the series. into the series.
* In the exceptional case that a new feature depends on several topics * In the exceptional case that a new feature depends on several topics
not in `master`, start working on `next` or `seen` privately and not in `master`, start working on `next` or `seen` privately and send
send out patches only for discussion. Once your new feature starts out patches for discussion. Before the final merge, you may have to
to stabilize, you would have to rebase it (see the "depends on other wait until some of the dependent topics graduate to `master`, and
topics" above). rebase your work.
* Some parts of the system have dedicated maintainers with their own * Some parts of the system have dedicated maintainers with their own
repositories (see the section "Subsystems" below). Changes to repositories (see the section "Subsystems" below). Changes to
@ -73,13 +71,8 @@ Make sure that you have tests for the bug you are fixing. See
[[tests]] [[tests]]
When adding a new feature, make sure that you have new tests to show When adding a new feature, make sure that you have new tests to show
the feature triggers the new behavior when it should, and to show the the feature triggers the new behavior when it should, and to show the
feature does not trigger when it shouldn't. After any code change, feature does not trigger when it shouldn't. After any code change, make
make sure that the entire test suite passes. When fixing a bug, make sure that the entire test suite passes.
sure you have new tests that break if somebody else breaks what you
fixed by accident to avoid regression. Also, try merging your work to
'next' and 'seen' and make sure the tests still pass; topics by others
that are still in flight may have unexpected interactions with what
you are trying to do in your topic.
Pushing to a fork of https://github.com/git/git will use their CI Pushing to a fork of https://github.com/git/git will use their CI
integration to test your changes on Linux, Mac and Windows. See the integration to test your changes on Linux, Mac and Windows. See the
@ -151,21 +144,8 @@ without external resources. Instead of giving a URL to a mailing list
archive, summarize the relevant points of the discussion. archive, summarize the relevant points of the discussion.
[[commit-reference]] [[commit-reference]]
If you want to reference a previous commit in the history of a stable
There are a few reasons why you may want to refer to another commit in branch, use the format "abbreviated hash (subject, date)", like this:
the "more stable" part of the history (i.e. on branches like `maint`,
`master`, and `next`):
. A commit that introduced the root cause of a bug you are fixing.
. A commit that introduced a feature that you are enhancing.
. A commit that conflicts with your work when you made a trial merge
of your work into `next` and `seen` for testing.
When you reference a commit on a more stable branch (like `master`,
`maint` and `next`), use the format "abbreviated hash (subject,
date)", like this:
.... ....
Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30) Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
@ -279,11 +259,9 @@ Please make sure your patch does not add commented out debugging code,
or include any extra files which do not relate to what your patch or include any extra files which do not relate to what your patch
is trying to achieve. Make sure to review is trying to achieve. Make sure to review
your patch after generating it, to ensure accuracy. Before your patch after generating it, to ensure accuracy. Before
sending out, please make sure it cleanly applies to the base you sending out, please make sure it cleanly applies to the `master`
have chosen in the "Decide what to base your work on" section, branch head. If you are preparing a work based on "next" branch,
and unless it targets the `master` branch (which is the default), that is fine, but please mark it as such.
mark your patches as such.
[[send-patches]] [[send-patches]]
=== Sending your patches. === Sending your patches.
@ -387,10 +365,7 @@ Security mailing list{security-ml-ref}.
Send your patch with "To:" set to the mailing list, with "cc:" listing Send your patch with "To:" set to the mailing list, with "cc:" listing
people who are involved in the area you are touching (the `git people who are involved in the area you are touching (the `git
contacts` command in `contrib/contacts/` can help to contacts` command in `contrib/contacts/` can help to
identify them), to solicit comments and reviews. Also, when you made identify them), to solicit comments and reviews.
trial merges of your topic to `next` and `seen`, you may have noticed
work by others conflicting with your changes. There is a good possibility
that these people may know the area you are touching well.
:current-maintainer: footnote:[The current maintainer: gitster@pobox.com] :current-maintainer: footnote:[The current maintainer: gitster@pobox.com]
:git-ml: footnote:[The mailing list: git@vger.kernel.org] :git-ml: footnote:[The mailing list: git@vger.kernel.org]

View File

@ -262,19 +262,11 @@ color::
colors (at most two, one for foreground and one for background) colors (at most two, one for foreground and one for background)
and attributes (as many as you want), separated by spaces. and attributes (as many as you want), separated by spaces.
+ +
The basic colors accepted are `normal`, `black`, `red`, `green`, The basic colors accepted are `normal`, `black`, `red`, `green`, `yellow`,
`yellow`, `blue`, `magenta`, `cyan`, `white` and `default`. The first `blue`, `magenta`, `cyan` and `white`. The first color given is the
color given is the foreground; the second is the background. All the foreground; the second is the background. All the basic colors except
basic colors except `normal` and `default` have a bright variant that can `normal` have a bright variant that can be specified by prefixing the
be specified by prefixing the color with `bright`, like `brightred`. color with `bright`, like `brightred`.
+
The color `normal` makes no change to the color. It is the same as an
empty string, but can be used as the foreground color when specifying a
background color alone (for example, "normal red").
+
The color `default` explicitly resets the color to the terminal default,
for example to specify a cleared background. Although it varies between
terminals, this is usually not the same as setting to "white black".
+ +
Colors may also be given as numbers between 0 and 255; these use ANSI Colors may also be given as numbers between 0 and 255; these use ANSI
256-color mode (but note that not all terminals may support this). If 256-color mode (but note that not all terminals may support this). If
@ -288,11 +280,6 @@ The position of any attributes with respect to the colors
be turned off by prefixing them with `no` or `no-` (e.g., `noreverse`, be turned off by prefixing them with `no` or `no-` (e.g., `noreverse`,
`no-ul`, etc). `no-ul`, etc).
+ +
The pseudo-attribute `reset` resets all colors and attributes before
applying the specified coloring. For example, `reset green` will result
in a green foreground and default background without any active
attributes.
+
An empty color string produces no color effect at all. This can be used An empty color string produces no color effect at all. This can be used
to avoid coloring specific elements without disabling color entirely. to avoid coloring specific elements without disabling color entirely.
+ +
@ -462,6 +449,8 @@ include::config/rerere.txt[]
include::config/reset.txt[] include::config/reset.txt[]
include::config/safe.txt[]
include::config/sendemail.txt[] include::config/sendemail.txt[]
include::config/sequencer.txt[] include::config/sequencer.txt[]

View File

@ -7,8 +7,7 @@ branch.autoSetupMerge::
automatic setup is done; `true` -- automatic setup is done when the automatic setup is done; `true` -- automatic setup is done when the
starting point is a remote-tracking branch; `always` -- starting point is a remote-tracking branch; `always` --
automatic setup is done when the starting point is either a automatic setup is done when the starting point is either a
local branch or remote-tracking branch; `inherit` -- if the starting point local branch or remote-tracking
has a tracking configuration, it is copied to the new
branch. This option defaults to true. branch. This option defaults to true.
branch.autoSetupRebase:: branch.autoSetupRebase::

View File

@ -34,7 +34,7 @@ gpg.minTrustLevel::
* `fully` * `fully`
* `ultimate` * `ultimate`
gpg.ssh.defaultKeyCommand:: gpg.ssh.defaultKeyCommand:
This command that will be run when user.signingkey is not set and a ssh This command that will be run when user.signingkey is not set and a ssh
signature is requested. On successful exit a valid ssh public key is signature is requested. On successful exit a valid ssh public key is
expected in the first line of its output. To automatically use the first expected in the first line of its output. To automatically use the first
@ -44,7 +44,7 @@ gpg.ssh.allowedSignersFile::
A file containing ssh public keys which you are willing to trust. A file containing ssh public keys which you are willing to trust.
The file consists of one or more lines of principals followed by an ssh The file consists of one or more lines of principals followed by an ssh
public key. public key.
e.g.: `user1@example.com,user2@example.com ssh-rsa AAAAX1...` e.g.: user1@example.com,user2@example.com ssh-rsa AAAAX1...
See ssh-keygen(1) "ALLOWED SIGNERS" for details. See ssh-keygen(1) "ALLOWED SIGNERS" for details.
The principal is only used to identify the key and is available when The principal is only used to identify the key and is available when
verifying a signature. verifying a signature.
@ -64,11 +64,6 @@ A repository that only allows signed commits can store the file
in the repository itself using a path relative to the top-level of the working tree. in the repository itself using a path relative to the top-level of the working tree.
This way only committers with an already valid key can add or change keys in the keyring. This way only committers with an already valid key can add or change keys in the keyring.
+ +
Since OpensSSH 8.8 this file allows specifying a key lifetime using valid-after &
valid-before options. Git will mark signatures as valid if the signing key was
valid at the time of the signatures creation. This allows users to change a
signing key without invalidating all previously made signatures.
+
Using a SSH CA key with the cert-authority option Using a SSH CA key with the cert-authority option
(see ssh-keygen(1) "CERTIFICATES") is also valid. (see ssh-keygen(1) "CERTIFICATES") is also valid.

View File

@ -8,8 +8,7 @@ grep.patternType::
Set the default matching behavior. Using a value of 'basic', 'extended', Set the default matching behavior. Using a value of 'basic', 'extended',
'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`, 'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,
`--fixed-strings`, or `--perl-regexp` option accordingly, while the `--fixed-strings`, or `--perl-regexp` option accordingly, while the
value 'default' will use the `grep.extendedRegexp` option to choose value 'default' will return to the default matching behavior.
between 'basic' and 'extended'.
grep.extendedRegexp:: grep.extendedRegexp::
If set to true, enable `--extended-regexp` option by default. This If set to true, enable `--extended-regexp` option by default. This

View File

@ -4,14 +4,7 @@ merge.conflictStyle::
shows a `<<<<<<<` conflict marker, changes made by one side, shows a `<<<<<<<` conflict marker, changes made by one side,
a `=======` marker, changes made by the other side, and then a `=======` marker, changes made by the other side, and then
a `>>>>>>>` marker. An alternate style, "diff3", adds a `|||||||` a `>>>>>>>` marker. An alternate style, "diff3", adds a `|||||||`
marker and the original text before the `=======` marker. The marker and the original text before the `=======` marker.
"merge" style tends to produce smaller conflict regions than diff3,
both because of the exclusion of the original text, and because
when a subset of lines match on the two sides they are just pulled
out of the conflict region. Another alternate style, "zdiff3", is
similar to diff3 but removes matching lines on the two sides from
the conflict region when those matching lines appear near either
the beginning or end of a conflict region.
merge.defaultToUpstream:: merge.defaultToUpstream::
If merge is called without any commit argument, merge the upstream If merge is called without any commit argument, merge the upstream

View File

@ -0,0 +1,42 @@
safe.directory::
These config entries specify Git-tracked directories that are
considered safe even if they are owned by someone other than the
current user. By default, Git will refuse to even parse a Git
config of a repository owned by someone else, let alone run its
hooks, and this config setting allows users to specify exceptions,
e.g. for intentionally shared repositories (see the `--shared`
option in linkgit:git-init[1]).
+
This is a multi-valued setting, i.e. you can add more than one directory
via `git config --add`. To reset the list of safe directories (e.g. to
override any such directories specified in the system config), add a
`safe.directory` entry with an empty value.
+
This config setting is only respected when specified in a system or global
config, not when it is specified in a repository config or via the command
line option `-c safe.directory=<path>`.
+
The value of this setting is interpolated, i.e. `~/<path>` expands to a
path relative to the home directory and `%(prefix)/<path>` expands to a
path relative to Git's (runtime) prefix.
+
To completely opt-out of this security check, set `safe.directory` to the
string `*`. This will allow all repositories to be treated as if their
directory was listed in the `safe.directory` list. If `safe.directory=*`
is set in system config and you want to re-enable this protection, then
initialize your list with an empty value before listing the repositories
that you deem safe.
+
As explained, Git only allows you to access repositories owned by
yourself, i.e. the user who is running Git, by default. When Git
is running as 'root' in a non Windows platform that provides sudo,
however, git checks the SUDO_UID environment variable that sudo creates
and will allow access to the uid recorded as its value in addition to
the id from 'root'.
This is to make it easy to perform a common sequence during installation
"make && sudo make install". A git process running under 'sudo' runs as
'root' but the 'sudo' command exports the environment variable to record
which id the original user has.
If that is not what you would prefer and want git to only trust
repositories that are owned by root instead, then you can remove
the `SUDO_UID` variable from root's environment before invoking git.

View File

@ -36,13 +36,10 @@ user.signingKey::
commit, you can override the default selection with this variable. commit, you can override the default selection with this variable.
This option is passed unchanged to gpg's --local-user parameter, This option is passed unchanged to gpg's --local-user parameter,
so you may specify a key using any method that gpg supports. so you may specify a key using any method that gpg supports.
If gpg.format is set to `ssh` this can contain the path to either If gpg.format is set to "ssh" this can contain the literal ssh public
your private ssh key or the public key when ssh-agent is used. key (e.g.: "ssh-rsa XXXXXX identifier") or a file which contains it and
Alternatively it can contain a public key prefixed with `key::` corresponds to the private key used for signing. The private key
directly (e.g.: "key::ssh-rsa XXXXXX identifier"). The private key needs to be available via ssh-agent. Alternatively it can be set to
needs to be available via ssh-agent. If not set git will call a file containing a private key directly. If not set git will call
gpg.ssh.defaultKeyCommand (e.g.: "ssh-add -L") and try to use the gpg.ssh.defaultKeyCommand (e.g.: "ssh-add -L") and try to use the first
first key available. For backward compatibility, a raw key which key available.
begins with "ssh-", such as "ssh-rsa XXXXXX identifier", is treated
as "key::ssh-rsa XXXXXX identifier", but this form is deprecated;
use the `key::` form instead.

View File

@ -5,9 +5,9 @@ The `GIT_AUTHOR_DATE` and `GIT_COMMITTER_DATE` environment variables
support the following date formats: support the following date formats:
Git internal format:: Git internal format::
It is `<unix-timestamp> <time-zone-offset>`, where It is `<unix timestamp> <time zone offset>`, where `<unix
`<unix-timestamp>` is the number of seconds since the UNIX epoch. timestamp>` is the number of seconds since the UNIX epoch.
`<time-zone-offset>` is a positive or negative offset from UTC. `<time zone offset>` is a positive or negative offset from UTC.
For example CET (which is 1 hour ahead of UTC) is `+0100`. For example CET (which is 1 hour ahead of UTC) is `+0100`.
RFC 2822:: RFC 2822::

View File

@ -16,9 +16,8 @@ SYNOPSIS
[--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet] [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
[--[no-]scissors] [-S[<keyid>]] [--patch-format=<format>] [--[no-]scissors] [-S[<keyid>]] [--patch-format=<format>]
[--quoted-cr=<action>] [--quoted-cr=<action>]
[--empty=(stop|drop|keep)]
[(<mbox> | <Maildir>)...] [(<mbox> | <Maildir>)...]
'git am' (--continue | --skip | --abort | --quit | --show-current-patch[=(diff|raw)] | --allow-empty) 'git am' (--continue | --skip | --abort | --quit | --show-current-patch[=(diff|raw)])
DESCRIPTION DESCRIPTION
----------- -----------
@ -64,14 +63,6 @@ OPTIONS
--quoted-cr=<action>:: --quoted-cr=<action>::
This flag will be passed down to 'git mailinfo' (see linkgit:git-mailinfo[1]). This flag will be passed down to 'git mailinfo' (see linkgit:git-mailinfo[1]).
--empty=(stop|drop|keep)::
By default, or when the option is set to 'stop', the command
errors out on an input e-mail message lacking a patch
and stops into the middle of the current am session. When this
option is set to 'drop', skip such an e-mail message instead.
When this option is set to 'keep', create an empty commit,
recording the contents of the e-mail message as its log.
-m:: -m::
--message-id:: --message-id::
Pass the `-m` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]), Pass the `-m` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]),
@ -200,11 +191,6 @@ default. You can use `--no-utf8` to override this.
the e-mail message; if `diff`, show the diff portion only. the e-mail message; if `diff`, show the diff portion only.
Defaults to `raw`. Defaults to `raw`.
--allow-empty::
After a patch failure on an input e-mail message lacking a patch,
create an empty commit with the contents of the e-mail message
as its log message.
DISCUSSION DISCUSSION
---------- ----------

View File

@ -16,7 +16,7 @@ SYNOPSIS
[--ignore-space-change | --ignore-whitespace] [--ignore-space-change | --ignore-whitespace]
[--whitespace=(nowarn|warn|fix|error|error-all)] [--whitespace=(nowarn|warn|fix|error|error-all)]
[--exclude=<path>] [--include=<path>] [--directory=<root>] [--exclude=<path>] [--include=<path>] [--directory=<root>]
[--verbose | --quiet] [--unsafe-paths] [--allow-empty] [<patch>...] [--verbose] [--unsafe-paths] [<patch>...]
DESCRIPTION DESCRIPTION
----------- -----------
@ -228,11 +228,6 @@ behavior:
current patch being applied will be printed. This option will cause current patch being applied will be printed. This option will cause
additional information to be reported. additional information to be reported.
-q::
--quiet::
Suppress stderr output. Messages about patch status and progress
will not be printed.
--recount:: --recount::
Do not trust the line counts in the hunk headers, but infer them Do not trust the line counts in the hunk headers, but infer them
by inspecting the patch (e.g. after editing the patch without by inspecting the patch (e.g. after editing the patch without
@ -256,10 +251,6 @@ When `git apply` is used as a "better GNU patch", the user can pass
the `--unsafe-paths` option to override this safety check. This option the `--unsafe-paths` option to override this safety check. This option
has no effect when `--index` or `--cached` is in use. has no effect when `--index` or `--cached` is in use.
--allow-empty::
Don't return error for patches containing no diff. This includes
empty patches and patches with commit text only.
CONFIGURATION CONFIGURATION
------------- -------------

View File

@ -9,14 +9,14 @@ git-archimport - Import a GNU Arch repository into Git
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git archimport' [-h] [-v] [-o] [-a] [-f] [-T] [-D <depth>] [-t <tempdir>] 'git archimport' [-h] [-v] [-o] [-a] [-f] [-T] [-D depth] [-t tempdir]
<archive>/<branch>[:<git-branch>]... <archive/branch>[:<git-branch>] ...
DESCRIPTION DESCRIPTION
----------- -----------
Imports a project from one or more GNU Arch repositories. Imports a project from one or more GNU Arch repositories.
It will follow branches It will follow branches
and repositories within the namespaces defined by the <archive>/<branch> and repositories within the namespaces defined by the <archive/branch>
parameters supplied. If it cannot find the remote branch a merge comes from parameters supplied. If it cannot find the remote branch a merge comes from
it will just import it as a regular commit. If it can find it, it will mark it it will just import it as a regular commit. If it can find it, it will mark it
as a merge whenever possible (see discussion below). as a merge whenever possible (see discussion below).
@ -27,7 +27,7 @@ import new branches within the provided roots.
It expects to be dealing with one project only. If it sees It expects to be dealing with one project only. If it sees
branches that have different roots, it will refuse to run. In that case, branches that have different roots, it will refuse to run. In that case,
edit your <archive>/<branch> parameters to define clearly the scope of the edit your <archive/branch> parameters to define clearly the scope of the
import. import.
'git archimport' uses `tla` extensively in the background to access the 'git archimport' uses `tla` extensively in the background to access the
@ -42,7 +42,7 @@ incremental imports.
While 'git archimport' will try to create sensible branch names for the While 'git archimport' will try to create sensible branch names for the
archives that it imports, it is also possible to specify Git branch names archives that it imports, it is also possible to specify Git branch names
manually. To do so, write a Git branch name after each <archive>/<branch> manually. To do so, write a Git branch name after each <archive/branch>
parameter, separated by a colon. This way, you can shorten the Arch parameter, separated by a colon. This way, you can shorten the Arch
branch names and convert Arch jargon to Git jargon, for example mapping a branch names and convert Arch jargon to Git jargon, for example mapping a
"PROJECT{litdd}devo{litdd}VERSION" branch to "master". "PROJECT{litdd}devo{litdd}VERSION" branch to "master".
@ -104,8 +104,8 @@ OPTIONS
Override the default tempdir. Override the default tempdir.
<archive>/<branch>:: <archive/branch>::
<archive>/<branch> identifier in a format that `tla log` understands. Archive/branch identifier in a format that `tla log` understands.
GIT GIT

View File

@ -16,7 +16,7 @@ SYNOPSIS
[--points-at <object>] [--format=<format>] [--points-at <object>] [--format=<format>]
[(-r | --remotes) | (-a | --all)] [(-r | --remotes) | (-a | --all)]
[--list] [<pattern>...] [--list] [<pattern>...]
'git branch' [--track [direct|inherit] | --no-track] [-f] <branchname> [<start-point>] 'git branch' [--track | --no-track] [-f] <branchname> [<start-point>]
'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>] 'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
'git branch' --unset-upstream [<branchname>] 'git branch' --unset-upstream [<branchname>]
'git branch' (-m | -M) [<oldbranch>] <newbranch> 'git branch' (-m | -M) [<oldbranch>] <newbranch>
@ -206,34 +206,24 @@ This option is only applicable in non-verbose mode.
Display the full sha1s in the output listing rather than abbreviating them. Display the full sha1s in the output listing rather than abbreviating them.
-t:: -t::
--track [inherit|direct]:: --track::
When creating a new branch, set up `branch.<name>.remote` and When creating a new branch, set up `branch.<name>.remote` and
`branch.<name>.merge` configuration entries to set "upstream" tracking `branch.<name>.merge` configuration entries to mark the
configuration for the new branch. This start-point branch as "upstream" from the new branch. This
configuration will tell git to show the relationship between the configuration will tell git to show the relationship between the
two branches in `git status` and `git branch -v`. Furthermore, two branches in `git status` and `git branch -v`. Furthermore,
it directs `git pull` without arguments to pull from the it directs `git pull` without arguments to pull from the
upstream when the new branch is checked out. upstream when the new branch is checked out.
+ +
The exact upstream branch is chosen depending on the optional argument: This behavior is the default when the start point is a remote-tracking branch.
`--track` or `--track direct` means to use the start-point branch itself as the
upstream; `--track inherit` means to copy the upstream configuration of the
start-point branch.
+
`--track direct` is the default when the start point is a remote-tracking branch.
Set the branch.autoSetupMerge configuration variable to `false` if you Set the branch.autoSetupMerge configuration variable to `false` if you
want `git switch`, `git checkout` and `git branch` to always behave as if `--no-track` want `git switch`, `git checkout` and `git branch` to always behave as if `--no-track`
were given. Set it to `always` if you want this behavior when the were given. Set it to `always` if you want this behavior when the
start-point is either a local or remote-tracking branch. Set it to start-point is either a local or remote-tracking branch.
`inherit` if you want to copy the tracking configuration from the
branch point.
+
See linkgit:git-pull[1] and linkgit:git-config[1] for additional discussion on
how the `branch.<name>.remote` and `branch.<name>.merge` options are used.
--no-track:: --no-track::
Do not set up "upstream" configuration, even if the Do not set up "upstream" configuration, even if the
branch.autoSetupMerge configuration variable is set. branch.autoSetupMerge configuration variable is true.
--set-upstream:: --set-upstream::
As this option had confusing syntax, it is no longer supported. As this option had confusing syntax, it is no longer supported.

View File

@ -11,7 +11,7 @@ SYNOPSIS
'git checkout' [-q] [-f] [-m] [<branch>] 'git checkout' [-q] [-f] [-m] [<branch>]
'git checkout' [-q] [-f] [-m] --detach [<branch>] 'git checkout' [-q] [-f] [-m] --detach [<branch>]
'git checkout' [-q] [-f] [-m] [--detach] <commit> 'git checkout' [-q] [-f] [-m] [--detach] <commit>
'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new-branch>] [<start-point>] 'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <pathspec>... 'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <pathspec>...
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] --pathspec-from-file=<file> [--pathspec-file-nul] 'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] --pathspec-from-file=<file> [--pathspec-file-nul]
'git checkout' (-p|--patch) [<tree-ish>] [--] [<pathspec>...] 'git checkout' (-p|--patch) [<tree-ish>] [--] [<pathspec>...]
@ -43,7 +43,7 @@ You could omit `<branch>`, in which case the command degenerates to
rather expensive side-effects to show only the tracking information, rather expensive side-effects to show only the tracking information,
if exists, for the current branch. if exists, for the current branch.
'git checkout' -b|-B <new-branch> [<start-point>]:: 'git checkout' -b|-B <new_branch> [<start point>]::
Specifying `-b` causes a new branch to be created as if Specifying `-b` causes a new branch to be created as if
linkgit:git-branch[1] were called and then checked out. In linkgit:git-branch[1] were called and then checked out. In
@ -52,11 +52,11 @@ if exists, for the current branch.
`--track` without `-b` implies branch creation; see the `--track` without `-b` implies branch creation; see the
description of `--track` below. description of `--track` below.
+ +
If `-B` is given, `<new-branch>` is created if it doesn't exist; otherwise, it If `-B` is given, `<new_branch>` is created if it doesn't exist; otherwise, it
is reset. This is the transactional equivalent of is reset. This is the transactional equivalent of
+ +
------------ ------------
$ git branch -f <branch> [<start-point>] $ git branch -f <branch> [<start point>]
$ git checkout <branch> $ git checkout <branch>
------------ ------------
+ +
@ -145,18 +145,18 @@ as `ours` (i.e. "our shared canonical history"), while what you did
on your side branch as `theirs` (i.e. "one contributor's work on top on your side branch as `theirs` (i.e. "one contributor's work on top
of it"). of it").
-b <new-branch>:: -b <new_branch>::
Create a new branch named `<new-branch>` and start it at Create a new branch named `<new_branch>` and start it at
`<start-point>`; see linkgit:git-branch[1] for details. `<start_point>`; see linkgit:git-branch[1] for details.
-B <new-branch>:: -B <new_branch>::
Creates the branch `<new-branch>` and start it at `<start-point>`; Creates the branch `<new_branch>` and start it at `<start_point>`;
if it already exists, then reset it to `<start-point>`. This is if it already exists, then reset it to `<start_point>`. This is
equivalent to running "git branch" with "-f"; see equivalent to running "git branch" with "-f"; see
linkgit:git-branch[1] for details. linkgit:git-branch[1] for details.
-t:: -t::
--track [direct|inherit]:: --track::
When creating a new branch, set up "upstream" configuration. See When creating a new branch, set up "upstream" configuration. See
"--track" in linkgit:git-branch[1] for details. "--track" in linkgit:git-branch[1] for details.
+ +
@ -210,16 +210,16 @@ variable.
`<commit>` is not a branch name. See the "DETACHED HEAD" section `<commit>` is not a branch name. See the "DETACHED HEAD" section
below for details. below for details.
--orphan <new-branch>:: --orphan <new_branch>::
Create a new 'orphan' branch, named `<new-branch>`, started from Create a new 'orphan' branch, named `<new_branch>`, started from
`<start-point>` and switch to it. The first commit made on this `<start_point>` and switch to it. The first commit made on this
new branch will have no parents and it will be the root of a new new branch will have no parents and it will be the root of a new
history totally disconnected from all the other branches and history totally disconnected from all the other branches and
commits. commits.
+ +
The index and the working tree are adjusted as if you had previously run The index and the working tree are adjusted as if you had previously run
`git checkout <start-point>`. This allows you to start a new history `git checkout <start_point>`. This allows you to start a new history
that records a set of paths similar to `<start-point>` by easily running that records a set of paths similar to `<start_point>` by easily running
`git commit -a` to make the root commit. `git commit -a` to make the root commit.
+ +
This can be useful when you want to publish the tree from a commit This can be useful when you want to publish the tree from a commit
@ -229,7 +229,7 @@ whose full history contains proprietary or otherwise encumbered bits of
code. code.
+ +
If you want to start a disconnected history that records a set of paths If you want to start a disconnected history that records a set of paths
that is totally different from the one of `<start-point>`, then you should that is totally different from the one of `<start_point>`, then you should
clear the index and the working tree right after creating the orphan clear the index and the working tree right after creating the orphan
branch by running `git rm -rf .` from the top level of the working tree. branch by running `git rm -rf .` from the top level of the working tree.
Afterwards you will be ready to prepare your new files, repopulating the Afterwards you will be ready to prepare your new files, repopulating the
@ -266,7 +266,8 @@ When switching branches with `--merge`, staged changes may be lost.
The same as `--merge` option above, but changes the way the The same as `--merge` option above, but changes the way the
conflicting hunks are presented, overriding the conflicting hunks are presented, overriding the
`merge.conflictStyle` configuration variable. Possible values are `merge.conflictStyle` configuration variable. Possible values are
"merge" (default), "diff3", and "zdiff3". "merge" (default) and "diff3" (in addition to what is shown by
"merge" style, shows the original contents).
-p:: -p::
--patch:: --patch::
@ -340,10 +341,10 @@ As a special case, you may use `A...B` as a shortcut for the
merge base of `A` and `B` if there is exactly one merge base. You can merge base of `A` and `B` if there is exactly one merge base. You can
leave out at most one of `A` and `B`, in which case it defaults to `HEAD`. leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
<new-branch>:: <new_branch>::
Name for the new branch. Name for the new branch.
<start-point>:: <start_point>::
The name of a commit at which to start the new branch; see The name of a commit at which to start the new branch; see
linkgit:git-branch[1] for details. Defaults to `HEAD`. linkgit:git-branch[1] for details. Defaults to `HEAD`.
+ +

View File

@ -8,7 +8,7 @@ git-cherry-pick - Apply the changes introduced by some existing commits
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git cherry-pick' [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff] 'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
[-S[<keyid>]] <commit>... [-S[<keyid>]] <commit>...
'git cherry-pick' (--continue | --skip | --abort | --quit) 'git cherry-pick' (--continue | --skip | --abort | --quit)
@ -81,8 +81,8 @@ OPTIONS
described above, and `-r` was to disable it. Now the described above, and `-r` was to disable it. Now the
default is not to do `-x` so this option is a no-op. default is not to do `-x` so this option is a no-op.
-m <parent-number>:: -m parent-number::
--mainline <parent-number>:: --mainline parent-number::
Usually you cannot cherry-pick a merge because you do not know which Usually you cannot cherry-pick a merge because you do not know which
side of the merge should be considered the mainline. This side of the merge should be considered the mainline. This
option specifies the parent number (starting from 1) of option specifies the parent number (starting from 1) of

View File

@ -9,10 +9,10 @@ git-clone - Clone a repository into a new directory
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git clone' [--template=<template-directory>] 'git clone' [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror] [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
[-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>] [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
[--dissociate] [--separate-git-dir <git-dir>] [--dissociate] [--separate-git-dir <git dir>]
[--depth <depth>] [--[no-]single-branch] [--no-tags] [--depth <depth>] [--[no-]single-branch] [--no-tags]
[--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules] [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
[--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow] [--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow]
@ -167,10 +167,10 @@ objects from the source repository into a pack in the cloned repository.
configuration variables are created. configuration variables are created.
--sparse:: --sparse::
Employ a sparse-checkout, with only files in the toplevel Initialize the sparse-checkout file so the working
directory initially being present. The directory starts with only the files in the root
linkgit:git-sparse-checkout[1] command can be used to grow the of the repository. The sparse-checkout file can be
working directory as needed. modified to grow the working directory as needed.
--filter=<filter-spec>:: --filter=<filter-spec>::
Use the partial clone feature and request that the server sends Use the partial clone feature and request that the server sends
@ -211,7 +211,7 @@ objects from the source repository into a pack in the cloned repository.
via ssh, this specifies a non-default path for the command via ssh, this specifies a non-default path for the command
run on the other end. run on the other end.
--template=<template-directory>:: --template=<template_directory>::
Specify the directory from which templates will be used; Specify the directory from which templates will be used;
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].) (See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
@ -294,7 +294,7 @@ or `--mirror` is given)
superproject's recorded SHA-1. Equivalent to passing `--remote` to superproject's recorded SHA-1. Equivalent to passing `--remote` to
`git submodule update`. `git submodule update`.
--separate-git-dir=<git-dir>:: --separate-git-dir=<git dir>::
Instead of placing the cloned repository where it is supposed Instead of placing the cloned repository where it is supposed
to be, place the cloned repository at the specified directory, to be, place the cloned repository at the specified directory,
then make a filesystem-agnostic Git symbolic link to there. then make a filesystem-agnostic Git symbolic link to there.

View File

@ -9,20 +9,20 @@ git-config - Get and set repository or global options
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git config' [<file-option>] [--type=<type>] [--fixed-value] [--show-origin] [--show-scope] [-z|--null] <name> [<value> [<value-pattern>]] 'git config' [<file-option>] [--type=<type>] [--fixed-value] [--show-origin] [--show-scope] [-z|--null] name [value [value-pattern]]
'git config' [<file-option>] [--type=<type>] --add <name> <value> 'git config' [<file-option>] [--type=<type>] --add name value
'git config' [<file-option>] [--type=<type>] [--fixed-value] --replace-all <name> <value> [<value-pattern>] 'git config' [<file-option>] [--type=<type>] [--fixed-value] --replace-all name value [value-pattern]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get <name> [<value-pattern>] 'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get name [value-pattern]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get-all <name> [<value-pattern>] 'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get-all name [value-pattern]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] [--name-only] --get-regexp <name-regex> [<value-pattern>] 'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] [--name-only] --get-regexp name_regex [value-pattern]
'git config' [<file-option>] [--type=<type>] [-z|--null] --get-urlmatch <name> <URL> 'git config' [<file-option>] [--type=<type>] [-z|--null] --get-urlmatch name URL
'git config' [<file-option>] [--fixed-value] --unset <name> [<value-pattern>] 'git config' [<file-option>] [--fixed-value] --unset name [value-pattern]
'git config' [<file-option>] [--fixed-value] --unset-all <name> [<value-pattern>] 'git config' [<file-option>] [--fixed-value] --unset-all name [value-pattern]
'git config' [<file-option>] --rename-section <old-name> <new-name> 'git config' [<file-option>] --rename-section old_name new_name
'git config' [<file-option>] --remove-section <name> 'git config' [<file-option>] --remove-section name
'git config' [<file-option>] [--show-origin] [--show-scope] [-z|--null] [--name-only] -l | --list 'git config' [<file-option>] [--show-origin] [--show-scope] [-z|--null] [--name-only] -l | --list
'git config' [<file-option>] --get-color <name> [<default>] 'git config' [<file-option>] --get-color name [default]
'git config' [<file-option>] --get-colorbool <name> [<stdout-is-tty>] 'git config' [<file-option>] --get-colorbool name [stdout-is-tty]
'git config' [<file-option>] -e | --edit 'git config' [<file-option>] -e | --edit
DESCRIPTION DESCRIPTION
@ -102,9 +102,9 @@ OPTIONS
in which section and variable names are lowercased, but subsection in which section and variable names are lowercased, but subsection
names are not. names are not.
--get-urlmatch <name> <URL>:: --get-urlmatch name URL::
When given a two-part name section.key, the value for When given a two-part name section.key, the value for
section.<URL>.key whose <URL> part matches the best to the section.<url>.key whose <url> part matches the best to the
given URL is returned (if no such key exists, the value for given URL is returned (if no such key exists, the value for
section.key is used as a fallback). When given just the section.key is used as a fallback). When given just the
section as name, do so for all the keys in the section and section as name, do so for all the keys in the section and
@ -145,8 +145,8 @@ See also <<FILES>>.
read from or written to if `extensions.worktreeConfig` is read from or written to if `extensions.worktreeConfig` is
present. If not it's the same as `--local`. present. If not it's the same as `--local`.
-f <config-file>:: -f config-file::
--file <config-file>:: --file config-file::
For writing options: write to the specified file rather than the For writing options: write to the specified file rather than the
repository `.git/config`. repository `.git/config`.
+ +
@ -155,7 +155,7 @@ available files.
+ +
See also <<FILES>>. See also <<FILES>>.
--blob <blob>:: --blob blob::
Similar to `--file` but use the given blob instead of a file. E.g. Similar to `--file` but use the given blob instead of a file. E.g.
you can use 'master:.gitmodules' to read values from the file you can use 'master:.gitmodules' to read values from the file
'.gitmodules' in the master branch. See "SPECIFYING REVISIONS" '.gitmodules' in the master branch. See "SPECIFYING REVISIONS"
@ -246,18 +246,18 @@ Valid `<type>`'s include:
all queried config options with the scope of that value all queried config options with the scope of that value
(local, global, system, command). (local, global, system, command).
--get-colorbool <name> [<stdout-is-tty>]:: --get-colorbool name [stdout-is-tty]::
Find the color setting for `<name>` (e.g. `color.diff`) and output Find the color setting for `name` (e.g. `color.diff`) and output
"true" or "false". `<stdout-is-tty>` should be either "true" or "true" or "false". `stdout-is-tty` should be either "true" or
"false", and is taken into account when configuration says "false", and is taken into account when configuration says
"auto". If `<stdout-is-tty>` is missing, then checks the standard "auto". If `stdout-is-tty` is missing, then checks the standard
output of the command itself, and exits with status 0 if color output of the command itself, and exits with status 0 if color
is to be used, or exits with status 1 otherwise. is to be used, or exits with status 1 otherwise.
When the color setting for `name` is undefined, the command uses When the color setting for `name` is undefined, the command uses
`color.ui` as fallback. `color.ui` as fallback.
--get-color <name> [<default>]:: --get-color name [default]::
Find the color configured for `name` (e.g. `color.diff.new`) and Find the color configured for `name` (e.g. `color.diff.new`) and
output it as the ANSI color escape sequence to the standard output it as the ANSI color escape sequence to the standard

View File

@ -8,7 +8,7 @@ git-credential - Retrieve and store user credentials
SYNOPSIS SYNOPSIS
-------- --------
------------------ ------------------
'git credential' (fill|approve|reject) git credential <fill|approve|reject>
------------------ ------------------
DESCRIPTION DESCRIPTION

View File

@ -9,8 +9,8 @@ git-cvsexportcommit - Export a single commit to a CVS checkout
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git cvsexportcommit' [-h] [-u] [-v] [-c] [-P] [-p] [-a] [-d <cvsroot>] 'git cvsexportcommit' [-h] [-u] [-v] [-c] [-P] [-p] [-a] [-d cvsroot]
[-w <cvs-workdir>] [-W] [-f] [-m <msgprefix>] [<parent-commit>] <commit-id> [-w cvsworkdir] [-W] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID
DESCRIPTION DESCRIPTION

View File

@ -11,9 +11,9 @@ SYNOPSIS
[verse] [verse]
'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] 'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
[-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>] [-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]
[-C <git-repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>] [-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
[-a] [-m] [-M <regex>] [-S <regex>] [-L <commit-limit>] [-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]
[-r <remote>] [-R] [<CVS-module>] [-r <remote>] [-R] [<CVS_module>]
DESCRIPTION DESCRIPTION
@ -59,7 +59,7 @@ OPTIONS
from `CVS/Root`. If no such file exists, it checks for the from `CVS/Root`. If no such file exists, it checks for the
`CVSROOT` environment variable. `CVSROOT` environment variable.
<CVS-module>:: <CVS_module>::
The CVS module you want to import. Relative to <CVSROOT>. The CVS module you want to import. Relative to <CVSROOT>.
If not given, 'git cvsimport' tries to read it from If not given, 'git cvsimport' tries to read it from
`CVS/Repository`. `CVS/Repository`.

View File

@ -9,7 +9,7 @@ git-diff-files - Compares files in the working tree and the index
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git diff-files' [-q] [-0|-1|-2|-3|-c|--cc] [<common-diff-options>] [<path>...] 'git diff-files' [-q] [-0|-1|-2|-3|-c|--cc] [<common diff options>] [<path>...]
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -9,7 +9,7 @@ git-diff-index - Compare a tree to the working tree or index
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git diff-index' [-m] [--cached] [--merge-base] [<common-diff-options>] <tree-ish> [<path>...] 'git diff-index' [-m] [--cached] [--merge-base] [<common diff options>] <tree-ish> [<path>...]
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -11,7 +11,7 @@ SYNOPSIS
[verse] [verse]
'git diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] 'git diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
[-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base] [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base]
[<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -9,7 +9,7 @@ git-fmt-merge-msg - Produce a merge commit message
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git fmt-merge-msg' [-m <message>] [--into-name <branch>] [--log[=<n>] | --no-log] 'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log]
'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] -F <file> 'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] -F <file>
DESCRIPTION DESCRIPTION
@ -44,10 +44,6 @@ OPTIONS
Use <message> instead of the branch names for the first line Use <message> instead of the branch names for the first line
of the log message. For use with `--log`. of the log message. For use with `--log`.
--into-name <branch>::
Prepare the merge message as if merging to the branch `<branch>`,
instead of the name of the real branch to which the merge is made.
-F <file>:: -F <file>::
--file <file>:: --file <file>::
Take the list of merged objects from <file> instead of Take the list of merged objects from <file> instead of

View File

@ -18,7 +18,7 @@ SYNOPSIS
[-n | --numbered | -N | --no-numbered] [-n | --numbered | -N | --no-numbered]
[--start-number <n>] [--numbered-files] [--start-number <n>] [--numbered-files]
[--in-reply-to=<message id>] [--suffix=.<sfx>] [--in-reply-to=<message id>] [--suffix=.<sfx>]
[--ignore-if-in-upstream] [--always] [--ignore-if-in-upstream]
[--cover-from-description=<mode>] [--cover-from-description=<mode>]
[--rfc] [--subject-prefix=<subject prefix>] [--rfc] [--subject-prefix=<subject prefix>]
[(--reroll-count|-v) <n>] [(--reroll-count|-v) <n>]
@ -192,10 +192,6 @@ will want to ensure that threading is disabled for `git send-email`.
patches being generated, and any patch that matches is patches being generated, and any patch that matches is
ignored. ignored.
--always::
Include patches for commits that do not introduce any change,
which are omitted by default.
--cover-from-description=<mode>:: --cover-from-description=<mode>::
Controls which parts of the cover letter will be automatically Controls which parts of the cover letter will be automatically
populated using the branch's description. populated using the branch's description.

View File

@ -12,7 +12,7 @@ SYNOPSIS
'git fsck' [--tags] [--root] [--unreachable] [--cache] [--no-reflogs] 'git fsck' [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]
[--[no-]full] [--strict] [--verbose] [--lost-found] [--[no-]full] [--strict] [--verbose] [--lost-found]
[--[no-]dangling] [--[no-]progress] [--connectivity-only] [--[no-]dangling] [--[no-]progress] [--connectivity-only]
[--[no-]name-objects] [<object>...] [--[no-]name-objects] [<object>*]
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -8,7 +8,7 @@ git-gui - A portable graphical interface to Git
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git gui' [<command>] [<arguments>] 'git gui' [<command>] [arguments]
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -9,14 +9,14 @@ SYNOPSIS
-------- --------
[verse] [verse]
'git help' [-a|--all [--[no-]verbose]] 'git help' [-a|--all [--[no-]verbose]]
[[-i|--info] [-m|--man] [-w|--web]] [<command>|<guide>] [[-i|--info] [-m|--man] [-w|--web]] [COMMAND|GUIDE]
'git help' [-g|--guides] 'git help' [-g|--guides]
'git help' [-c|--config] 'git help' [-c|--config]
DESCRIPTION DESCRIPTION
----------- -----------
With no options and no '<command>' or '<guide>' given, the synopsis of the 'git' With no options and no COMMAND or GUIDE given, the synopsis of the 'git'
command and a list of the most commonly used Git commands are printed command and a list of the most commonly used Git commands are printed
on the standard output. on the standard output.
@ -33,7 +33,7 @@ variables.
If an alias is given, git shows the definition of the alias on If an alias is given, git shows the definition of the alias on
standard output. To get the manual page for the aliased command, use standard output. To get the manual page for the aliased command, use
`git <command> --help`. `git COMMAND --help`.
Note that `git --help ...` is identical to `git help ...` because the Note that `git --help ...` is identical to `git help ...` because the
former is internally converted into the latter. former is internally converted into the latter.

View File

@ -9,7 +9,7 @@ git-http-fetch - Download from a remote Git repository via HTTP
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git http-fetch' [-c] [-t] [-a] [-d] [-v] [-w <filename>] [--recover] [--stdin | --packfile=<hash> | <commit>] <URL> 'git http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [--stdin | --packfile=<hash> | <commit>] <url>
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -9,7 +9,7 @@ git-http-push - Push objects over HTTP/DAV to another repository
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git http-push' [--all] [--dry-run] [--force] [--verbose] <URL> <ref> [<ref>...] 'git http-push' [--all] [--dry-run] [--force] [--verbose] <url> <ref> [<ref>...]
DESCRIPTION DESCRIPTION
----------- -----------
@ -63,15 +63,16 @@ of such patterns separated by a colon ":" (this means that a ref name
cannot have a colon in it). A single pattern '<name>' is just a cannot have a colon in it). A single pattern '<name>' is just a
shorthand for '<name>:<name>'. shorthand for '<name>:<name>'.
Each pattern pair '<src>:<dst>' consists of the source side (before Each pattern pair consists of the source side (before the colon)
the colon) and the destination side (after the colon). The ref to be and the destination side (after the colon). The ref to be
pushed is determined by finding a match that matches the source side, pushed is determined by finding a match that matches the source
and where it is pushed is determined by using the destination side. side, and where it is pushed is determined by using the
destination side.
- It is an error if '<src>' does not match exactly one of the - It is an error if <src> does not match exactly one of the
local refs. local refs.
- If '<dst>' does not match any remote ref, either - If <dst> does not match any remote ref, either
* it has to start with "refs/"; <dst> is used as the * it has to start with "refs/"; <dst> is used as the
destination literally in this case. destination literally in this case.

View File

@ -9,7 +9,7 @@ git-init-db - Creates an empty Git repository
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git init-db' [-q | --quiet] [--bare] [--template=<template-directory>] [--separate-git-dir <git-dir>] [--shared[=<permissions>]] 'git init-db' [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir <git dir>] [--shared[=<permissions>]]
DESCRIPTION DESCRIPTION

View File

@ -9,10 +9,10 @@ git-init - Create an empty Git repository or reinitialize an existing one
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git init' [-q | --quiet] [--bare] [--template=<template-directory>] 'git init' [-q | --quiet] [--bare] [--template=<template_directory>]
[--separate-git-dir <git-dir>] [--object-format=<format>] [--separate-git-dir <git dir>] [--object-format=<format>]
[-b <branch-name> | --initial-branch=<branch-name>] [-b <branch-name> | --initial-branch=<branch-name>]
[--shared[=<permissions>]] [<directory>] [--shared[=<permissions>]] [directory]
DESCRIPTION DESCRIPTION
@ -57,12 +57,12 @@ values are 'sha1' and (if enabled) 'sha256'. 'sha1' is the default.
+ +
include::object-format-disclaimer.txt[] include::object-format-disclaimer.txt[]
--template=<template-directory>:: --template=<template_directory>::
Specify the directory from which templates will be used. (See the "TEMPLATE Specify the directory from which templates will be used. (See the "TEMPLATE
DIRECTORY" section below.) DIRECTORY" section below.)
--separate-git-dir=<git-dir>:: --separate-git-dir=<git dir>::
Instead of initializing the repository as a directory to either `$GIT_DIR` or Instead of initializing the repository as a directory to either `$GIT_DIR` or
`./.git/`, create a text file there containing the path to the actual `./.git/`, create a text file there containing the path to the actual
@ -79,7 +79,7 @@ repository. If not specified, fall back to the default name (currently
`master`, but this is subject to change in the future; the name can be `master`, but this is subject to change in the future; the name can be
customized via the `init.defaultBranch` configuration variable). customized via the `init.defaultBranch` configuration variable).
--shared[=(false|true|umask|group|all|world|everybody|<perm>)]:: --shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
Specify that the Git repository is to be shared amongst several users. This Specify that the Git repository is to be shared amongst several users. This
allows users belonging to the same group to push into that allows users belonging to the same group to push into that
@ -110,16 +110,13 @@ the repository permissions.
Same as 'group', but make the repository readable by all users. Same as 'group', but make the repository readable by all users.
'<perm>':: '0xxx'::
'<perm>' is a 3-digit octal number prefixed with `0` and each file '0xxx' is an octal number and each file will have mode '0xxx'. '0xxx' will
will have mode '<perm>'. '<perm>' will override users' umask(2) override users' umask(2) value (and not only loosen permissions as 'group' and
value (and not only loosen permissions as 'group' and 'all' 'all' does). '0640' will create a repository which is group-readable, but not
does). '0640' will create a repository which is group-readable, but group-writable or accessible to others. '0660' will create a repo that is
not group-writable or accessible to others. '0660' will create a repo readable and writable to the current user and group, but inaccessible to others.
that is readable and writable to the current user and group, but
inaccessible to others (directories and executable files get their
`x` bit from the `r` bit for corresponding classes of users).
-- --
By default, the configuration flag `receive.denyNonFastForwards` is enabled By default, the configuration flag `receive.denyNonFastForwards` is enabled

View File

@ -9,7 +9,7 @@ git-log - Show commit logs
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git log' [<options>] [<revision-range>] [[--] <path>...] 'git log' [<options>] [<revision range>] [[--] <path>...]
DESCRIPTION DESCRIPTION
----------- -----------
@ -81,13 +81,13 @@ produced by `--stat`, etc.
include::line-range-options.txt[] include::line-range-options.txt[]
<revision-range>:: <revision range>::
Show only commits in the specified revision range. When no Show only commits in the specified revision range. When no
<revision-range> is specified, it defaults to `HEAD` (i.e. the <revision range> is specified, it defaults to `HEAD` (i.e. the
whole history leading to the current commit). `origin..HEAD` whole history leading to the current commit). `origin..HEAD`
specifies all the commits reachable from the current commit specifies all the commits reachable from the current commit
(i.e. `HEAD`), but not from `origin`. For a complete list of (i.e. `HEAD`), but not from `origin`. For a complete list of
ways to spell <revision-range>, see the 'Specifying Ranges' ways to spell <revision range>, see the 'Specifying Ranges'
section of linkgit:gitrevisions[7]. section of linkgit:gitrevisions[7].
[--] <path>...:: [--] <path>...::

View File

@ -10,9 +10,9 @@ SYNOPSIS
-------- --------
[verse] [verse]
'git ls-files' [-z] [-t] [-v] [-f] 'git ls-files' [-z] [-t] [-v] [-f]
[-c|--cached] [-d|--deleted] [-o|--others] [-i|--|ignored] (--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*
[-s|--stage] [-u|--unmerged] [-k|--|killed] [-m|--modified] (-[c|d|o|i|s|u|k|m])*
[--directory [--no-empty-directory]] [--eol] [--eol]
[--deduplicate] [--deduplicate]
[-x <pattern>|--exclude=<pattern>] [-x <pattern>|--exclude=<pattern>]
[-X <file>|--exclude-from=<file>] [-X <file>|--exclude-from=<file>]
@ -187,11 +187,6 @@ Both the <eolinfo> in the index ("i/<eolinfo>")
and in the working tree ("w/<eolinfo>") are shown for regular files, and in the working tree ("w/<eolinfo>") are shown for regular files,
followed by the ("attr/<eolattr>"). followed by the ("attr/<eolattr>").
--sparse::
If the index is sparse, show the sparse directories without expanding
to the contained files. Sparse directories will be shown with a
trailing slash, such as "x/" for a sparse directory "x".
\--:: \--::
Do not interpret any more arguments as options. Do not interpret any more arguments as options.

View File

@ -70,9 +70,6 @@ OPTIONS
--diff3:: --diff3::
Show conflicts in "diff3" style. Show conflicts in "diff3" style.
--zdiff3::
Show conflicts in "zdiff3" style.
--ours:: --ours::
--theirs:: --theirs::
--union:: --union::

View File

@ -9,7 +9,7 @@ git-merge-index - Run a merge for files needing merging
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git merge-index' [-o] [-q] <merge-program> (-a | ( [--] <file>...) ) 'git merge-index' [-o] [-q] <merge-program> (-a | [--] <file>*)
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -12,8 +12,7 @@ SYNOPSIS
'git merge' [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] 'git merge' [-n] [--stat] [--no-commit] [--squash] [--[no-]edit]
[--no-verify] [-s <strategy>] [-X <strategy-option>] [-S[<keyid>]] [--no-verify] [-s <strategy>] [-X <strategy-option>] [-S[<keyid>]]
[--[no-]allow-unrelated-histories] [--[no-]allow-unrelated-histories]
[--[no-]rerere-autoupdate] [-m <msg>] [-F <file>] [--[no-]rerere-autoupdate] [-m <msg>] [-F <file>] [<commit>...]
[--into-name <branch>] [<commit>...]
'git merge' (--continue | --abort | --quit) 'git merge' (--continue | --abort | --quit)
DESCRIPTION DESCRIPTION
@ -77,11 +76,6 @@ The 'git fmt-merge-msg' command can be
used to give a good default for automated 'git merge' used to give a good default for automated 'git merge'
invocations. The automated message can include the branch description. invocations. The automated message can include the branch description.
--into-name <branch>::
Prepare the default merge message as if merging to the branch
`<branch>`, instead of the name of the real branch to which
the merge is made.
-F <file>:: -F <file>::
--file=<file>:: --file=<file>::
Read the commit message to be used for the merge commit (in Read the commit message to be used for the merge commit (in
@ -246,8 +240,7 @@ from the RCS suite to present such a conflicted hunk, like this:
------------ ------------
Here are lines that are either unchanged from the common Here are lines that are either unchanged from the common
ancestor, or cleanly resolved because only one side changed, ancestor, or cleanly resolved because only one side changed.
or cleanly resolved because both sides changed the same way.
<<<<<<< yours:sample.txt <<<<<<< yours:sample.txt
Conflict resolution is hard; Conflict resolution is hard;
let's go shopping. let's go shopping.
@ -268,37 +261,16 @@ side wants to say it is hard and you'd prefer to go shopping, while the
other side wants to claim it is easy. other side wants to claim it is easy.
An alternative style can be used by setting the "merge.conflictStyle" An alternative style can be used by setting the "merge.conflictStyle"
configuration variable to either "diff3" or "zdiff3". In "diff3" configuration variable to "diff3". In "diff3" style, the above conflict
style, the above conflict may look like this: may look like this:
------------ ------------
Here are lines that are either unchanged from the common Here are lines that are either unchanged from the common
ancestor, or cleanly resolved because only one side changed, ancestor, or cleanly resolved because only one side changed.
<<<<<<< yours:sample.txt
or cleanly resolved because both sides changed the same way.
Conflict resolution is hard;
let's go shopping.
||||||| base:sample.txt
or cleanly resolved because both sides changed identically.
Conflict resolution is hard.
=======
or cleanly resolved because both sides changed the same way.
Git makes conflict resolution easy.
>>>>>>> theirs:sample.txt
And here is another line that is cleanly resolved or unmodified.
------------
while in "zdiff3" style, it may look like this:
------------
Here are lines that are either unchanged from the common
ancestor, or cleanly resolved because only one side changed,
or cleanly resolved because both sides changed the same way.
<<<<<<< yours:sample.txt <<<<<<< yours:sample.txt
Conflict resolution is hard; Conflict resolution is hard;
let's go shopping. let's go shopping.
||||||| base:sample.txt |||||||
or cleanly resolved because both sides changed identically.
Conflict resolution is hard. Conflict resolution is hard.
======= =======
Git makes conflict resolution easy. Git makes conflict resolution easy.

View File

@ -9,10 +9,10 @@ git-p4 - Import from and submit to Perforce repositories
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git p4 clone' [<sync-options>] [<clone-options>] <p4-depot-path>... 'git p4 clone' [<sync options>] [<clone options>] <p4 depot path>...
'git p4 sync' [<sync-options>] [<p4-depot-path>...] 'git p4 sync' [<sync options>] [<p4 depot path>...]
'git p4 rebase' 'git p4 rebase'
'git p4 submit' [<submit-options>] [<master-branch-name>] 'git p4 submit' [<submit options>] [<master branch name>]
DESCRIPTION DESCRIPTION
@ -361,7 +361,7 @@ These options can be used to modify 'git p4 submit' behavior.
p4/master. See the "Sync options" section above for more p4/master. See the "Sync options" section above for more
information. information.
--commit (<sha1>|<sha1>..<sha1>):: --commit <sha1>|<sha1..sha1>::
Submit only the specified commit or range of commits, instead of the full Submit only the specified commit or range of commits, instead of the full
list of changes that are in the current Git branch. list of changes that are in the current Git branch.

View File

@ -13,8 +13,8 @@ SYNOPSIS
[--no-reuse-delta] [--delta-base-offset] [--non-empty] [--no-reuse-delta] [--delta-base-offset] [--non-empty]
[--local] [--incremental] [--window=<n>] [--depth=<n>] [--local] [--incremental] [--window=<n>] [--depth=<n>]
[--revs [--unpacked | --all]] [--keep-pack=<pack-name>] [--revs [--unpacked | --all]] [--keep-pack=<pack-name>]
[--stdout [--filter=<filter-spec>] | <base-name>] [--stdout [--filter=<filter-spec>] | base-name]
[--shallow] [--keep-true-parents] [--[no-]sparse] < <object-list> [--shallow] [--keep-true-parents] [--[no-]sparse] < object-list
DESCRIPTION DESCRIPTION

View File

@ -9,7 +9,7 @@ git-pack-redundant - Find redundant pack files
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git pack-redundant' [ --verbose ] [ --alt-odb ] ( --all | <pack-filename>... ) 'git pack-redundant' [ --verbose ] [ --alt-odb ] < --all | .pack filename ... >
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -714,9 +714,9 @@ information about the rebased commits and their parents (and instead
generates new fake commits based off limited information in the generates new fake commits based off limited information in the
generated patches), those commits cannot be identified; instead it has generated patches), those commits cannot be identified; instead it has
to fall back to a commit summary. Also, when merge.conflictStyle is to fall back to a commit summary. Also, when merge.conflictStyle is
set to diff3 or zdiff3, the apply backend will use "constructed merge set to diff3, the apply backend will use "constructed merge base" to
base" to label the content from the merge base, and thus provide no label the content from the merge base, and thus provide no information
information about the merge base commit whatsoever. about the merge base commit whatsoever.
The merge backend works with the full commits on both sides of history The merge backend works with the full commits on both sides of history
and thus has no such limitations. and thus has no such limitations.

View File

@ -17,12 +17,12 @@ The command takes various subcommands, and different options
depending on the subcommand: depending on the subcommand:
[verse] [verse]
'git reflog' ['show'] [<log-options>] [<ref>] 'git reflog' ['show'] [log-options] [<ref>]
'git reflog expire' [--expire=<time>] [--expire-unreachable=<time>] 'git reflog expire' [--expire=<time>] [--expire-unreachable=<time>]
[--rewrite] [--updateref] [--stale-fix] [--rewrite] [--updateref] [--stale-fix]
[--dry-run | -n] [--verbose] [--all [--single-worktree] | <refs>...] [--dry-run | -n] [--verbose] [--all [--single-worktree] | <refs>...]
'git reflog delete' [--rewrite] [--updateref] 'git reflog delete' [--rewrite] [--updateref]
[--dry-run | -n] [--verbose] <ref>@\{<specifier>\}... [--dry-run | -n] [--verbose] ref@\{specifier\}...
'git reflog exists' <ref> 'git reflog exists' <ref>
Reference logs, or "reflogs", record when the tips of branches and Reference logs, or "reflogs", record when the tips of branches and

View File

@ -10,7 +10,7 @@ SYNOPSIS
-------- --------
[verse] [verse]
'git remote' [-v | --verbose] 'git remote' [-v | --verbose]
'git remote add' [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=(fetch|push)] <name> <URL> 'git remote add' [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=(fetch|push)] <name> <url>
'git remote rename' <old> <new> 'git remote rename' <old> <new>
'git remote remove' <name> 'git remote remove' <name>
'git remote set-head' <name> (-a | --auto | -d | --delete | <branch>) 'git remote set-head' <name> (-a | --auto | -d | --delete | <branch>)
@ -18,7 +18,7 @@ SYNOPSIS
'git remote get-url' [--push] [--all] <name> 'git remote get-url' [--push] [--all] <name>
'git remote set-url' [--push] <name> <newurl> [<oldurl>] 'git remote set-url' [--push] <name> <newurl> [<oldurl>]
'git remote set-url --add' [--push] <name> <newurl> 'git remote set-url --add' [--push] <name> <newurl>
'git remote set-url --delete' [--push] <name> <URL> 'git remote set-url --delete' [--push] <name> <url>
'git remote' [-v | --verbose] 'show' [-n] <name>... 'git remote' [-v | --verbose] 'show' [-n] <name>...
'git remote prune' [-n | --dry-run] <name>... 'git remote prune' [-n | --dry-run] <name>...
'git remote' [-v | --verbose] 'update' [-p | --prune] [(<group> | <remote>)...] 'git remote' [-v | --verbose] 'update' [-p | --prune] [(<group> | <remote>)...]
@ -47,7 +47,7 @@ subcommands are available to perform operations on the remotes.
'add':: 'add'::
Add a remote named <name> for the repository at Add a remote named <name> for the repository at
<URL>. The command `git fetch <name>` can then be used to create and <url>. The command `git fetch <name>` can then be used to create and
update remote-tracking branches <name>/<branch>. update remote-tracking branches <name>/<branch>.
+ +
With `-f` option, `git fetch <name>` is run immediately after With `-f` option, `git fetch <name>` is run immediately after
@ -152,7 +152,7 @@ With `--push`, push URLs are manipulated instead of fetch URLs.
With `--add`, instead of changing existing URLs, new URL is added. With `--add`, instead of changing existing URLs, new URL is added.
+ +
With `--delete`, instead of changing existing URLs, all URLs matching With `--delete`, instead of changing existing URLs, all URLs matching
regex <URL> are deleted for remote <name>. Trying to delete all regex <url> are deleted for remote <name>. Trying to delete all
non-push URLs is an error. non-push URLs is an error.
+ +
Note that the push URL and the fetch URL, even though they can Note that the push URL and the fetch URL, even though they can

View File

@ -76,9 +76,8 @@ to the new separate pack will be written.
linkgit:git-pack-objects[1]. linkgit:git-pack-objects[1].
-q:: -q::
--quiet:: Pass the `-q` option to 'git pack-objects'. See
Show no progress over the standard error stream and pass the `-q` linkgit:git-pack-objects[1].
option to 'git pack-objects'. See linkgit:git-pack-objects[1].
-n:: -n::
Do not update the server information with Do not update the server information with

View File

@ -8,7 +8,7 @@ git-request-pull - Generates a summary of pending changes
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git request-pull' [-p] <start> <URL> [<end>] 'git request-pull' [-p] <start> <url> [<end>]
DESCRIPTION DESCRIPTION
----------- -----------
@ -21,7 +21,7 @@ the changes and indicates from where they can be pulled.
The upstream project is expected to have the commit named by The upstream project is expected to have the commit named by
`<start>` and the output asks it to integrate the changes you made `<start>` and the output asks it to integrate the changes you made
since that commit, up to the commit named by `<end>`, by visiting since that commit, up to the commit named by `<end>`, by visiting
the repository named by `<URL>`. the repository named by `<url>`.
OPTIONS OPTIONS
@ -33,14 +33,14 @@ OPTIONS
Commit to start at. This names a commit that is already in Commit to start at. This names a commit that is already in
the upstream history. the upstream history.
<URL>:: <url>::
The repository URL to be pulled from. The repository URL to be pulled from.
<end>:: <end>::
Commit to end at (defaults to HEAD). This names the commit Commit to end at (defaults to HEAD). This names the commit
at the tip of the history you are asking to be pulled. at the tip of the history you are asking to be pulled.
+ +
When the repository named by `<URL>` has the commit at a tip of a When the repository named by `<url>` has the commit at a tip of a
ref that is different from the ref you have locally, you can use the ref that is different from the ref you have locally, you can use the
`<local>:<remote>` syntax, to have its local name, a colon `:`, and `<local>:<remote>` syntax, to have its local name, a colon `:`, and
its remote name. its remote name.

View File

@ -92,7 +92,8 @@ in linkgit:git-checkout[1] for details.
The same as `--merge` option above, but changes the way the The same as `--merge` option above, but changes the way the
conflicting hunks are presented, overriding the conflicting hunks are presented, overriding the
`merge.conflictStyle` configuration variable. Possible values `merge.conflictStyle` configuration variable. Possible values
are "merge" (default), "diff3", and "zdiff3". are "merge" (default) and "diff3" (in addition to what is
shown by "merge" style, shows the original contents).
--ignore-unmerged:: --ignore-unmerged::
When restoring files on the working tree from the index, do When restoring files on the working tree from the index, do

View File

@ -9,8 +9,7 @@ git-send-email - Send a collection of patches as emails
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git send-email' [<options>] <file|directory>... 'git send-email' [<options>] <file|directory|rev-list options>...
'git send-email' [<options>] <format-patch options>
'git send-email' --dump-aliases 'git send-email' --dump-aliases
@ -20,8 +19,7 @@ Takes the patches given on the command line and emails them out.
Patches can be specified as files, directories (which will send all Patches can be specified as files, directories (which will send all
files in the directory), or directly as a revision list. In the files in the directory), or directly as a revision list. In the
last case, any format accepted by linkgit:git-format-patch[1] can last case, any format accepted by linkgit:git-format-patch[1] can
be passed to git send-email, as well as options understood by be passed to git send-email.
linkgit:git-format-patch[1].
The header of the email is configurable via command-line options. If not The header of the email is configurable via command-line options. If not
specified on the command line, the user will be prompted with a ReadLine specified on the command line, the user will be prompted with a ReadLine

View File

@ -8,7 +8,7 @@ git-shortlog - Summarize 'git log' output
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git shortlog' [<options>] [<revision-range>] [[--] <path>...] 'git shortlog' [<options>] [<revision range>] [[--] <path>...]
git log --pretty=short | 'git shortlog' [<options>] git log --pretty=short | 'git shortlog' [<options>]
DESCRIPTION DESCRIPTION
@ -89,13 +89,13 @@ counts both authors and co-authors.
If width is `0` (zero) then indent the lines of the output without wrapping If width is `0` (zero) then indent the lines of the output without wrapping
them. them.
<revision-range>:: <revision range>::
Show only commits in the specified revision range. When no Show only commits in the specified revision range. When no
<revision-range> is specified, it defaults to `HEAD` (i.e. the <revision range> is specified, it defaults to `HEAD` (i.e. the
whole history leading to the current commit). `origin..HEAD` whole history leading to the current commit). `origin..HEAD`
specifies all the commits reachable from the current commit specifies all the commits reachable from the current commit
(i.e. `HEAD`), but not from `origin`. For a complete list of (i.e. `HEAD`), but not from `origin`. For a complete list of
ways to spell <revision-range>, see the "Specifying Ranges" ways to spell <revision range>, see the "Specifying Ranges"
section of linkgit:gitrevisions[7]. section of linkgit:gitrevisions[7].
[--] <path>...:: [--] <path>...::

View File

@ -11,7 +11,7 @@ given by a list of patterns.
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git sparse-checkout <subcommand> [<options>]' 'git sparse-checkout <subcommand> [options]'
DESCRIPTION DESCRIPTION
@ -30,36 +30,28 @@ COMMANDS
'list':: 'list'::
Describe the patterns in the sparse-checkout file. Describe the patterns in the sparse-checkout file.
'set':: 'init'::
Enable the necessary config settings Enable the `core.sparseCheckout` setting. If the
(extensions.worktreeConfig, core.sparseCheckout, sparse-checkout file does not exist, then populate it with
core.sparseCheckoutCone) if they are not already enabled, and patterns that match every file in the root directory and
write a set of patterns to the sparse-checkout file from the no other directories, then will remove all directories tracked
list of arguments following the 'set' subcommand. Update the by Git. Add patterns to the sparse-checkout file to
working directory to match the new patterns. repopulate the working directory.
+ +
When the `--stdin` option is provided, the patterns are read from To avoid interfering with other worktrees, it first enables the
standard in as a newline-delimited list instead of from the arguments. `extensions.worktreeConfig` setting and makes sure to set the
`core.sparseCheckout` setting in the worktree-specific config file.
+ +
When `--cone` is passed or `core.sparseCheckoutCone` is enabled, the When `--cone` is provided, the `core.sparseCheckoutCone` setting is
input list is considered a list of directories instead of also set, allowing for better performance with a limited set of
sparse-checkout patterns. This allows for better performance with a patterns (see 'CONE PATTERN SET' below).
limited set of patterns (see 'CONE PATTERN SET' below). Note that the
set command will write patterns to the sparse-checkout file to include
all files contained in those directories (recursively) as well as
files that are siblings of ancestor directories. The input format
matches the output of `git ls-tree --name-only`. This includes
interpreting pathnames that begin with a double quote (") as C-style
quoted strings. This may become the default in the future; --no-cone
can be passed to request non-cone mode.
+ +
Use the `--[no-]sparse-index` option to use a sparse index (the Use the `--[no-]sparse-index` option to toggle the use of the sparse
default is to not use it). A sparse index reduces the size of the index format. This reduces the size of the index to be more closely
index to be more closely aligned with your sparse-checkout aligned with your sparse-checkout definition. This can have significant
definition. This can have significant performance advantages for performance advantages for commands such as `git status` or `git add`.
commands such as `git status` or `git add`. This feature is still This feature is still experimental. Some commands might be slower with
experimental. Some commands might be slower with a sparse index until a sparse index until they are properly integrated with the feature.
they are properly integrated with the feature.
+ +
**WARNING:** Using a sparse index requires modifying the index in a way **WARNING:** Using a sparse index requires modifying the index in a way
that is not completely understood by external tools. If you have trouble that is not completely understood by external tools. If you have trouble
@ -68,6 +60,23 @@ to rewrite your index to not be sparse. Older versions of Git will not
understand the sparse directory entries index extension and may fail to understand the sparse directory entries index extension and may fail to
interact with your repository until it is disabled. interact with your repository until it is disabled.
'set'::
Write a set of patterns to the sparse-checkout file, as given as
a list of arguments following the 'set' subcommand. Update the
working directory to match the new patterns. Enable the
core.sparseCheckout config setting if it is not already enabled.
+
When the `--stdin` option is provided, the patterns are read from
standard in as a newline-delimited list instead of from the arguments.
+
When `core.sparseCheckoutCone` is enabled, the input list is considered a
list of directories instead of sparse-checkout patterns. The command writes
patterns to the sparse-checkout file to include all files contained in those
directories (recursively) as well as files that are siblings of ancestor
directories. The input format matches the output of `git ls-tree --name-only`.
This includes interpreting pathnames that begin with a double quote (") as
C-style quoted strings.
'add':: 'add'::
Update the sparse-checkout file to include additional patterns. Update the sparse-checkout file to include additional patterns.
By default, these patterns are read from the command-line arguments, By default, these patterns are read from the command-line arguments,
@ -84,35 +93,12 @@ interact with your repository until it is disabled.
cases, it can make sense to run `git sparse-checkout reapply` later cases, it can make sense to run `git sparse-checkout reapply` later
after cleaning up affected paths (e.g. resolving conflicts, undoing after cleaning up affected paths (e.g. resolving conflicts, undoing
or committing changes, etc.). or committing changes, etc.).
+
The `reapply` command can also take `--[no-]cone` and `--[no-]sparse-index`
flags, with the same meaning as the flags from the `set` command, in order
to change which sparsity mode you are using without needing to also respecify
all sparsity paths.
'disable':: 'disable'::
Disable the `core.sparseCheckout` config setting, and restore the Disable the `core.sparseCheckout` config setting, and restore the
working directory to include all files. working directory to include all files. Leaves the sparse-checkout
file intact so a later 'git sparse-checkout init' command may
'init':: return the working directory to the same state.
Deprecated command that behaves like `set` with no specified paths.
May be removed in the future.
+
Historically, `set` did not handle all the necessary config settings,
which meant that both `init` and `set` had to be called. Invoking
both meant the `init` step would first remove nearly all tracked files
(and in cone mode, ignored files too), then the `set` step would add
many of the tracked files (but not ignored files) back. In addition
to the lost files, the performance and UI of this combination was
poor.
+
Also, historically, `init` would not actually initialize the
sparse-checkout file if it already existed. This meant it was
possible to return to a sparse-checkout without remembering which
paths to pass to a subsequent 'set' or 'add' command. However,
`--cone` and `--sparse-index` options would not be remembered across
the disable command, so the easy restore of calling a plain `init`
decreased in utility.
SPARSE CHECKOUT SPARSE CHECKOUT
--------------- ---------------
@ -121,7 +107,7 @@ SPARSE CHECKOUT
It uses the skip-worktree bit (see linkgit:git-update-index[1]) to tell It uses the skip-worktree bit (see linkgit:git-update-index[1]) to tell
Git whether a file in the working directory is worth looking at. If Git whether a file in the working directory is worth looking at. If
the skip-worktree bit is set, then the file is ignored in the working the skip-worktree bit is set, then the file is ignored in the working
directory. Git will avoid populating the contents of those files, which directory. Git will not populate the contents of those files, which
makes a sparse checkout helpful when working in a repository with many makes a sparse checkout helpful when working in a repository with many
files, but only a few are important to the current user. files, but only a few are important to the current user.
@ -131,8 +117,10 @@ directory, it updates the skip-worktree bits in the index based
on this file. The files matching the patterns in the file will on this file. The files matching the patterns in the file will
appear in the working directory, and the rest will not. appear in the working directory, and the rest will not.
To enable the sparse-checkout feature, run `git sparse-checkout set` to To enable the sparse-checkout feature, run `git sparse-checkout init` to
set the patterns you want to use. initialize a simple sparse-checkout file and enable the `core.sparseCheckout`
config setting. Then, run `git sparse-checkout set` to modify the patterns in
the sparse-checkout file.
To repopulate the working directory with all files, use the To repopulate the working directory with all files, use the
`git sparse-checkout disable` command. `git sparse-checkout disable` command.

View File

@ -9,7 +9,7 @@ git-stage - Add file contents to the staging area
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git stage' <arg>... 'git stage' args...
DESCRIPTION DESCRIPTION

View File

@ -13,7 +13,7 @@ SYNOPSIS
'git stash' drop [-q|--quiet] [<stash>] 'git stash' drop [-q|--quiet] [<stash>]
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>] 'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
'git stash' branch <branchname> [<stash>] 'git stash' branch <branchname> [<stash>]
'git stash' [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--quiet] 'git stash' [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [-m|--message <message>] [-u|--include-untracked] [-a|--all] [-m|--message <message>]
[--pathspec-from-file=<file> [--pathspec-file-nul]] [--pathspec-from-file=<file> [--pathspec-file-nul]]
[--] [<pathspec>...]] [--] [<pathspec>...]]
@ -47,7 +47,7 @@ stash index (e.g. the integer `n` is equivalent to `stash@{n}`).
COMMANDS COMMANDS
-------- --------
push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]:: push [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]::
Save your local modifications to a new 'stash entry' and roll them Save your local modifications to a new 'stash entry' and roll them
back to HEAD (in the working tree and in the index). back to HEAD (in the working tree and in the index).
@ -60,7 +60,7 @@ subcommand from making an unwanted stash entry. The two exceptions to this
are `stash -p` which acts as alias for `stash push -p` and pathspec elements, are `stash -p` which acts as alias for `stash push -p` and pathspec elements,
which are allowed after a double hyphen `--` for disambiguation. which are allowed after a double hyphen `--` for disambiguation.
save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]:: save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]::
This option is deprecated in favour of 'git stash push'. It This option is deprecated in favour of 'git stash push'. It
differs from "stash push" in that it cannot take pathspec. differs from "stash push" in that it cannot take pathspec.
@ -205,16 +205,6 @@ to learn how to operate the `--patch` mode.
The `--patch` option implies `--keep-index`. You can use The `--patch` option implies `--keep-index`. You can use
`--no-keep-index` to override this. `--no-keep-index` to override this.
-S::
--staged::
This option is only valid for `push` and `save` commands.
+
Stash only the changes that are currently staged. This is similar to
basic `git commit` except the state is committed to the stash instead
of current branch.
+
The `--patch` option has priority over this one.
--pathspec-from-file=<file>:: --pathspec-from-file=<file>::
This option is only valid for `push` command. This option is only valid for `push` command.
+ +
@ -351,24 +341,6 @@ $ edit/build/test remaining parts
$ git commit foo -m 'Remaining parts' $ git commit foo -m 'Remaining parts'
---------------------------------------------------------------- ----------------------------------------------------------------
Saving unrelated changes for future use::
When you are in the middle of massive changes and you find some
unrelated issue that you don't want to forget to fix, you can do the
change(s), stage them, and use `git stash push --staged` to stash them
out for future use. This is similar to committing the staged changes,
only the commit ends-up being in the stash and not on the current branch.
+
----------------------------------------------------------------
# ... hack hack hack ...
$ git add --patch foo # add unrelated changes to the index
$ git stash push --staged # save these changes to the stash
# ... hack hack hack, finish curent changes ...
$ git commit -m 'Massive' # commit fully tested changes
$ git switch fixup-branch # switch to another branch
$ git stash pop # to finish work on the saved changes
----------------------------------------------------------------
Recovering stash entries that were cleared/dropped erroneously:: Recovering stash entries that were cleared/dropped erroneously::
If you mistakenly drop or clear stash entries, they cannot be recovered If you mistakenly drop or clear stash entries, they cannot be recovered

View File

@ -314,14 +314,6 @@ Line Notes
------------------------------------------------------------ ------------------------------------------------------------
.... ....
Stash Information
^^^^^^^^^^^^^^^^^
If `--show-stash` is given, one line is printed showing the number of stash
entries if non-zero:
# stash <N>
Changed Tracked Entries Changed Tracked Entries
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -575,7 +575,7 @@ OPTIONS
------- -------
--shared[=(false|true|umask|group|all|world|everybody)]:: --shared[=(false|true|umask|group|all|world|everybody)]::
--template=<template-directory>:: --template=<template_directory>::
Only used with the 'init' command. Only used with the 'init' command.
These are passed directly to 'git init'. These are passed directly to 'git init'.

View File

@ -137,7 +137,8 @@ should result in deletion of the path).
The same as `--merge` option above, but changes the way the The same as `--merge` option above, but changes the way the
conflicting hunks are presented, overriding the conflicting hunks are presented, overriding the
`merge.conflictStyle` configuration variable. Possible values are `merge.conflictStyle` configuration variable. Possible values are
"merge" (default), "diff3", and "zdiff3". "merge" (default) and "diff3" (in addition to what is shown by
"merge" style, shows the original contents).
-q:: -q::
--quiet:: --quiet::
@ -151,7 +152,7 @@ should result in deletion of the path).
attached to a terminal, regardless of `--quiet`. attached to a terminal, regardless of `--quiet`.
-t:: -t::
--track [direct|inherit]:: --track::
When creating a new branch, set up "upstream" configuration. When creating a new branch, set up "upstream" configuration.
`-c` is implied. See `--track` in linkgit:git-branch[1] for `-c` is implied. See `--track` in linkgit:git-branch[1] for
details. details.

View File

@ -59,9 +59,6 @@ ifdef::git-default-pager[]
The build you are using chose '{git-default-pager}' as the default. The build you are using chose '{git-default-pager}' as the default.
endif::git-default-pager[] endif::git-default-pager[]
GIT_DEFAULT_BRANCH::
The name of the first branch created in newly initialized repositories.
SEE ALSO SEE ALSO
-------- --------
linkgit:git-commit-tree[1] linkgit:git-commit-tree[1]

View File

@ -8,7 +8,7 @@ git-web--browse - Git helper script to launch a web browser
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git web{litdd}browse' [<options>] (<URL>|<file>)... 'git web{litdd}browse' [<options>] <url|file>...
DESCRIPTION DESCRIPTION
----------- -----------

View File

@ -10,7 +10,7 @@ SYNOPSIS
-------- --------
[verse] [verse]
'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]] [-b <new-branch>] <path> [<commit-ish>] 'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]] [-b <new-branch>] <path> [<commit-ish>]
'git worktree list' [-v | --porcelain] 'git worktree list' [--porcelain]
'git worktree lock' [--reason <string>] <worktree> 'git worktree lock' [--reason <string>] <worktree>
'git worktree move' <worktree> <new-path> 'git worktree move' <worktree> <new-path>
'git worktree prune' [-n] [-v] [--expire <expire>] 'git worktree prune' [-n] [-v] [--expire <expire>]

View File

@ -832,9 +832,8 @@ for full details.
`GIT_TRACE_REDACT`:: `GIT_TRACE_REDACT`::
By default, when tracing is activated, Git redacts the values of By default, when tracing is activated, Git redacts the values of
cookies, the "Authorization:" header, the "Proxy-Authorization:" cookies, the "Authorization:" header, and the "Proxy-Authorization:"
header and packfile URIs. Set this variable to `0` to prevent this header. Set this variable to `0` to prevent this redaction.
redaction.
`GIT_LITERAL_PATHSPECS`:: `GIT_LITERAL_PATHSPECS`::
Setting this variable to `1` will cause Git to treat all Setting this variable to `1` will cause Git to treat all

View File

@ -132,7 +132,7 @@ because the hostnames differ. Nor would it match `foo.example.com`; Git
compares hostnames exactly, without considering whether two hosts are part of compares hostnames exactly, without considering whether two hosts are part of
the same domain. Likewise, a config entry for `http://example.com` would not the same domain. Likewise, a config entry for `http://example.com` would not
match: Git compares the protocols exactly. However, you may use wildcards in match: Git compares the protocols exactly. However, you may use wildcards in
the domain name and other pattern matching techniques as with the `http.<URL>.*` the domain name and other pattern matching techniques as with the `http.<url>.*`
options. options.
If the "pattern" URL does include a path component, then this too must match If the "pattern" URL does include a path component, then this too must match
@ -147,7 +147,7 @@ CONFIGURATION OPTIONS
Options for a credential context can be configured either in Options for a credential context can be configured either in
`credential.*` (which applies to all credentials), or `credential.*` (which applies to all credentials), or
`credential.<URL>.*`, where <URL> matches the context as described `credential.<url>.*`, where <url> matches the context as described
above. above.
The following options are available in either location: The following options are available in either location:

View File

@ -226,7 +226,7 @@ Workflow for a third party library
---------------------------------- ----------------------------------
# Add a submodule # Add a submodule
git submodule add <URL> <path> git submodule add <url> <path>
# Occasionally update the submodule to a new version: # Occasionally update the submodule to a new version:
git -C <path> checkout <new version> git -C <path> checkout <new version>

View File

@ -394,7 +394,7 @@ request to do so by mail. Such a request looks like
------------------------------------- -------------------------------------
Please pull from Please pull from
<URL> <branch> <url> <branch>
------------------------------------- -------------------------------------
In that case, 'git pull' can do the fetch and merge in one go, as In that case, 'git pull' can do the fetch and merge in one go, as
@ -403,7 +403,7 @@ follows.
.Push/pull: Merging remote topics .Push/pull: Merging remote topics
[caption="Recipe: "] [caption="Recipe: "]
===================================== =====================================
`git pull <URL> <branch>` `git pull <url> <branch>`
===================================== =====================================
Occasionally, the maintainer may get merge conflicts when they try to Occasionally, the maintainer may get merge conflicts when they try to
@ -440,7 +440,7 @@ merge because you cannot format-patch merges):
.format-patch/am: Keeping topics up to date .format-patch/am: Keeping topics up to date
[caption="Recipe: "] [caption="Recipe: "]
===================================== =====================================
`git pull --rebase <URL> <branch>` `git pull --rebase <url> <branch>`
===================================== =====================================
You can then fix the conflicts during the rebase. Presumably you have You can then fix the conflicts during the rebase. Presumably you have

View File

@ -20,7 +20,7 @@ built-in formats:
* 'oneline' * 'oneline'
<hash> <title-line> <hash> <title line>
+ +
This is designed to be as compact as possible. This is designed to be as compact as possible.
@ -29,17 +29,17 @@ This is designed to be as compact as possible.
commit <hash> commit <hash>
Author: <author> Author: <author>
<title-line> <title line>
* 'medium' * 'medium'
commit <hash> commit <hash>
Author: <author> Author: <author>
Date: <author-date> Date: <author date>
<title-line> <title line>
<full-commit-message> <full commit message>
* 'full' * 'full'
@ -47,25 +47,25 @@ This is designed to be as compact as possible.
Author: <author> Author: <author>
Commit: <committer> Commit: <committer>
<title-line> <title line>
<full-commit-message> <full commit message>
* 'fuller' * 'fuller'
commit <hash> commit <hash>
Author: <author> Author: <author>
AuthorDate: <author-date> AuthorDate: <author date>
Commit: <committer> Commit: <committer>
CommitDate: <committer-date> CommitDate: <committer date>
<title-line> <title line>
<full-commit-message> <full commit message>
* 'reference' * 'reference'
<abbrev-hash> (<title-line>, <short-author-date>) <abbrev hash> (<title line>, <short author date>)
+ +
This format is used to refer to another commit in a commit message and This format is used to refer to another commit in a commit message and
is the same as `--pretty='format:%C(auto)%h (%s, %ad)'`. By default, is the same as `--pretty='format:%C(auto)%h (%s, %ad)'`. By default,
@ -78,10 +78,10 @@ placeholders, its output is not affected by other options like
From <hash> <date> From <hash> <date>
From: <author> From: <author>
Date: <author-date> Date: <author date>
Subject: [PATCH] <title-line> Subject: [PATCH] <title line>
<full-commit-message> <full commit message>
* 'mboxrd' * 'mboxrd'
+ +
@ -101,9 +101,9 @@ commits are displayed, but not the way the diff is shown e.g. with
`git log --raw`. To get full object names in a raw diff format, `git log --raw`. To get full object names in a raw diff format,
use `--no-abbrev`. use `--no-abbrev`.
* 'format:<format-string>' * 'format:<string>'
+ +
The 'format:<format-string>' format allows you to specify which information The 'format:<string>' format allows you to specify which information
you want to show. It works a little bit like printf format, you want to show. It works a little bit like printf format,
with the notable exception that you get a newline with '%n' with the notable exception that you get a newline with '%n'
instead of '\n'. instead of '\n'.
@ -220,12 +220,6 @@ The placeholders are:
inconsistent when tags are added or removed at inconsistent when tags are added or removed at
the same time. the same time.
+ +
** 'tags[=<bool-value>]': Instead of only considering annotated tags,
consider lightweight tags as well.
** 'abbrev=<number>': Instead of using the default number of hexadecimal digits
(which will vary according to the number of objects in the repository with a
default of 7) of the abbreviated object name, use <number> digits, or as many
digits as needed to form a unique object name.
** 'match=<pattern>': Only consider tags matching the given ** 'match=<pattern>': Only consider tags matching the given
`glob(7)` pattern, excluding the "refs/tags/" prefix. `glob(7)` pattern, excluding the "refs/tags/" prefix.
** 'exclude=<pattern>': Do not consider tags matching the given ** 'exclude=<pattern>': Do not consider tags matching the given
@ -279,7 +273,12 @@ endif::git-rev-list[]
If any option is provided multiple times the If any option is provided multiple times the
last occurrence wins. last occurrence wins.
+ +
** 'key=<key>': only show trailers with specified <key>. Matching is done The boolean options accept an optional value `[=<BOOL>]`. The values
`true`, `false`, `on`, `off` etc. are all accepted. See the "boolean"
sub-section in "EXAMPLES" in linkgit:git-config[1]. If a boolean
option is given with no value, it's enabled.
+
** 'key=<K>': only show trailers with specified key. Matching is done
case-insensitively and trailing colon is optional. If option is case-insensitively and trailing colon is optional. If option is
given multiple times trailer lines matching any of the keys are given multiple times trailer lines matching any of the keys are
shown. This option automatically enables the `only` option so that shown. This option automatically enables the `only` option so that
@ -287,25 +286,25 @@ endif::git-rev-list[]
desired it can be disabled with `only=false`. E.g., desired it can be disabled with `only=false`. E.g.,
`%(trailers:key=Reviewed-by)` shows trailer lines with key `%(trailers:key=Reviewed-by)` shows trailer lines with key
`Reviewed-by`. `Reviewed-by`.
** 'only[=<bool>]': select whether non-trailer lines from the trailer ** 'only[=<BOOL>]': select whether non-trailer lines from the trailer
block should be included. block should be included.
** 'separator=<sep>': specify a separator inserted between trailer ** 'separator=<SEP>': specify a separator inserted between trailer
lines. When this option is not given each trailer line is lines. When this option is not given each trailer line is
terminated with a line feed character. The string <sep> may contain terminated with a line feed character. The string SEP may contain
the literal formatting codes described above. To use comma as the literal formatting codes described above. To use comma as
separator one must use `%x2C` as it would otherwise be parsed as separator one must use `%x2C` as it would otherwise be parsed as
next option. E.g., `%(trailers:key=Ticket,separator=%x2C )` next option. E.g., `%(trailers:key=Ticket,separator=%x2C )`
shows all trailer lines whose key is "Ticket" separated by a comma shows all trailer lines whose key is "Ticket" separated by a comma
and a space. and a space.
** 'unfold[=<bool>]': make it behave as if interpret-trailer's `--unfold` ** 'unfold[=<BOOL>]': make it behave as if interpret-trailer's `--unfold`
option was given. E.g., option was given. E.g.,
`%(trailers:only,unfold=true)` unfolds and shows all trailer lines. `%(trailers:only,unfold=true)` unfolds and shows all trailer lines.
** 'keyonly[=<bool>]': only show the key part of the trailer. ** 'keyonly[=<BOOL>]': only show the key part of the trailer.
** 'valueonly[=<bool>]': only show the value part of the trailer. ** 'valueonly[=<BOOL>]': only show the value part of the trailer.
** 'key_value_separator=<sep>': specify a separator inserted between ** 'key_value_separator=<SEP>': specify a separator inserted between
trailer lines. When this option is not given each trailer key-value trailer lines. When this option is not given each trailer key-value
pair is separated by ": ". Otherwise it shares the same semantics pair is separated by ": ". Otherwise it shares the same semantics
as 'separator=<sep>' above. as 'separator=<SEP>' above.
NOTE: Some placeholders may depend on other options given to the NOTE: Some placeholders may depend on other options given to the
revision traversal engine. For example, the `%g*` reflog options will revision traversal engine. For example, the `%g*` reflog options will
@ -314,11 +313,6 @@ insert an empty string unless we are traversing reflog entries (e.g., by
decoration format if `--decorate` was not already provided on the command decoration format if `--decorate` was not already provided on the command
line. line.
The boolean options accept an optional value `[=<bool-value>]`. The values
`true`, `false`, `on`, `off` etc. are all accepted. See the "boolean"
sub-section in "EXAMPLES" in linkgit:git-config[1]. If a boolean
option is given with no value, it's enabled.
If you add a `+` (plus sign) after '%' of a placeholder, a line-feed If you add a `+` (plus sign) after '%' of a placeholder, a line-feed
is inserted immediately before the expansion if and only if the is inserted immediately before the expansion if and only if the
placeholder expands to a non-empty string. placeholder expands to a non-empty string.

View File

@ -1047,7 +1047,7 @@ omitted.
has no effect. has no effect.
`--date=format:...` feeds the format `...` to your system `strftime`, `--date=format:...` feeds the format `...` to your system `strftime`,
except for %s, %z, and %Z, which are handled internally. except for %z and %Z, which are handled internally.
Use `--date=format:%c` to show the date in your system locale's Use `--date=format:%c` to show the date in your system locale's
preferred format. See the `strftime` manual for a complete list of preferred format. See the `strftime` manual for a complete list of
format placeholders. When using `-local`, the correct syntax is format placeholders. When using `-local`, the correct syntax is

View File

@ -17,12 +17,12 @@ is not feasible due to storage space or excessive repack times.
The multi-pack-index (MIDX for short) stores a list of objects The multi-pack-index (MIDX for short) stores a list of objects
and their offsets into multiple packfiles. It contains: and their offsets into multiple packfiles. It contains:
* A list of packfile names. - A list of packfile names.
* A sorted list of object IDs. - A sorted list of object IDs.
* A list of metadata for the ith object ID including: - A list of metadata for the ith object ID including:
** A value j referring to the jth packfile. - A value j referring to the jth packfile.
** An offset within the jth packfile for the object. - An offset within the jth packfile for the object.
* If large offsets are required, we use another list of large - If large offsets are required, we use another list of large
offsets similar to version 2 pack-indexes. offsets similar to version 2 pack-indexes.
Thus, we can provide O(log N) lookup time for any number Thus, we can provide O(log N) lookup time for any number
@ -87,6 +87,11 @@ Future Work
helpful to organize packfiles by object type (commit, tree, blob, helpful to organize packfiles by object type (commit, tree, blob,
etc.) and use this metadata to help that maintenance. etc.) and use this metadata to help that maintenance.
- The partial clone feature records special "promisor" packs that
may point to objects that are not stored locally, but available
on request to a server. The multi-pack-index does not currently
track these promisor packs.
Related Links Related Links
------------- -------------
[0] https://bugs.chromium.org/p/git/issues/detail?id=6 [0] https://bugs.chromium.org/p/git/issues/detail?id=6

View File

@ -125,11 +125,11 @@ command can be requested at a time.
empty-request = flush-pkt empty-request = flush-pkt
command-request = command command-request = command
capability-list capability-list
delim-pkt [command-args]
command-args
flush-pkt flush-pkt
command = PKT-LINE("command=" key LF) command = PKT-LINE("command=" key LF)
command-args = *command-specific-arg command-args = delim-pkt
*command-specific-arg
command-specific-args are packet line framed arguments defined by command-specific-args are packet line framed arguments defined by
each individual command. each individual command.

View File

@ -14,9 +14,9 @@ conflicts before writing them to the rerere database.
Different conflict styles and branch names are normalized by stripping Different conflict styles and branch names are normalized by stripping
the labels from the conflict markers, and removing the common ancestor the labels from the conflict markers, and removing the common ancestor
version from the `diff3` or `zdiff3` conflict styles. Branches that version from the `diff3` conflict style. Branches that are merged
are merged in different order are normalized by sorting the conflict in different order are normalized by sorting the conflict hunks. More
hunks. More on each of those steps in the following sections. on each of those steps in the following sections.
Once these two normalization operations are applied, a conflict ID is Once these two normalization operations are applied, a conflict ID is
calculated based on the normalized conflict, which is later used by calculated based on the normalized conflict, which is later used by
@ -42,8 +42,8 @@ get a conflict like the following:
>>>>>>> AC >>>>>>> AC
Doing the analogous with AC2 (forking a branch ABAC2 off of branch AB Doing the analogous with AC2 (forking a branch ABAC2 off of branch AB
and then merging branch AC2 into it), using the diff3 or zdiff3 and then merging branch AC2 into it), using the diff3 conflict style,
conflict style, we get a conflict like the following: we get a conflict like the following:
<<<<<<< HEAD <<<<<<< HEAD
B B

View File

@ -26,14 +26,14 @@ config file would appear like this:
------------ ------------
[remote "<name>"] [remote "<name>"]
url = <URL> url = <url>
pushurl = <pushurl> pushurl = <pushurl>
push = <refspec> push = <refspec>
fetch = <refspec> fetch = <refspec>
------------ ------------
The `<pushurl>` is used for pushes only. It is optional and defaults The `<pushurl>` is used for pushes only. It is optional and defaults
to `<URL>`. to `<url>`.
Named file in `$GIT_DIR/remotes` Named file in `$GIT_DIR/remotes`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -67,10 +67,10 @@ This file should have the following format:
------------ ------------
<URL>#<head> <url>#<head>
------------ ------------
`<URL>` is required; `#<head>` is optional. `<url>` is required; `#<head>` is optional.
Depending on the operation, git will use one of the following Depending on the operation, git will use one of the following
refspecs, if you don't provide one on the command line. refspecs, if you don't provide one on the command line.

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
GVF=GIT-VERSION-FILE GVF=GIT-VERSION-FILE
DEF_VER=v2.35.0-rc0 DEF_VER=v2.34.4
LF=' LF='
' '

118
Makefile
View File

@ -256,8 +256,6 @@ all::
# #
# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.
# #
# Define NO_UNCOMPRESS2 if your zlib does not have uncompress2.
#
# Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback, # Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback,
# as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299) # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
# #
@ -307,6 +305,9 @@ all::
# #
# Define NO_TCLTK if you do not want Tcl/Tk GUI. # Define NO_TCLTK if you do not want Tcl/Tk GUI.
# #
# Define SANE_TEXT_GREP to "-a" if you use recent versions of GNU grep
# and egrep that are pickier when their input contains non-ASCII data.
#
# The TCL_PATH variable governs the location of the Tcl interpreter # The TCL_PATH variable governs the location of the Tcl interpreter
# used to optimize git-gui for your system. Only used if NO_TCLTK # used to optimize git-gui for your system. Only used if NO_TCLTK
# is not set. Defaults to the bare 'tclsh'. # is not set. Defaults to the bare 'tclsh'.
@ -734,7 +735,6 @@ TEST_BUILTINS_OBJS += test-read-cache.o
TEST_BUILTINS_OBJS += test-read-graph.o TEST_BUILTINS_OBJS += test-read-graph.o
TEST_BUILTINS_OBJS += test-read-midx.o TEST_BUILTINS_OBJS += test-read-midx.o
TEST_BUILTINS_OBJS += test-ref-store.o TEST_BUILTINS_OBJS += test-ref-store.o
TEST_BUILTINS_OBJS += test-reftable.o
TEST_BUILTINS_OBJS += test-regex.o TEST_BUILTINS_OBJS += test-regex.o
TEST_BUILTINS_OBJS += test-repository.o TEST_BUILTINS_OBJS += test-repository.o
TEST_BUILTINS_OBJS += test-revision-walking.o TEST_BUILTINS_OBJS += test-revision-walking.o
@ -813,8 +813,6 @@ TEST_SHELL_PATH = $(SHELL_PATH)
LIB_FILE = libgit.a LIB_FILE = libgit.a
XDIFF_LIB = xdiff/lib.a XDIFF_LIB = xdiff/lib.a
REFTABLE_LIB = reftable/libreftable.a
REFTABLE_TEST_LIB = reftable/libreftable_test.a
GENERATED_H += command-list.h GENERATED_H += command-list.h
GENERATED_H += config-list.h GENERATED_H += config-list.h
@ -1194,7 +1192,7 @@ THIRD_PARTY_SOURCES += compat/regex/%
THIRD_PARTY_SOURCES += sha1collisiondetection/% THIRD_PARTY_SOURCES += sha1collisiondetection/%
THIRD_PARTY_SOURCES += sha1dc/% THIRD_PARTY_SOURCES += sha1dc/%
GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB)
EXTLIBS = EXTLIBS =
GIT_USER_AGENT = git/$(GIT_VERSION) GIT_USER_AGENT = git/$(GIT_VERSION)
@ -1206,7 +1204,6 @@ endif
# Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be
# tweaked by config.* below as well as the command-line, both of # tweaked by config.* below as well as the command-line, both of
# which'll override these defaults. # which'll override these defaults.
# Older versions of GCC may require adding "-std=gnu99" at the end.
CFLAGS = -g -O2 -Wall CFLAGS = -g -O2 -Wall
LDFLAGS = LDFLAGS =
CC_LD_DYNPATH = -Wl,-rpath, CC_LD_DYNPATH = -Wl,-rpath,
@ -1218,7 +1215,7 @@ ARFLAGS = rcs
PTHREAD_CFLAGS = PTHREAD_CFLAGS =
# For the 'sparse' target # For the 'sparse' target
SPARSE_FLAGS ?= -std=gnu99 SPARSE_FLAGS ?=
SP_EXTRA_FLAGS = -Wno-universal-initializer SP_EXTRA_FLAGS = -Wno-universal-initializer
# For informing GIT-BUILD-OPTIONS of the SANITIZE=leak target # For informing GIT-BUILD-OPTIONS of the SANITIZE=leak target
@ -1726,11 +1723,6 @@ ifdef NO_DEFLATE_BOUND
BASIC_CFLAGS += -DNO_DEFLATE_BOUND BASIC_CFLAGS += -DNO_DEFLATE_BOUND
endif endif
ifdef NO_UNCOMPRESS2
BASIC_CFLAGS += -DNO_UNCOMPRESS2
REFTABLE_OBJS += compat/zlib-uncompress2.o
endif
ifdef NO_POSIX_GOODIES ifdef NO_POSIX_GOODIES
BASIC_CFLAGS += -DNO_POSIX_GOODIES BASIC_CFLAGS += -DNO_POSIX_GOODIES
endif endif
@ -1881,7 +1873,7 @@ ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
endif endif
ifndef NO_MSGFMT_EXTENDED_OPTIONS ifndef NO_MSGFMT_EXTENDED_OPTIONS
MSGFMT += --check MSGFMT += --check --statistics
endif endif
ifdef HAVE_CLOCK_GETTIME ifdef HAVE_CLOCK_GETTIME
@ -2112,6 +2104,11 @@ ifdef DEFAULT_HELP_FORMAT
BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"' BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"'
endif endif
PAGER_ENV_SQ = $(subst ','\'',$(PAGER_ENV))
PAGER_ENV_CQ = "$(subst ",\",$(subst \,\\,$(PAGER_ENV)))"
PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ))
BASIC_CFLAGS += -DPAGER_ENV='$(PAGER_ENV_CQ_SQ)'
ALL_CFLAGS += $(BASIC_CFLAGS) ALL_CFLAGS += $(BASIC_CFLAGS)
ALL_LDFLAGS += $(BASIC_LDFLAGS) ALL_LDFLAGS += $(BASIC_LDFLAGS)
@ -2218,20 +2215,14 @@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
$(filter %.o,$^) $(LIBS) $(filter %.o,$^) $(LIBS)
help.sp help.s help.o: command-list.h help.sp help.s help.o: command-list.h
builtin/bugreport.sp builtin/bugreport.s builtin/bugreport.o: hook-list.h hook.sp hook.s hook.o: hook-list.h
builtin/help.sp builtin/help.s builtin/help.o: config-list.h GIT-PREFIX builtin/help.sp builtin/help.s builtin/help.o: config-list.h hook-list.h GIT-PREFIX
builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
'-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \ '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
'-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \ '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
'-DGIT_INFO_PATH="$(infodir_relative_SQ)"' '-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
PAGER_ENV_SQ = $(subst ','\'',$(PAGER_ENV))
PAGER_ENV_CQ = "$(subst ",\",$(subst \,\\,$(PAGER_ENV)))"
PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ))
pager.sp pager.s pager.o: EXTRA_CPPFLAGS = \
-DPAGER_ENV='$(PAGER_ENV_CQ_SQ)'
version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT
version.sp version.s version.o: EXTRA_CPPFLAGS = \ version.sp version.s version.o: EXTRA_CPPFLAGS = \
'-DGIT_VERSION="$(GIT_VERSION)"' \ '-DGIT_VERSION="$(GIT_VERSION)"' \
@ -2261,10 +2252,25 @@ command-list.h: $(wildcard Documentation/git*.txt)
hook-list.h: generate-hooklist.sh Documentation/githooks.txt hook-list.h: generate-hooklist.sh Documentation/githooks.txt
$(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh >$@ $(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh >$@
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):\ SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
$(localedir_SQ):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\ $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
$(gitwebdir_SQ):$(PERL_PATH_SQ):$(PAGER_ENV):\ $(gitwebdir_SQ):$(PERL_PATH_SQ):$(SANE_TEXT_GREP):$(PAGER_ENV):\
$(perllibdir_SQ) $(perllibdir_SQ)
define cmd_munge_script
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
-e 's|@@DIFF@@|$(DIFF_SQ)|' \
-e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
-e $(BROKEN_PATH_FIX) \
-e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
-e 's|@@SANE_TEXT_GREP@@|$(SANE_TEXT_GREP)|g' \
-e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \
$@.sh >$@+
endef
GIT-SCRIPT-DEFINES: FORCE GIT-SCRIPT-DEFINES: FORCE
@FLAGS='$(SCRIPT_DEFINES)'; \ @FLAGS='$(SCRIPT_DEFINES)'; \
if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \ if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
@ -2272,18 +2278,6 @@ GIT-SCRIPT-DEFINES: FORCE
echo "$$FLAGS" >$@; \ echo "$$FLAGS" >$@; \
fi fi
define cmd_munge_script
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
-e 's|@@DIFF@@|$(DIFF_SQ)|' \
-e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
-e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
-e $(BROKEN_PATH_FIX) \
-e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
-e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \
$@.sh >$@+
endef
$(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES $(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES
$(QUIET_GEN)$(cmd_munge_script) && \ $(QUIET_GEN)$(cmd_munge_script) && \
@ -2443,36 +2437,7 @@ XDIFF_OBJS += xdiff/xutils.o
.PHONY: xdiff-objs .PHONY: xdiff-objs
xdiff-objs: $(XDIFF_OBJS) xdiff-objs: $(XDIFF_OBJS)
REFTABLE_OBJS += reftable/basics.o
REFTABLE_OBJS += reftable/error.o
REFTABLE_OBJS += reftable/block.o
REFTABLE_OBJS += reftable/blocksource.o
REFTABLE_OBJS += reftable/iter.o
REFTABLE_OBJS += reftable/publicbasics.o
REFTABLE_OBJS += reftable/merged.o
REFTABLE_OBJS += reftable/pq.o
REFTABLE_OBJS += reftable/reader.o
REFTABLE_OBJS += reftable/record.o
REFTABLE_OBJS += reftable/refname.o
REFTABLE_OBJS += reftable/generic.o
REFTABLE_OBJS += reftable/stack.o
REFTABLE_OBJS += reftable/tree.o
REFTABLE_OBJS += reftable/writer.o
REFTABLE_TEST_OBJS += reftable/basics_test.o
REFTABLE_TEST_OBJS += reftable/block_test.o
REFTABLE_TEST_OBJS += reftable/dump.o
REFTABLE_TEST_OBJS += reftable/merged_test.o
REFTABLE_TEST_OBJS += reftable/pq_test.o
REFTABLE_TEST_OBJS += reftable/record_test.o
REFTABLE_TEST_OBJS += reftable/readwrite_test.o
REFTABLE_TEST_OBJS += reftable/refname_test.o
REFTABLE_TEST_OBJS += reftable/stack_test.o
REFTABLE_TEST_OBJS += reftable/test_framework.o
REFTABLE_TEST_OBJS += reftable/tree_test.o
TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
.PHONY: test-objs .PHONY: test-objs
test-objs: $(TEST_OBJS) test-objs: $(TEST_OBJS)
@ -2488,16 +2453,9 @@ OBJECTS += $(PROGRAM_OBJS)
OBJECTS += $(TEST_OBJS) OBJECTS += $(TEST_OBJS)
OBJECTS += $(XDIFF_OBJS) OBJECTS += $(XDIFF_OBJS)
OBJECTS += $(FUZZ_OBJS) OBJECTS += $(FUZZ_OBJS)
OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)
ifndef NO_CURL ifndef NO_CURL
OBJECTS += http.o http-walker.o remote-curl.o OBJECTS += http.o http-walker.o remote-curl.o
endif endif
SCALAR_SOURCES := contrib/scalar/scalar.c
SCALAR_OBJECTS := $(SCALAR_SOURCES:c=o)
OBJECTS += $(SCALAR_OBJECTS)
.PHONY: objects .PHONY: objects
objects: $(OBJECTS) objects: $(OBJECTS)
@ -2631,22 +2589,12 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
contrib/scalar/scalar$X: $(SCALAR_OBJECTS) GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
$(filter %.o,$^) $(LIBS)
$(LIB_FILE): $(LIB_OBJS) $(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
$(XDIFF_LIB): $(XDIFF_OBJS) $(XDIFF_LIB): $(XDIFF_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
$(REFTABLE_LIB): $(REFTABLE_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
$(REFTABLE_TEST_LIB): $(REFTABLE_TEST_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
export DEFAULT_EDITOR DEFAULT_PAGER export DEFAULT_EDITOR DEFAULT_PAGER
Documentation/GIT-EXCLUDED-PROGRAMS: FORCE Documentation/GIT-EXCLUDED-PROGRAMS: FORCE
@ -2945,7 +2893,7 @@ perf: all
t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) $(REFTABLE_TEST_LIB) t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
check-sha1:: t/helper/test-tool$X check-sha1:: t/helper/test-tool$X
@ -3283,7 +3231,7 @@ cocciclean:
clean: profile-clean coverage-clean cocciclean clean: profile-clean coverage-clean cocciclean
$(RM) *.res $(RM) *.res
$(RM) $(OBJECTS) $(RM) $(OBJECTS)
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB) $(RM) $(LIB_FILE) $(XDIFF_LIB)
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
$(RM) $(TEST_PROGRAMS) $(RM) $(TEST_PROGRAMS)
$(RM) $(FUZZ_PROGRAMS) $(RM) $(FUZZ_PROGRAMS)

View File

@ -1,4 +1,4 @@
[![Build status](https://github.com/git/git/workflows/CI/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush) [![Build status](https://github.com/git/git/workflows/CI/PR/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush)
Git - fast, scalable, distributed revision control system Git - fast, scalable, distributed revision control system
========================================================= =========================================================

View File

@ -1 +1 @@
Documentation/RelNotes/2.35.0.txt Documentation/RelNotes/2.34.4.txt

View File

@ -413,7 +413,7 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
strvec_push(&args, ps->items[i].original); strvec_push(&args, ps->items[i].original);
setup_child_process(s, &cp, NULL); setup_child_process(s, &cp, NULL);
strvec_pushv(&cp.args, args.v); cp.argv = args.v;
res = capture_command(&cp, plain, 0); res = capture_command(&cp, plain, 0);
if (res) { if (res) {
strvec_clear(&args); strvec_clear(&args);
@ -431,7 +431,7 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
setup_child_process(s, &colored_cp, NULL); setup_child_process(s, &colored_cp, NULL);
xsnprintf((char *)args.v[color_arg_index], 8, "--color"); xsnprintf((char *)args.v[color_arg_index], 8, "--color");
strvec_pushv(&colored_cp.args, args.v); colored_cp.argv = args.v;
colored = &s->colored; colored = &s->colored;
res = capture_command(&colored_cp, colored, 0); res = capture_command(&colored_cp, colored, 0);
strvec_clear(&args); strvec_clear(&args);

22
apply.c
View File

@ -133,10 +133,10 @@ int check_apply_state(struct apply_state *state, int force_apply)
int is_not_gitdir = !startup_info->have_repository; int is_not_gitdir = !startup_info->have_repository;
if (state->apply_with_reject && state->threeway) if (state->apply_with_reject && state->threeway)
return error(_("options '%s' and '%s' cannot be used together"), "--reject", "--3way"); return error(_("--reject and --3way cannot be used together."));
if (state->threeway) { if (state->threeway) {
if (is_not_gitdir) if (is_not_gitdir)
return error(_("'%s' outside a repository"), "--3way"); return error(_("--3way outside a repository"));
state->check_index = 1; state->check_index = 1;
} }
if (state->apply_with_reject) { if (state->apply_with_reject) {
@ -147,10 +147,10 @@ int check_apply_state(struct apply_state *state, int force_apply)
if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor)) if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor))
state->apply = 0; state->apply = 0;
if (state->check_index && is_not_gitdir) if (state->check_index && is_not_gitdir)
return error(_("'%s' outside a repository"), "--index"); return error(_("--index outside a repository"));
if (state->cached) { if (state->cached) {
if (is_not_gitdir) if (is_not_gitdir)
return error(_("'%s' outside a repository"), "--cached"); return error(_("--cached outside a repository"));
state->check_index = 1; state->check_index = 1;
} }
if (state->ita_only && (state->check_index || is_not_gitdir)) if (state->ita_only && (state->check_index || is_not_gitdir))
@ -3582,9 +3582,7 @@ static int try_threeway(struct apply_state *state,
/* No point falling back to 3-way merge in these cases */ /* No point falling back to 3-way merge in these cases */
if (patch->is_delete || if (patch->is_delete ||
S_ISGITLINK(patch->old_mode) || S_ISGITLINK(patch->new_mode) || S_ISGITLINK(patch->old_mode) || S_ISGITLINK(patch->new_mode))
(patch->is_new && !patch->direct_to_threeway) ||
(patch->is_rename && !patch->lines_added && !patch->lines_deleted))
return -1; return -1;
/* Preimage the patch was prepared for */ /* Preimage the patch was prepared for */
@ -4754,10 +4752,8 @@ static int apply_patch(struct apply_state *state,
} }
if (!list && !skipped_patch) { if (!list && !skipped_patch) {
if (!state->allow_empty) { error(_("unrecognized input"));
error(_("No valid patches in input (allow with \"--allow-empty\")")); res = -128;
res = -128;
}
goto end; goto end;
} }
@ -5075,7 +5071,7 @@ int apply_parse_options(int argc, const char **argv,
N_("leave the rejected hunks in corresponding *.rej files")), N_("leave the rejected hunks in corresponding *.rej files")),
OPT_BOOL(0, "allow-overlap", &state->allow_overlap, OPT_BOOL(0, "allow-overlap", &state->allow_overlap,
N_("allow overlapping hunks")), N_("allow overlapping hunks")),
OPT__VERBOSITY(&state->apply_verbosity), OPT__VERBOSE(&state->apply_verbosity, N_("be verbose")),
OPT_BIT(0, "inaccurate-eof", options, OPT_BIT(0, "inaccurate-eof", options,
N_("tolerate incorrectly detected missing new-line at the end of file"), N_("tolerate incorrectly detected missing new-line at the end of file"),
APPLY_OPT_INACCURATE_EOF), APPLY_OPT_INACCURATE_EOF),
@ -5085,8 +5081,6 @@ int apply_parse_options(int argc, const char **argv,
OPT_CALLBACK(0, "directory", state, N_("root"), OPT_CALLBACK(0, "directory", state, N_("root"),
N_("prepend <root> to all filenames"), N_("prepend <root> to all filenames"),
apply_option_parse_directory), apply_option_parse_directory),
OPT_BOOL(0, "allow-empty", &state->allow_empty,
N_("don't return error for empty patches")),
OPT_END() OPT_END()
}; };

View File

@ -66,7 +66,6 @@ struct apply_state {
int threeway; int threeway;
int unidiff_zero; int unidiff_zero;
int unsafe_paths; int unsafe_paths;
int allow_empty;
/* Other non boolean parameters */ /* Other non boolean parameters */
struct repository *repo; struct repository *repo;

View File

@ -430,6 +430,7 @@ static int write_tar_filter_archive(const struct archiver *ar,
{ {
struct strbuf cmd = STRBUF_INIT; struct strbuf cmd = STRBUF_INIT;
struct child_process filter = CHILD_PROCESS_INIT; struct child_process filter = CHILD_PROCESS_INIT;
const char *argv[2];
int r; int r;
if (!ar->data) if (!ar->data)
@ -439,12 +440,14 @@ static int write_tar_filter_archive(const struct archiver *ar,
if (args->compression_level >= 0) if (args->compression_level >= 0)
strbuf_addf(&cmd, " -%d", args->compression_level); strbuf_addf(&cmd, " -%d", args->compression_level);
strvec_push(&filter.args, cmd.buf); argv[0] = cmd.buf;
argv[1] = NULL;
filter.argv = argv;
filter.use_shell = 1; filter.use_shell = 1;
filter.in = -1; filter.in = -1;
if (start_command(&filter) < 0) if (start_command(&filter) < 0)
die_errno(_("unable to start '%s' filter"), cmd.buf); die_errno(_("unable to start '%s' filter"), argv[0]);
close(1); close(1);
if (dup2(filter.in, 1) < 0) if (dup2(filter.in, 1) < 0)
die_errno(_("unable to redirect descriptor")); die_errno(_("unable to redirect descriptor"));
@ -454,7 +457,7 @@ static int write_tar_filter_archive(const struct archiver *ar,
close(1); close(1);
if (finish_command(&filter) != 0) if (finish_command(&filter) != 0)
die(_("'%s' filter reported error"), cmd.buf); die(_("'%s' filter reported error"), argv[0]);
strbuf_release(&cmd); strbuf_release(&cmd);
return r; return r;

View File

@ -185,7 +185,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
buffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size); buffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size);
if (!buffer) if (!buffer)
return error(_("cannot read '%s'"), oid_to_hex(oid)); return error(_("cannot read %s"), oid_to_hex(oid));
err = write_entry(args, oid, path.buf, path.len, mode, buffer, size); err = write_entry(args, oid, path.buf, path.len, mode, buffer, size);
free(buffer); free(buffer);
return err; return err;
@ -338,7 +338,7 @@ int write_archive_entries(struct archiver_args *args,
strbuf_reset(&content); strbuf_reset(&content);
if (strbuf_read_file(&content, path, info->stat.st_size) < 0) if (strbuf_read_file(&content, path, info->stat.st_size) < 0)
err = error_errno(_("cannot read '%s'"), path); err = error_errno(_("could not read '%s'"), path);
else else
err = write_entry(args, &fake_oid, path_in_archive.buf, err = write_entry(args, &fake_oid, path_in_archive.buf,
path_in_archive.len, path_in_archive.len,
@ -577,11 +577,11 @@ static int parse_archive_args(int argc, const char **argv,
if (remote) if (remote)
die(_("Unexpected option --remote")); die(_("Unexpected option --remote"));
if (exec) if (exec)
die(_("the option '%s' requires '%s'"), "--exec", "--remote"); die(_("Option --exec can only be used together with --remote"));
if (output) if (output)
die(_("Unexpected option --output")); die(_("Unexpected option --output"));
if (is_remote && args->extra_files.nr) if (is_remote && args->extra_files.nr)
die(_("options '%s' and '%s' cannot be used together"), "--add-file", "--remote"); die(_("Options --add-file and --remote cannot be used together"));
if (!base) if (!base)
base = ""; base = "";

235
branch.c
View File

@ -11,7 +11,7 @@
struct tracking { struct tracking {
struct refspec_item spec; struct refspec_item spec;
struct string_list *srcs; char *src;
const char *remote; const char *remote;
int matches; int matches;
}; };
@ -22,11 +22,11 @@ static int find_tracked_branch(struct remote *remote, void *priv)
if (!remote_find_tracking(remote, &tracking->spec)) { if (!remote_find_tracking(remote, &tracking->spec)) {
if (++tracking->matches == 1) { if (++tracking->matches == 1) {
string_list_append(tracking->srcs, tracking->spec.src); tracking->src = tracking->spec.src;
tracking->remote = remote->name; tracking->remote = remote->name;
} else { } else {
free(tracking->spec.src); free(tracking->spec.src);
string_list_clear(tracking->srcs, 0); FREE_AND_NULL(tracking->src);
} }
tracking->spec.src = NULL; tracking->spec.src = NULL;
} }
@ -49,46 +49,25 @@ static int should_setup_rebase(const char *origin)
return 0; return 0;
} }
/** static const char tracking_advice[] =
* Install upstream tracking configuration for a branch; specifically, add N_("\n"
* `branch.<name>.remote` and `branch.<name>.merge` entries. "After fixing the error cause you may try to fix up\n"
* "the remote tracking information by invoking\n"
* `flag` contains integer flags for options; currently only "\"git branch --set-upstream-to=%s%s%s\".");
* BRANCH_CONFIG_VERBOSE is checked.
* int install_branch_config(int flag, const char *local, const char *origin, const char *remote)
* `local` is the name of the branch whose configuration we're installing.
*
* `origin` is the name of the remote owning the upstream branches. NULL means
* the upstream branches are local to this repo.
*
* `remotes` is a list of refs that are upstream of local
*/
static int install_branch_config_multiple_remotes(int flag, const char *local,
const char *origin, struct string_list *remotes)
{ {
const char *shortname = NULL; const char *shortname = NULL;
struct strbuf key = STRBUF_INIT; struct strbuf key = STRBUF_INIT;
struct string_list_item *item;
int rebasing = should_setup_rebase(origin); int rebasing = should_setup_rebase(origin);
if (!remotes->nr) if (skip_prefix(remote, "refs/heads/", &shortname)
BUG("must provide at least one remote for branch config"); && !strcmp(local, shortname)
if (rebasing && remotes->nr > 1) && !origin) {
die(_("cannot inherit upstream tracking configuration of " warning(_("Not setting branch %s as its own upstream."),
"multiple refs when rebasing is requested")); local);
return 0;
/* }
* If the new branch is trying to track itself, something has gone
* wrong. Warn the user and don't proceed any further.
*/
if (!origin)
for_each_string_list_item(item, remotes)
if (skip_prefix(item->string, "refs/heads/", &shortname)
&& !strcmp(local, shortname)) {
warning(_("not setting branch '%s' as its own upstream"),
local);
return 0;
}
strbuf_addf(&key, "branch.%s.remote", local); strbuf_addf(&key, "branch.%s.remote", local);
if (git_config_set_gently(key.buf, origin ? origin : ".") < 0) if (git_config_set_gently(key.buf, origin ? origin : ".") < 0)
@ -96,17 +75,8 @@ static int install_branch_config_multiple_remotes(int flag, const char *local,
strbuf_reset(&key); strbuf_reset(&key);
strbuf_addf(&key, "branch.%s.merge", local); strbuf_addf(&key, "branch.%s.merge", local);
/* if (git_config_set_gently(key.buf, remote) < 0)
* We want to overwrite any existing config with all the branches in
* "remotes". Override any existing config, then write our branches. If
* more than one is provided, use CONFIG_REGEX_NONE to preserve what
* we've written so far.
*/
if (git_config_set_gently(key.buf, NULL) < 0)
goto out_err; goto out_err;
for_each_string_list_item(item, remotes)
if (git_config_set_multivar_gently(key.buf, item->string, CONFIG_REGEX_NONE, 0) < 0)
goto out_err;
if (rebasing) { if (rebasing) {
strbuf_reset(&key); strbuf_reset(&key);
@ -117,106 +87,45 @@ static int install_branch_config_multiple_remotes(int flag, const char *local,
strbuf_release(&key); strbuf_release(&key);
if (flag & BRANCH_CONFIG_VERBOSE) { if (flag & BRANCH_CONFIG_VERBOSE) {
struct strbuf tmp_ref_name = STRBUF_INIT; if (shortname) {
struct string_list friendly_ref_names = STRING_LIST_INIT_DUP; if (origin)
printf_ln(rebasing ?
for_each_string_list_item(item, remotes) { _("Branch '%s' set up to track remote branch '%s' from '%s' by rebasing.") :
shortname = item->string; _("Branch '%s' set up to track remote branch '%s' from '%s'."),
skip_prefix(shortname, "refs/heads/", &shortname); local, shortname, origin);
if (origin) { else
strbuf_addf(&tmp_ref_name, "%s/%s", printf_ln(rebasing ?
origin, shortname); _("Branch '%s' set up to track local branch '%s' by rebasing.") :
string_list_append_nodup( _("Branch '%s' set up to track local branch '%s'."),
&friendly_ref_names, local, shortname);
strbuf_detach(&tmp_ref_name, NULL));
} else {
string_list_append(
&friendly_ref_names, shortname);
}
}
if (remotes->nr == 1) {
/*
* Rebasing is only allowed in the case of a single
* upstream branch.
*/
printf_ln(rebasing ?
_("branch '%s' set up to track '%s' by rebasing.") :
_("branch '%s' set up to track '%s'."),
local, friendly_ref_names.items[0].string);
} else { } else {
printf_ln(_("branch '%s' set up to track:"), local); if (origin)
for_each_string_list_item(item, &friendly_ref_names) printf_ln(rebasing ?
printf_ln(" %s", item->string); _("Branch '%s' set up to track remote ref '%s' by rebasing.") :
_("Branch '%s' set up to track remote ref '%s'."),
local, remote);
else
printf_ln(rebasing ?
_("Branch '%s' set up to track local ref '%s' by rebasing.") :
_("Branch '%s' set up to track local ref '%s'."),
local, remote);
} }
string_list_clear(&friendly_ref_names, 0);
} }
return 0; return 0;
out_err: out_err:
strbuf_release(&key); strbuf_release(&key);
error(_("unable to write upstream branch configuration")); error(_("Unable to write upstream branch configuration"));
advise(_("\nAfter fixing the error cause you may try to fix up\n" advise(_(tracking_advice),
"the remote tracking information by invoking:")); origin ? origin : "",
if (remotes->nr == 1) origin ? "/" : "",
advise(" git branch --set-upstream-to=%s%s%s", shortname ? shortname : remote);
origin ? origin : "",
origin ? "/" : "",
remotes->items[0].string);
else {
advise(" git config --add branch.\"%s\".remote %s",
local, origin ? origin : ".");
for_each_string_list_item(item, remotes)
advise(" git config --add branch.\"%s\".merge %s",
local, item->string);
}
return -1; return -1;
} }
int install_branch_config(int flag, const char *local, const char *origin,
const char *remote)
{
int ret;
struct string_list remotes = STRING_LIST_INIT_DUP;
string_list_append(&remotes, remote);
ret = install_branch_config_multiple_remotes(flag, local, origin, &remotes);
string_list_clear(&remotes, 0);
return ret;
}
static int inherit_tracking(struct tracking *tracking, const char *orig_ref)
{
const char *bare_ref;
struct branch *branch;
int i;
bare_ref = orig_ref;
skip_prefix(orig_ref, "refs/heads/", &bare_ref);
branch = branch_get(bare_ref);
if (!branch->remote_name) {
warning(_("asked to inherit tracking from '%s', but no remote is set"),
bare_ref);
return -1;
}
if (branch->merge_nr < 1 || !branch->merge_name || !branch->merge_name[0]) {
warning(_("asked to inherit tracking from '%s', but no merge configuration is set"),
bare_ref);
return -1;
}
tracking->remote = xstrdup(branch->remote_name);
for (i = 0; i < branch->merge_nr; i++)
string_list_append(tracking->srcs, branch->merge_name[i]);
return 0;
}
/* /*
* This is called when new_ref is branched off of orig_ref, and tries * This is called when new_ref is branched off of orig_ref, and tries
* to infer the settings for branch.<new_ref>.{remote,merge} from the * to infer the settings for branch.<new_ref>.{remote,merge} from the
@ -226,15 +135,11 @@ static void setup_tracking(const char *new_ref, const char *orig_ref,
enum branch_track track, int quiet) enum branch_track track, int quiet)
{ {
struct tracking tracking; struct tracking tracking;
struct string_list tracking_srcs = STRING_LIST_INIT_DUP;
int config_flags = quiet ? 0 : BRANCH_CONFIG_VERBOSE; int config_flags = quiet ? 0 : BRANCH_CONFIG_VERBOSE;
memset(&tracking, 0, sizeof(tracking)); memset(&tracking, 0, sizeof(tracking));
tracking.spec.dst = (char *)orig_ref; tracking.spec.dst = (char *)orig_ref;
tracking.srcs = &tracking_srcs; if (for_each_remote(find_tracked_branch, &tracking))
if (track != BRANCH_TRACK_INHERIT)
for_each_remote(find_tracked_branch, &tracking);
else if (inherit_tracking(&tracking, orig_ref))
return; return;
if (!tracking.matches) if (!tracking.matches)
@ -242,23 +147,20 @@ static void setup_tracking(const char *new_ref, const char *orig_ref,
case BRANCH_TRACK_ALWAYS: case BRANCH_TRACK_ALWAYS:
case BRANCH_TRACK_EXPLICIT: case BRANCH_TRACK_EXPLICIT:
case BRANCH_TRACK_OVERRIDE: case BRANCH_TRACK_OVERRIDE:
case BRANCH_TRACK_INHERIT:
break; break;
default: default:
return; return;
} }
if (tracking.matches > 1) if (tracking.matches > 1)
die(_("not tracking: ambiguous information for ref %s"), die(_("Not tracking: ambiguous information for ref %s"),
orig_ref); orig_ref);
if (tracking.srcs->nr < 1) if (install_branch_config(config_flags, new_ref, tracking.remote,
string_list_append(tracking.srcs, orig_ref); tracking.src ? tracking.src : orig_ref) < 0)
if (install_branch_config_multiple_remotes(config_flags, new_ref,
tracking.remote, tracking.srcs) < 0)
exit(-1); exit(-1);
string_list_clear(tracking.srcs, 0); free(tracking.src);
} }
int read_branch_desc(struct strbuf *buf, const char *branch_name) int read_branch_desc(struct strbuf *buf, const char *branch_name)
@ -284,7 +186,7 @@ int read_branch_desc(struct strbuf *buf, const char *branch_name)
int validate_branchname(const char *name, struct strbuf *ref) int validate_branchname(const char *name, struct strbuf *ref)
{ {
if (strbuf_check_branch_ref(ref, name)) if (strbuf_check_branch_ref(ref, name))
die(_("'%s' is not a valid branch name"), name); die(_("'%s' is not a valid branch name."), name);
return ref_exists(ref->buf); return ref_exists(ref->buf);
} }
@ -297,23 +199,18 @@ int validate_branchname(const char *name, struct strbuf *ref)
*/ */
int validate_new_branchname(const char *name, struct strbuf *ref, int force) int validate_new_branchname(const char *name, struct strbuf *ref, int force)
{ {
struct worktree **worktrees; const char *head;
const struct worktree *wt;
if (!validate_branchname(name, ref)) if (!validate_branchname(name, ref))
return 0; return 0;
if (!force) if (!force)
die(_("a branch named '%s' already exists"), die(_("A branch named '%s' already exists."),
ref->buf + strlen("refs/heads/")); ref->buf + strlen("refs/heads/"));
worktrees = get_worktrees(); head = resolve_ref_unsafe("HEAD", 0, NULL, NULL);
wt = find_shared_symref(worktrees, "HEAD", ref->buf); if (!is_bare_repository() && head && !strcmp(head, ref->buf))
if (wt && !wt->is_bare) die(_("Cannot force update the current branch."));
die(_("cannot force update the branch '%s'"
"checked out at '%s'"),
ref->buf + strlen("refs/heads/"), wt->path);
free_worktrees(worktrees);
return 1; return 1;
} }
@ -333,7 +230,7 @@ static int validate_remote_tracking_branch(char *ref)
} }
static const char upstream_not_branch[] = static const char upstream_not_branch[] =
N_("cannot set up tracking information; starting point '%s' is not a branch"); N_("Cannot setup tracking information; starting point '%s' is not a branch.");
static const char upstream_missing[] = static const char upstream_missing[] =
N_("the requested upstream branch '%s' does not exist"); N_("the requested upstream branch '%s' does not exist");
static const char upstream_advice[] = static const char upstream_advice[] =
@ -381,7 +278,7 @@ void create_branch(struct repository *r,
} }
die(_(upstream_missing), start_name); die(_(upstream_missing), start_name);
} }
die(_("not a valid object name: '%s'"), start_name); die(_("Not a valid object name: '%s'."), start_name);
} }
switch (dwim_ref(start_name, strlen(start_name), &oid, &real_ref, 0)) { switch (dwim_ref(start_name, strlen(start_name), &oid, &real_ref, 0)) {
@ -401,12 +298,12 @@ void create_branch(struct repository *r,
} }
break; break;
default: default:
die(_("ambiguous object name: '%s'"), start_name); die(_("Ambiguous object name: '%s'."), start_name);
break; break;
} }
if ((commit = lookup_commit_reference(r, &oid)) == NULL) if ((commit = lookup_commit_reference(r, &oid)) == NULL)
die(_("not a valid branch point: '%s'"), start_name); die(_("Not a valid branch point: '%s'."), start_name);
oidcpy(&oid, &commit->object.oid); oidcpy(&oid, &commit->object.oid);
if (reflog) if (reflog)
@ -460,16 +357,14 @@ void remove_branch_state(struct repository *r, int verbose)
void die_if_checked_out(const char *branch, int ignore_current_worktree) void die_if_checked_out(const char *branch, int ignore_current_worktree)
{ {
struct worktree **worktrees = get_worktrees();
const struct worktree *wt; const struct worktree *wt;
wt = find_shared_symref(worktrees, "HEAD", branch); wt = find_shared_symref("HEAD", branch);
if (wt && (!ignore_current_worktree || !wt->is_current)) { if (!wt || (ignore_current_worktree && wt->is_current))
skip_prefix(branch, "refs/heads/", &branch); return;
die(_("'%s' is already checked out at '%s'"), branch, wt->path); skip_prefix(branch, "refs/heads/", &branch);
} die(_("'%s' is already checked out at '%s'"),
branch, wt->path);
free_worktrees(worktrees);
} }
int replace_each_worktree_head_symref(const char *oldref, const char *newref, int replace_each_worktree_head_symref(const char *oldref, const char *newref,

View File

@ -10,8 +10,7 @@ enum branch_track {
BRANCH_TRACK_REMOTE, BRANCH_TRACK_REMOTE,
BRANCH_TRACK_ALWAYS, BRANCH_TRACK_ALWAYS,
BRANCH_TRACK_EXPLICIT, BRANCH_TRACK_EXPLICIT,
BRANCH_TRACK_OVERRIDE, BRANCH_TRACK_OVERRIDE
BRANCH_TRACK_INHERIT,
}; };
extern enum branch_track git_branch_track; extern enum branch_track git_branch_track;

Some files were not shown because too many files have changed in this diff Show More