1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-28 23:16:11 +02:00
Commit Graph

61478 Commits

Author SHA1 Message Date
Junio C Hamano 94dc98d1d2 Merge branch 'jb/midx-doc-update'
Doc update.

* jb/midx-doc-update:
  docs: multi-pack-index: remove note about future 'verify' work
2020-12-17 15:06:41 -08:00
Junio C Hamano f0c592dcfd Merge branch 'rj/make-clean'
Build optimization.

* rj/make-clean:
  Makefile: don't use a versioned temp distribution directory
  Makefile: don't try to clean old debian build product
  gitweb/Makefile: conditionally include ../GIT-VERSION-FILE
  Documentation/Makefile: conditionally include ../GIT-VERSION-FILE
  Documentation/Makefile: conditionally include doc.dep
2020-12-17 15:06:40 -08:00
Junio C Hamano 689010ca3c Merge branch 'js/t7064-master-to-initial'
Test update.

* js/t7064-master-to-initial:
  t7064: avoid relying on a specific default branch name
2020-12-17 15:06:40 -08:00
Junio C Hamano f4fb219a97 Merge branch 'js/t6300-hardcode-main'
Test update.

* js/t6300-hardcode-main:
  t6300: avoid using the default name of the initial branch
2020-12-17 15:06:40 -08:00
Junio C Hamano e5ace7167a Merge branch 'jk/oid-array-cleanup'
Code clean-up.

* jk/oid-array-cleanup:
  commit-graph: use size_t for array allocation and indexing
  commit-graph: replace packed_oid_list with oid_array
  commit-graph: drop count_distinct_commits() function
  oid-array: provide a for-loop iterator
  oid-array: make sort function public
  cache.h: move hash/oid functions to hash.h
  t0064: make duplicate tests more robust
  t0064: drop sha1 mention from filename
  oid-array.h: drop sha1 mention from header guard
2020-12-17 15:06:40 -08:00
Junio C Hamano 21127fa982 Merge branch 'tb/partial-clone-filters-fix'
Fix potential server side resource deallocation issues when
responding to a partial clone request.

* tb/partial-clone-filters-fix:
  upload-pack.c: don't free allowed_filters util pointers
  builtin/clone.c: don't ignore transport_fetch_refs() errors
2020-12-17 15:06:40 -08:00
Junio C Hamano 9feed4e2a6 Merge branch 'js/t7900-protect-pwd-in-config-get'
Hotfix for test breakage.

* js/t7900-protect-pwd-in-config-get:
  t7900: use --fixed-value in git-maintenance tests
2020-12-17 15:06:39 -08:00
Pratyush Yadav 62aed982fd Merge branch 'st/selected-text-colors'
Set colors for selected text properly.

* st/selected-text-colors:
  git-gui: Fix selected text colors
2020-12-18 01:52:26 +05:30
Serg Tereshchenko 4d22c0505f git-gui: Fix selected text colors
Added selected state colors for text widget.

Same colors for active and inactive selection, to match previous
behaviour.

Signed-off-by: Serg Tereshchenko <serg.partizan@gmail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-18 01:49:18 +05:30
Pratyush Yadav 796f6525b1 Merge branch 'rj/clean-speedup'
Speed up 'make clean' on Cygwin.

* rj/clean-speedup:
  Makefile: conditionally include GIT-VERSION-FILE
2020-12-18 00:42:14 +05:30
Ramsay Jones 5bc8b5d5c1 Makefile: conditionally include GIT-VERSION-FILE
The 'clean' target is noticeably slow on cygwin, even for a 'do-nothing'
invocation of 'make clean'. For example, the second 'make clean' given
below:

  $ make clean >/dev/null 2>&1
  $ make clean
  GITGUI_VERSION = 0.21.0.85.g3e5c
  rm -rf git-gui lib/tclIndex po/*.msg
  rm -rf GIT-VERSION-FILE GIT-GUI-VARS
  $

has been timed at 1.934s on my laptop (an old core i5-4200M @ 2.50GHz,
8GB RAM, 1TB HDD).

Notice that the Makefile, as part of processing the 'clean' target, is
updating the 'GIT-VERSION-FILE' file.  This is to ensure that the
$(GITGUI_VERSION) make variable is set, once that file had been included.
However, the 'clean' target does not use the $(GITGUI_VERSION) variable,
so this is wasted effort.

In order to eliminate such wasted effort, use the value of the internal
$(MAKECMDGOALS) variable to only '-include GIT-VERSION-FILE' when the
target is not 'clean'. (This drops the time down to 0.676s, on my laptop,
giving an improvement of 65.05%).

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-18 00:34:15 +05:30
Pratyush Yadav 7d6d21f5b9 Merge branch 'sh/macos-labels'
Fix label background colors on MacOS when ttk is enabled.

* sh/macos-labels:
  git-gui: fix colored label backgrounds when using themed widgets
2020-12-18 00:32:06 +05:30
Stefan Haller f9481b195b git-gui: fix colored label backgrounds when using themed widgets
The aqua theme on Mac doesn't support changing the background color for labels
and frames [1]. Since the red, green, and yellow backgrounds of the labels for
unstaged and staged files and the diff pane are so important design elements of
git gui's main window, it's not acceptable for them to have grey backgrounds on
Mac.

To work around this, simply use non-themed widgets for all labels on Mac. This
is not a big problem because labels don't look extremely different between the
themed and non-themed versions. There are subtle differences, but they are not
as bad as having the wrong background color.

[1] https://stackoverflow.com/a/6723911

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-18 00:30:37 +05:30
Randall S. Becker 731d578b4f config.mak.uname: remove old NonStop compatibility settings
The MKDIR_WO_TRAILING_SLASH and NO_SETITIMER options are no longer
needed on the NonStop platforms as both are now supported by the
oldest supported operating system revision.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 22:06:53 -08:00
Jiang Xin 0696232390 pack-redundant: fix crash when one packfile in repo
Command `git pack-redundant --all` will crash if there is only one
packfile in the repository.  This is because, if there is only one
packfile in local_packs, `cmp_local_packs` will do nothing and will
leave `pl->unique_objects` as uninitialized.

Also add testcases for repository with no packfile and one packfile
in t5323.

Reported-by: Daniel C. Klauer <daniel.c.klauer@web.de>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 21:21:06 -08:00
Johannes Schindelin f17c9da2cf tests: drop the `PREPARE_FOR_MAIN_BRANCH` prereq
We no longer use it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:41 -08:00
Johannes Schindelin 0007618107 t9902: use `main` as initial branch name
In 8164360fc8 (t9902: prepare a test for the upcoming default branch
name, 2020-10-23), we started adjusting this test script for the default
initial branch name changing to `main`.

However, there is no need to wait for that: let's adjust the test script
to stop relying on a specific initial branch name by setting it
explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq
from one test case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:41 -08:00
Johannes Schindelin 2dbd00a7a1 t6302: use `main` as initial branch name
In 66713e84e7 (tests: prepare aligned mentions of the default branch
name, 2020-10-23), we started adjusting this test script for the default
initial branch name changing to `main`.

However, there is no need to wait for that: let's adjust the test script
to stop relying on a specific initial branch name by setting it
explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq
from six test cases.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:41 -08:00
Johannes Schindelin 72dc172804 t5703: use `main` as initial branch name
In 97cf8d50b5 (t5703: adjust a test case for the upcoming default
branch name, 2020-10-23), we prepared this test script for a world when
the default initial branch name would be `main`.

However, there is no need to wait for that: let's adjust the test script
to stop relying on a specific initial branch name by setting it
explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq
from one test case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:41 -08:00
Johannes Schindelin 83ecf26ee7 t5510: use `main` as initial branch name
In 66713e84e7 (tests: prepare aligned mentions of the default branch
name, 2020-10-23), we prepared this test script for a time when the
default initial branch name would be `main`.

However, there is no need to wait for that: let's adjust the test script
to stop relying on a specific initial branch name by setting it
explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq
from two test cases.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:41 -08:00
Johannes Schindelin 97b913681b t5505: finalize transitioning to using the branch name `main`
In 66713e84e7 (tests: prepare aligned mentions of the default branch
name, 2020-10-23), we started that transition, trying to prepare for a
time when `git init` would use that name for the initial branch.

Even if that time has not arrived, we can complete the transition by
making the test script independent of the default branch name. This also
allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from four test
cases.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:41 -08:00
Johannes Schindelin 654bd7e8a9 t3205: finalize transitioning to using the branch name `main`
In 66713e84e7 (tests: prepare aligned mentions of the default branch
name, 2020-10-23), we started that transition, trying to prepare for a
time when `git init` would use that name for the initial branch.

Even if that time has not arrived, we can complete the transition by
making the test script independent of the default branch name. This also
allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from one test
case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:41 -08:00
Johannes Schindelin 1eee0a42f9 t3203: complete the transition to using the branch name `main`
In 66713e84e7 (tests: prepare aligned mentions of the default branch
name, 2020-10-23), we started that transition, trying to prepare for a
time when `git init` would use that name for the initial branch.

Even if that time has not arrived, we can complete the transition by
making the test script independent of the default branch name. This also
allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from one test
case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:41 -08:00
Johannes Schindelin 94287e788b t3201: finalize transitioning to using the branch name `main`
In 66713e84e7 (tests: prepare aligned mentions of the default branch
name, 2020-10-23), we started that transition, trying to prepare for a
time when `git init` would use that name for the initial branch.

Even if that time has not arrived, we can complete the transition by
making the test script independent of the default branch name. This also
allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from one test
case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:40 -08:00
Johannes Schindelin ec9779bcd8 t3200: finish transitioning to the initial branch name `main`
In 56300ff356 (t3200: prepare for `main` being shorter than `master`,
2020-10-23) and in 66713e84e7 (tests: prepare aligned mentions of the
default branch name, 2020-10-23), we started to prepare t3200 for a new
world where `git init` uses the branch name `main` for the initial
branch.

We do not even have to wait for that new world: we can easily ensure
that that branch name is used, independent of the exact name `git init`
will give the initial branch, so let's do that.

This also lets us remove the `PREPARE_FOR_MAIN_BRANCH` prereq from three
test cases in that script.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:40 -08:00
Johannes Schindelin 35a16dbe32 t1400: use `main` as initial branch name
In 3224b0f0bb (t1400: prepare for `main` being default branch name,
2020-10-23), we prepared t1400 for a time when the default initial
branch name would be `main`.

However, there is no need to wait that long: let's adjust the test
script to stop relying on a specific initial branch name by setting it
explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq
from two test cases.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:41:40 -08:00
Junio C Hamano 50f0439490 diff: correct interaction between --exit-code and -I<pattern>
Just like "git diff -w --exit-code" should exit with 0 when ignoring
whitespace differences results in no changes shown, if ignoring
certain changes with "git diff -I<pattern> --exit-code" result in an
empty patch, we should exit with 0.

The test suite did not cover the interaction between "--exit-code"
and "-w"; add one while adding a new test for "--exit-code" + "-I".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 17:33:26 -08:00
Jiang Xin 7715c382e8 Merge branch 'fr_next' of github.com:jnavila/git into git-po-master
* 'fr_next' of github.com:jnavila/git:
  l10n: fr.po: v2.30.0 rnd 1
  l10n: fr.po Fix a typo
  l10n: fr fix misleading message
2020-12-17 08:41:27 +08:00
Jiang Xin 763d202212 Merge branch '2.30-rc1' of github.com:bitigchi/git-po
* '2.30-rc1' of github.com:bitigchi/git-po:
  l10n: tr: v2.30.0-r1
2020-12-17 08:39:48 +08:00
Jean-Noël Avila 02cc663a76 l10n: fr.po: v2.30.0 rnd 1
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2020-12-16 22:26:55 +01:00
Baptiste Fontaine 5e38c80fa7 l10n: fr.po Fix a typo
Signed-off-by: Baptiste Fontaine <b@ptistefontaine.fr>
2020-12-16 21:30:52 +01:00
Jean-Noël Avila af60d9552a l10n: fr fix misleading message
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Reported-by: Sami Boukortt <sami@boukortt.com>
2020-12-16 21:30:52 +01:00
Eric Sunshine f4698738f9 t/perf: fix test_export() failure with BSD `sed`
test_perf() runs each test in its own subshell which makes it difficult
to persist variables between tests. test_export() addresses this
shortcoming by grabbing the values of specified variables after a test
runs but before the subshell exits, and writes those values to a file
which is loaded into the environment of subsequent tests.

To grab the values to be persisted, test_export() pipes the output of
the shell's builtin `set` command through `sed` which plucks them out
using a regular expression along the lines of `s/^(var1|var2)/.../p`.
Unfortunately, though, this use of alternation is not portable. For
instance, BSD-lineage `sed` (including macOS `sed`) does not support it
in the default "basic regular expression" mode (BRE). It may be possible
to enable "extended regular expression" mode (ERE) in some cases with
`sed -E`, however, `-E` is neither portable nor part of POSIX.

Fortunately, alternation is unnecessary in this case and can easily be
avoided, so replace it with a series of simple expressions such as
`s/^var1/.../p;s/^var2/.../p`.

While at it, tighten the expressions so they match the variable names
exactly rather than matching prefixes (i.e. use `s/^var1=/.../p`).

If the requirements of test_export() become more complex in the future,
then an alternative would be to replace `sed` with `perl` which supports
alternation on all platforms, however, the simple elimination of
alternation via multiple `sed` expressions suffices for the present.

Reported-by: Sangeeta <sangunb09@gmail.com>
Diagnosed-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-16 11:00:29 -08:00
Emir Sarı 9a161f8234 l10n: tr: v2.30.0-r1
Signed-off-by: Emir Sarı <bitigchi@me.com>
2020-12-16 15:31:50 +03:00
Ævar Arnfjörð Bjarmason 56f56ac50b style: do not "break" in switch() after "return"
Remove this unreachable code. It was found by SunCC, it's found by a
non-fatal warning emitted by SunCC. It's one of the things it's more
vehement about than GCC & Clang.

It complains about a lot of other similarly unreachable code, e.g. a
BUG(...) without a "return", and a "return 0" after a long if/else,
both of whom have "return" statements. Those are also genuine
redundancies to a compiler, but arguably make the code a bit easier to
read & less fragile to maintain.

These return/break cases are just unnecessary however, and as seen
here the surrounding code just did a plain "return" without a "break"
already.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-15 16:32:50 -08:00
Junio C Hamano 14639a4779 compat-util: pretend that stub setitimer() always succeeds
When 15b52a44 (compat-util: type-check parameters of no-op
replacement functions, 2020-08-06) turned a handful of no-op
C-preprocessor macros into static inline functions to give the
callers a better type checking for their parameters, it forgot
to return anything from the stubbed out setitimer() function,
even though the function was defined to return an int just like the
real thing.

Since the original C-preprocessor macro implementation was to just
turn the call to the function an empty statement, we know that the
existing callers do not check the return value from it, and it does
not matter what value we return.  But it is safer to pretend that
the call succeeded by returning 0 than making it fail by returning -1
and clobbering errno with some value.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-15 15:31:10 -08:00
Junio C Hamano 37e73233c3 strmap: make callers of strmap_remove() to call it in void context
Two "static inline" functions, both of which return void, call
strmap_remove() and tries to return the value it returns as their
return value, which is just bogus, as strmap_remove() returns void
itself.  Call it in the void context and fall-thru the control to
the end instead.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-15 15:30:44 -08:00
Peter Krefting bafe27cf07 l10n: sv.po: Update Swedish translation (5038t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2020-12-15 21:42:13 +01:00
Jiang Xin 0c32704f6a l10n: git.pot: v2.30.0 round 1 (70 new, 45 removed)
Generate po/git.pot from v2.30.0-rc0 for git v2.30.0 l10n round 1.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2020-12-15 16:27:56 +08:00
Đoàn Trần Công Danh fcedbc1cf6 doc: mention Python 3.x supports
Commit 0b4396f068, (git-p4: make python2.7 the oldest supported version,
2019-12-13) pointed out that git-p4 uses Python 2.7-or-later features
in the code.

In addition, git-p4 gained enough support for Python 3 from
6cec21a82f, (git-p4: encode/decode communication with p4 for
python3, 2019-12-13).

Let's update our documentation to reflect that fact.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-14 15:01:03 -08:00
Junio C Hamano 1c52ecf4ba Git 2.30-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-14 10:30:05 -08:00
Junio C Hamano 3fc7fc1c5f Merge branch 'js/t5526-with-no-particular-primary-branch-name'
Test update.

* js/t5526-with-no-particular-primary-branch-name:
  t5526: drop the prereq expecting the default branch name `main`
  t5526: avoid depending on a specific default branch name
2020-12-14 10:21:38 -08:00
Junio C Hamano 043bfc62e3 Merge branch 'js/cmake-extra-built-ins-fix'
VSbuild fix.

* js/cmake-extra-built-ins-fix:
  cmake: determine list of extra built-ins dynamically
2020-12-14 10:21:38 -08:00
Junio C Hamano ccbde2c4f4 Merge branch 'da/vs-build-iconv-fix'
Build update.

* da/vs-build-iconv-fix:
  ci(vs-build): stop passing the iconv library location explicitly
2020-12-14 10:21:38 -08:00
Junio C Hamano 3c9f0df16a Merge branch 'jk/multi-line-indent-style-fix'
Style fix.

* jk/multi-line-indent-style-fix:
  style: indent multiline "if" conditions to align
2020-12-14 10:21:38 -08:00
Junio C Hamano a5e74b4baa Merge branch 'jk/check-config-parsing-error-in-upload-pack'
Tighten error checking in the codepath that responds to "git fetch".

* jk/check-config-parsing-error-in-upload-pack:
  upload-pack: propagate return value from object filter config callback
2020-12-14 10:21:37 -08:00
Junio C Hamano aa35dadb26 Merge branch 'ae/doc-reproducible-html'
Newer versions of xsltproc can assign IDs in HTML documents it
generates in a consistent manner.  Use the feature to help format
HTML version of the user manual reproducibly.

* ae/doc-reproducible-html:
  doc: make HTML manual reproducible
2020-12-14 10:21:37 -08:00
Junio C Hamano c9f1f4412c Merge branch 'so/glossary-branch-is-not-necessarily-active'
The glossary described a branch as an "active" line of development,
which is misleading---a stale and non-moving branch is still a
branch.

* so/glossary-branch-is-not-necessarily-active:
  glossary: improve "branch" definition
2020-12-14 10:21:37 -08:00
Junio C Hamano c59b73bef3 Merge branch 'fc/atmark-in-refspec'
"@" sometimes worked (e.g. "git push origin @:there") as a part of
a refspec element, but "git push origin @" did not work, which has
been corrected.

* fc/atmark-in-refspec:
  refspec: make @ a synonym of HEAD
  tests: push: trivial cleanup
  tests: push: improve cleanup of HEAD tests
2020-12-14 10:21:36 -08:00
Junio C Hamano 78abcff222 Merge branch 'dd/help-autocorrect-never'
"git $cmd $args", when $cmd is not a recognised subcommand, by
default tries to see if $cmd is a typo of an existing subcommand
and optionally executes the corrected command if there is only one
possibility, depending on the setting of help.autocorrect; the
users can now disable the whole thing, including the cycles spent
to find a likely typo, by setting the configuration variable to
'never'.

* dd/help-autocorrect-never:
  help.c: help.autocorrect=never means "do not compute suggestions"
2020-12-14 10:21:36 -08:00