1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 16:26:10 +02:00
Commit Graph

65717 Commits

Author SHA1 Message Date
Junio C Hamano 2981dbea78 Merge branch 'po/readme-mention-contributor-hints'
Doc update.

* po/readme-mention-contributor-hints:
  README.md: add CodingGuidelines and a link for Translators
2022-02-09 14:20:59 -08:00
Junio C Hamano 13ce8f9f14 Merge branch 'jt/conditional-config-on-remote-url'
The conditional inclusion mechanism of configuration files using
"[includeIf <condition>]" learns to base its decision on the
URL of the remote repository the repository interacts with.

* jt/conditional-config-on-remote-url:
  config: include file if remote URL matches a glob
  config: make git_config_include() static
2022-02-09 14:20:59 -08:00
Junio C Hamano 87bfbd52e2 Merge branch 'en/merge-ort-restart-optim-fix'
The merge-ort misbehaved when merge.renameLimit configuration is
set too low and failed to find all renames.

* en/merge-ort-restart-optim-fix:
  merge-ort: avoid assuming all renames detected
2022-02-09 14:20:58 -08:00
Junio C Hamano e1c192d387 Merge branch 'js/test-unset-trace2-parents'
Avoid tests that are run under GIT_TRACE2 set from failing
unnecessarily.

* js/test-unset-trace2-parents:
  test-lib: unset trace2 parent envvars
2022-02-09 14:20:58 -08:00
Junio C Hamano 38062e73e0 The first batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-05 09:43:36 -08:00
Junio C Hamano ee52b35e50 Merge branch 'ms/update-index-racy'
"git update-index --refresh" has been taught to deal better with
racy timestamps (just like "git status" already does).

* ms/update-index-racy:
  update-index: refresh should rewrite index in case of racy timestamps
  t7508: add tests capturing racy timestamp handling
  t7508: fix bogus mtime verification
  test-lib: introduce API for verifying file mtime
2022-02-05 09:42:32 -08:00
Junio C Hamano 1b4d9b4512 Merge branch 'jc/reflog-parse-options'
Use the parse-options API in "git reflog" command.

* jc/reflog-parse-options:
  builtin/reflog.c: use parse-options api for expire, delete subcommands
2022-02-05 09:42:32 -08:00
Junio C Hamano 008028a910 Merge branch 'ab/cat-file'
Assorted updates to "git cat-file", especially "-h".

* ab/cat-file:
  cat-file: s/_/-/ in typo'd usage_msg_optf() message
  cat-file: don't whitespace-pad "(...)" in SYNOPSIS and usage output
  cat-file: use GET_OID_ONLY_TO_DIE in --(textconv|filters)
  object-name.c: don't have GET_OID_ONLY_TO_DIE imply *_QUIETLY
  cat-file: correct and improve usage information
  cat-file: fix remaining usage bugs
  cat-file: make --batch-all-objects a CMDMODE
  cat-file: move "usage" variable to cmd_cat_file()
  cat-file docs: fix SYNOPSIS and "-h" output
  parse-options API: add a usage_msg_optf()
  cat-file tests: test messaging on bad objects/paths
  cat-file tests: test bad usage
2022-02-05 09:42:31 -08:00
Junio C Hamano 66775d2109 Merge branch 'jc/qsort-s-alignment-fix'
Fix a hand-rolled alloca() imitation that may have violated
alignment requirement of data being sorted in compatibility
implementation of qsort_s() and stable qsort().

* jc/qsort-s-alignment-fix:
  stable-qsort: avoid using potentially unaligned access
  compat/qsort_s.c: avoid using potentially unaligned access
2022-02-05 09:42:31 -08:00
Junio C Hamano 4bb003d539 Merge branch 'rs/apply-symlinks-use-strset'
"git apply" (ab)used the util pointer of the string-list to keep
track of how each symbolic link needs to be handled, which has been
simplified by using strset.

* rs/apply-symlinks-use-strset:
  apply: use strsets to track symlinks
2022-02-05 09:42:30 -08:00
Junio C Hamano d0bb19cbf7 Merge branch 'rs/grep-expr-cleanup'
Code clean-up.

* rs/grep-expr-cleanup:
  grep: use grep_and_expr() in compile_pattern_and()
  grep: extract grep_binexp() from grep_or_expr()
  grep: use grep_not_expr() in compile_pattern_not()
  grep: use grep_or_expr() in compile_pattern_or()
2022-02-05 09:42:30 -08:00
Junio C Hamano 391d85d78d Merge branch 'jh/p4-spawning-external-commands-cleanup'
* jh/p4-spawning-external-commands-cleanup:
  git-p4: don't print shell commands as python lists
  git-p4: pass command arguments as lists instead of using shell
  git-p4: don't select shell mode using the type of the command argument
2022-02-05 09:42:30 -08:00
Junio C Hamano 8b9c425629 Merge branch 'jh/p4-fix-use-of-process-error-exception'
* jh/p4-fix-use-of-process-error-exception:
  git-p4: fix instantiation of CalledProcessError
2022-02-05 09:42:29 -08:00
Junio C Hamano 492261a6de Merge branch 'jc/find-header'
Code clean-up.

* jc/find-header:
  receive-pack.c: consolidate find header logic
2022-02-05 09:42:29 -08:00
Junio C Hamano 7a9ae6d0d9 Merge branch 'pb/pull-rebase-autostash-fix'
"git pull --rebase" ignored the rebase.autostash configuration
variable when the remote history is a descendant of our history,
which has been corrected.

* pb/pull-rebase-autostash-fix:
  pull --rebase: honor rebase.autostash when fast-forwarding
2022-02-05 09:42:28 -08:00
Junio C Hamano 5d01301f2b Git 2.35.1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4fA2sf7nIh/HeOzvsLXohpav5ssFAmH0jvsACgkQsLXohpav
 5ssJ8w//aAEXTNfDH15U+PwZ95OxAGV0mT4JCSK7fjB7kjqAMRLziVGPrlXzGTjc
 wxKVd5nvQAjB86P+sKSC/6AUx38QXlsurtUb+yhRMcogXm2ESdHTQ8IsofCo4yRq
 zDAQyf8RPKJFygMdVDjfXOIRP5NXTqVTAa67QihZOuqy5PvcEh7IRScd0f5pIsyD
 RO55G7eC9KZZJH5yrz0OpEj3xHxqZL+tO22ue777YUagUxS8Kt+183Fyc73H/eBz
 69TxEc76t54AjNNFgghTiF00zirl7qv/lRCYldqFfpoutxtAHdjuiy7E+h/NhY9r
 fkrVVGA3ms//ln32SU26Jm3zxEu31PSrCqP2KzdTdVO/I97jWnWytEZSWvVCZB6m
 BZDG1yKrLSlH48SqgxnPLGMeeqA1kldqI9e3lgpTMPUJO7xjXi0i10lFhL4N+pPX
 VMsjxlcaV6A1ey0CMCMtBZ2g8sJkKUuSA/HJrhhXBJkl88oWUAvPC6zIBG2xrDHy
 1qc4cAFNw4zwJylnyUYXbkeRn1/Z6lg8JeUfdWdZktjmL0ZbgLTM+CWKJhx/1WN2
 hu5DEFa7yH4IS4GW6W6N14mxTrMC2IehqKLhHd/0L8cqEVsnUb0xWLa0zChAdM7s
 G1XpNQSJxyBj74tJ8lMB+0P1cpqQF4ZkVk2Tx8e0xyVEaa5Vljg=
 =/DjY
 -----END PGP SIGNATURE-----

Sync with Git 2.35.1
2022-01-28 16:58:04 -08:00
Junio C Hamano 90fb70e458 Name the next one 2.36 to prepare for 2.35.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-28 16:57:10 -08:00
Junio C Hamano 4c53a8c20f Git 2.35.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-28 16:48:42 -08:00
Junio C Hamano f120b65cd4 Merge branch 'en/keep-cwd' into maint
Fix a regression in 2.35 that roke the use of "rebase" and "stash"
in a secondary worktree.

* en/keep-cwd:
  sequencer, stash: fix running from worktree subdir
2022-01-28 16:45:52 -08:00
Junio C Hamano b23dac905b Merge branch 'en/keep-cwd'
Fix a regression in 2.35 that roke the use of "rebase" and "stash"
in a secondary worktree.

* en/keep-cwd:
  sequencer, stash: fix running from worktree subdir
2022-01-26 22:22:24 -08:00
Junio C Hamano 7747e12d71 Start post 2.35 cycle
The tree is not open for new development yet, but let's mark the
beginning of the new cycle before we start merging down regression
fix topics.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-26 22:21:01 -08:00
Elijah Newren ff5b7913f0 sequencer, stash: fix running from worktree subdir
In commits bc3ae46b42 ("rebase: do not attempt to remove
startup_info->original_cwd", 2021-12-09) and 0fce211ccc ("stash: do not
attempt to remove startup_info->original_cwd", 2021-12-09), we wanted to
allow the subprocess to know which directory the parent process was
running from, so that the subprocess could protect it.  However...

When run from a non-main worktree, setup_git_directory() will note
that the discovered git directory
(/PATH/TO/.git/worktree/non-main-worktree) does not match
DEFAULT_GIT_DIR_ENVIRONMENT (see setup_discovered_git_dir()), and
decide to set GIT_DIR in the environment.  This matters because...

Whenever git is run with the GIT_DIR environment variable set, and
GIT_WORK_TREE not set, it presumes that '.' is the working tree.  So...

This combination results in the subcommand being very confused about
the working tree.  Fix it by also setting the GIT_WORK_TREE environment
variable along with setting cmd.dir.

A possibly more involved fix we could consider for later would be to
make setup.c set GIT_WORK_TREE whenever (a) it discovers both the git
directory and the working tree and (b) it decides to set GIT_DIR in the
environment.  I did not attempt that here as such would be too big of a
change for a 2.35.1 release.

Test-case-by: Glen Choo <chooglen@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-26 12:01:54 -08:00
Junio C Hamano 89bece5c8c Git 2.35
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-24 09:25:25 -08:00
Junio C Hamano c6e19e47a6 Merge branch 'ab/checkout-branch-info-leakfix'
We added an unrelated sanity checking that leads to a BUG() while
plugging a leak, which triggered in a repository with symrefs in
the local branch namespace that point at a ref outside.  Partially
revert the change to avoid triggering the BUG().

* ab/checkout-branch-info-leakfix:
  checkout: avoid BUG() when hitting a broken repository
2022-01-24 09:14:46 -08:00
Junio C Hamano 7ea759cf9b l10n-2.35.0-rnd2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE37vMEzKDqYvVxs51k24VDd1FMtUFAmHtRtQACgkQk24VDd1F
 MtWGig//XRKSyU7Q6xSdGBTrB9W+Jzb6n3bnHoD7X5g3nLjQ9IgCz1TcNuyjvM8S
 cH3RF0eX2mixRCKQ2EXk1KYR3Gdscn3Ds4sVyJfM0aWMzgOyjLQXPXflETciFtQp
 eaVv2DWJe3Nh1iMa30mbXcKovfOPw7jLl3UxTdY+Qo2sciciSJ+TZi3Vif2bhQI8
 hXC/uKGL9rTsVW7FmxsH2x3UxW76PMKrA2ruewTaVh6jif0iURS97NAQkLRl+JfA
 29KZzEzuX/DvRbyjBN/8sEwTXatvjDwHbVrhv+XNEeowY+LQZGq3lj9J4z22EvcK
 taPZFDYqLSU7tm53pdGNj5aoKxhe0y4kcTsKBTRZYB5Azt9B+qzwoV01tO7jGW6G
 UjId4bfhd50FPE0ynyk88onAxAqDwa8VYWXl4DtVXIiknT4VvYQeWubb8w8XuBsb
 S3pLgLFCQCZslxmYa9gWSgaeNftL5LtLKo6owu9clC85+37bs4kUStNl7TArwTXg
 hxct/o4vPCey5Gtl0GEk/5l0ObTe5Rq0qPHg/PyK3J6nzpuM57xshm3ZW1IFxGQd
 hfYzncwfj5DSs5s51vRF1QMpUwHLmBcE79Lasmz1Ftf/L5b7D/ccQYAspB41IAF7
 7xRceZ1RhH43jmB/VlgmlsCe9MP6b2yJhEJx+miDjg+Gqk67p7s=
 =mbMi
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.35.0-rnd2' of git://github.com/git-l10n/git-po

l10n-2.35.0-rnd2

* tag 'l10n-2.35.0-rnd2' of git://github.com/git-l10n/git-po:
  l10n: Update Catalan translation
  l10n: zh_TW: v2.35.0 round 2 (0 untranslated)
  l10n: Update Catalan translation
  l10n: de.po: Update German translation
  l10n: de.po: Fix translation for "'%s' is aliased to '%s'"
  l10n: po-id for 2.35 (round 2)
  l10n: Update Catalan translation
  l10n: vi(5195t): Update for v2.35.0 round 2
  l10n: batch update to fix typo in branch.c
  l10n: git.pot: v2.35.0 round 2 (1 new, 1 removed)
  l10n: bg.po: Updated Bulgarian translation (5195t)
  l10n: zh_CN: v2.35.0 round 1
  l10n: fr: v2.35.0 round 1
  l10n: zh_TW: v2.35.0 round 1 (1 fuzzy)
  l10n: po-id for 2.35 (round 1)
  l10n: sv.po: Update Swedish translation (5196t0f0u)
  l10n: sv.po: Fix typo
  l10n: tr: v2.35.0 round 1
  l10n: git.pot: v2.35.0 round 1 (126 new, 142 removed)
2022-01-24 09:09:34 -08:00
Jordi Mas 9e2b35d764 l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2022-01-23 09:40:52 +01:00
Jiang Xin 0fff4ea346 Merge branch 'l10n/zh_TW/220113' of github.com:l10n-tw/git-po
* 'l10n/zh_TW/220113' of github.com:l10n-tw/git-po:
  l10n: zh_TW: v2.35.0 round 2 (0 untranslated)
  l10n: zh_TW: v2.35.0 round 1 (1 fuzzy)
2022-01-22 16:27:41 +08:00
Junio C Hamano 519947b69a checkout: avoid BUG() when hitting a broken repository
When 9081a421 (checkout: fix "branch info" memory leaks, 2021-11-16)
cleaned up existing memory leaks, we added an unrelated sanity check
to ensure that a local branch is truly local and not a symref to
elsewhere that dies with BUG() otherwise.  This was misguided in two
ways.  First of all, such a tightening did not belong to a leak-fix
patch.  And the condition it detected was *not* a bug in our program
but a problem in user data, where warning() or die() would have been
more appropriate.

As the condition is not fatal (the result of computing the local
branch name in the code that is involved in the faulty check is only
used as a textual label for the commit), let's revert the code to
the original state, i.e. strip "refs/heads/" to compute the local
branch name if possible, and otherwise leave it NULL.  The consumer
of the information in merge_working_tree() is prepared to see NULL
in there and act accordingly.

cf. https://bugzilla.redhat.com/show_bug.cgi?id=2042920

Reported-by: Petr Šplíchal <psplicha@redhat.com>
Reported-by: Todd Zullinger <tmz@pobox.com>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-21 17:04:50 -08:00
Yi-Jyun Pan 87953304da
l10n: zh_TW: v2.35.0 round 2 (0 untranslated)
Used 1 translation from zh_CN. Thanks to zh_CN translation team!

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2022-01-22 07:10:43 +08:00
Jordi Mas b3d4896aad l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2022-01-21 07:56:02 +01:00
Junio C Hamano 297ca895a2 Merge branch 'js/branch-track-inherit'
"git branch -h" incorrectly said "--track[=direct|inherit]",
implying that "--trackinherit" is a valid option, which has been
corrected.
source: <3de40324bea6a1dd9bca2654721471e3809e87d8.1642538935.git.steadmon@google.com>
source: <c3c26192-aee9-185a-e559-b8735139e49c@web.de>

* js/branch-track-inherit:
  branch,checkout: fix --track documentation
2022-01-20 15:25:38 -08:00
René Scharfe 6327f0efed branch,checkout: fix --track documentation
Document that the accepted variants of the --track option are --track,
--track=direct, and --track=inherit.  The equal sign in the latter two
cannot be replaced with whitespace; in general optional arguments need
to be attached firmly to their option.

Put "direct" consistently before "inherit", if only for the reasons
that the former is the default, explained first in the documentation,
and comes before the latter alphabetically.

Mention both modes in the short help so that readers don't have to look
them up in the full documentation.  They are literal strings and thus
untranslatable.  PARSE_OPT_LITERAL_ARGHELP is inferred due to the pipe
and parenthesis characters, so we don't have to provide that flag
explicitly.

Mention that -t has the same effect as --track and --track=direct.
There is no way to specify inherit mode using the short option, because
short options generally don't accept optional arguments.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-20 11:07:51 -08:00
Josh Steadmon 944d808e42 test-lib: unset trace2 parent envvars
The trace2 subsystem can inherit certain information from parent
processes via environment variables; e.g., the parent command name and
session ID. This allows trace2 to note when a command is the child
process of another Git process, and to adjust various pieces of output
accordingly.

This behavior breaks certain tests that examine trace2 output when the
tests run as a child of another git process, such as in `git rebase -x
"make test"`.

While we could fix this by unsetting the relevant variables in the
affected tests (currently t0210, t0211, t0212, and t6421), this would
leave other tests vulnerable to similar breakage if new test cases are
added which inspect trace2 output. So fix this in general by unsetting
GIT_TRACE2_PARENT_NAME and GIT_TRACE2_PARENT_SID in test-lib.sh.

Reported-by: Emily Shaffer <emilyshaffer@google.com>
Helped-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-20 10:51:33 -08:00
Matthias Rüster 159af2a97f l10n: de.po: Update German translation
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
2022-01-20 18:23:36 +01:00
Jürgen Krämer ea0fca8d2a l10n: de.po: Fix translation for "'%s' is aliased to '%s'"
The German translation for "'%s' is aliased to '%s'" is incorrect. It
switches the order of alias name and alias definition.

A better translation would be "'%s' ist ein Alias für '%s'". (Full stop
removed intentionally, because the original does not use one either.)

Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2022-01-20 18:11:37 +01:00
Jiang Xin 7ff31e1c72 Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.35 (round 2)
2022-01-20 10:40:08 +08:00
Junio C Hamano 50b2d72e11 Git 2.35-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-19 12:48:46 -08:00
Johannes Schindelin e2724c1ed1 getcwd(mingw): handle the case when there is no cwd
A recent upstream topic introduced checks for certain Git commands that
prevent them from deleting the current working directory, introducing
also a regression test that ensures that commands such as `git version`
_can_ run without a current working directory.

While technically not possible on Windows via the regular Win32 API, we
do run the regression tests in an MSYS2 Bash which uses a POSIX
emulation layer (the MSYS2/Cygwin runtime) where a really evil hack
_does_ allow to delete a directory even if it is the current working
directory.

Therefore, Git needs to be prepared for a missing working directory,
even on Windows.

This issue was not noticed in upstream Git because there was no caller
that tried to discover a Git directory with a deleted current working
directory in the test suite. But in the microsoft/git fork, we do want
to run `pre-command`/`post-command` hooks for every command, even for
`git version`, which means that we make precisely such a call. The bug
is not in that `pre-command`/`post-command` feature, though, but in
`mingw_getcwd()` and needs to be addressed there.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-19 11:27:31 -08:00
Bagas Sanjaya 80dabf99ee l10n: po-id for 2.35 (round 2)
Translate following new components:

  * advice.c
  * alias.c
  * sequencer.c
  * sparse-index.c
  * builtin/sparse-checkout.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2022-01-19 17:59:41 +07:00
Jordi Mas 0f8f20f222 l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2022-01-19 14:56:01 +08:00
Junio C Hamano af4e5f569b Merge branch 'js/branch-track-inherit'
"git branch -h" incorrectly said "--track[=direct|inherit]",
implying that "--trackinherit" is a valid option, which has been
corrected.

* js/branch-track-inherit:
  branch,checkout: fix --track usage strings
2022-01-18 16:02:23 -08:00
Junio C Hamano 0330edb239 Merge branch 'jc/freebsd-without-c99-only-build'
FreeBSD 13.0 headers have unconditional dependency on C11 language
features, and adding -std=gnu99 to DEVELOPER_CFLAGS would just
break the developer build.

* jc/freebsd-without-c99-only-build:
  Makefile: FreeBSD cannot do C99-or-below build
2022-01-18 16:02:23 -08:00
Josh Steadmon 15f002812f branch,checkout: fix --track usage strings
As Ævar pointed out in [1], the use of PARSE_OPT_LITERAL_ARGHELP with a
list of allowed parameters is not recommended. Both git-branch and
git-checkout were changed in d311566 (branch: add flags and config to
inherit tracking, 2021-12-20) to use this discouraged combination for
their --track flags.

Fix this by removing PARSE_OPT_LITERAL_ARGHELP, and changing the arghelp
to simply be "mode". Users may discover allowed values in the manual
pages.

[1]: https://lore.kernel.org/git/220111.86a6g3yqf9.gmgdl@evledraar.gmail.com/

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-18 14:08:15 -08:00
Jonathan Tan 399b198489 config: include file if remote URL matches a glob
This is a feature that supports config file inclusion conditional on
whether the repo has a remote with a URL that matches a glob.

Similar to my previous work on remote-suggested hooks [1], the main
motivation is to allow remote repo administrators to provide recommended
configs in a way that can be consumed more easily (e.g. through a
package installable by a package manager - it could, for example,
contain a file to be included conditionally and a post-install script
that adds the include directive to the system-wide config file).

In order to do this, Git reruns the config parsing mechanism upon
noticing the first URL-conditional include in order to find all remote
URLs, and these remote URLs are then used to determine if that first and
all subsequent includes are executed. Remote URLs are not allowed to be
configued in any URL-conditionally-included file.

[1] https://lore.kernel.org/git/cover.1623881977.git.jonathantanmy@google.com/

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Acked-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-18 13:55:53 -08:00
Jonathan Tan ed69e11b89 config: make git_config_include() static
It is not used from outside the file in which it is declared.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Acked-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-18 13:55:53 -08:00
Junio C Hamano 2b95d94b05 Makefile: FreeBSD cannot do C99-or-below build
In "make DEVELOPER=YesPlease" builds, we try to help developers to
catch as many potential issues as they can by using -Wall and
turning compilation warnings into errors.  In the same spirit, we
recently started adding -std=gnu99 to their CFLAGS, so that they can
notice when they accidentally used language features beyond C99.

It however turns out that FreeBSD 13.0 mistakenly uses C11 extension
in its system header files regardless of what __STDC_VERSION__ says,
which means that the platform (unless we tweak their system headers)
cannot be used for this purpose.

It seems that -std=gnu99 is only added conditionally even in today's
config.mak.dev, so it is fine if we dropped -std=gnu99 from there.
Which means that developers on FreeBSD cannot participate in vetting
use of features beyond C99, but there are developers on other
platforms who will, so it's not too bad.

We might want a more "fundamental" fix to make the platform capable
of taking -std=gnu99, like working around the use of unconditional
C11 extension in its system header files by supplying a set of
"replacement" definitions in our header files.  We chose not to
pursue such an approach for two reasons at this point:

 (1) The fix belongs to the FreeBSD project, not this project, and
     such an upstream fix may happen hopefully in a not-too-distant
     future.

 (2) Fixing such a bug in system header files and working it around
     can lead to unexpected breakages (other parts of their system
     header files may not be expecting to see and do not work well
     with our "replacement" definitions).  This close to the final
     release of this cycle, we have no time for that.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-18 12:16:23 -08:00
Junio C Hamano b56bd95bbc Merge branch 'da/rhel7-lacks-uncompress2-and-c99'
Adjust build on RHEL 7 to explicitly ask C99 support and use
the fallback implementation of uncompress2 we ship.

* da/rhel7-lacks-uncompress2-and-c99:
  build: centos/RHEL 7 ships with an older gcc and zlib
2022-01-17 15:15:59 -08:00
Elijah Newren 9ae39fef7f merge-ort: avoid assuming all renames detected
In commit 8b09a900a1 ("merge-ort: restart merge with cached renames to
reduce process entry cost", 2021-07-16), we noted that in the merge-ort
steps of
    collect_merge_info()
    detect_and_process_renames()
    process_entries()
that process_entries() was expensive, and we could often make it cheaper
by changing this to
    collect_merge_info()
    detect_and_process_renames()
    <cache all the renames, and restart>
    collect_merge_info()
    detect_and_process_renames()
    process_entries()
because the second collect_merge_info() would be cheaper (we could avoid
traversing into some directories), the second
detect_and_process_renames() would be free since we had already detected
all renames, and then process_entries() has far fewer entries to handle.

However, this was built on the assumption that the first
detect_and_process_renames() actually detected all potential renames.
If someone has merge.renameLimit set to some small value, that
assumption is violated which manifests later with the following message:

    $ git -c merge.renameLimit=1 rebase upstream
    ...
    git: merge-ort.c:546: clear_or_reinit_internal_opts: Assertion
    `renames->cached_pairs_valid_side == 0' failed.

Turn off this cache-renames-and-restart whenever we cannot detect all
renames, and add a testcase that would have caught this problem.

Reported-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Tested-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 14:24:22 -08:00
Philip Oakley 4ed7dfa713 README.md: add CodingGuidelines and a link for Translators
Before being told how to submit patches, new contributors need
to be told how to code for, or how to contribute translation to,
the project.  Add references to the CodingGuidelines and the
README document on localization.

Also, split out the instructions to join the list and clarify
that subscription is via the majordomo address.

We use GitHub Markdown reference [2,3] with trailing empty square
brackets, to match existing text in the file.  On GitHub/GitLab
pages, the footer references matching the empty [] are not shown
on the web page. We could switch to using [text](url) form [1]
if we wanted to, but that is not done as part of this patch.

[1] https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#links
[2] https://gist.github.com/ChrisTollefson/a3af6d902a74a0afd1c2d79aadc9bb3f#reference-links
[3] https://github.github.com/gfm/#example-561 (and the para aboveit)

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 11:43:14 -08:00
Tran Ngoc Quan 6bcc4e2c7d l10n: vi(5195t): Update for v2.35.0 round 2
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2022-01-17 14:15:31 +07:00