summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-06-24remote: use the configured default branch name when appropriateLibravatar Johannes Schindelin2-4/+21
When guessing the default branch name of a remote, and there are no refs to guess from, we want to go with the preference specified by the user for the fall-back, i.e. the default name to be used for the initial branch of new repositories (because as far as the user is concerned, a remote that has no branches yet is a new repository). At the same time, when talking to an older Git server that does not report a symref for `HEAD` (but instead reports a commit hash), let's try to guess the configured default branch name first. If it does not match the reported commit hash, let's fall back to `master` as before. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-24clone: use configured default branch name when appropriateLibravatar Johannes Schindelin3-5/+24
When cloning a repository without any branches, Git chooses a default branch name for the as-yet unborn branch. As part of the implicit initialization of the local repository, Git just learned to respect `init.defaultBranch` to choose a different initial branch name. We now really want that branch name to be used as a fall-back. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-24init: allow setting the default for the initial branch name via the configLibravatar Don Goodman-Wilson5-1/+57
We just introduced the command-line option `--initial-branch=<branch-name>` to allow initializing a new repository with a different initial branch than the hard-coded one. To allow users to override the initial branch name more permanently (i.e. without having to specify the name manually for each and every `git init` invocation), let's introduce the `init.defaultBranch` config setting. Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de> Helped-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Don Goodman-Wilson <don@goodman-wilson.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-24init: allow specifying the initial branch name for the new repositoryLibravatar Johannes Schindelin5-8/+50
There is a growing number of projects and companies desiring to change the main branch name of their repositories (see e.g. https://twitter.com/mislav/status/1270388510684598272 for background on this). To change that branch name for new repositories, currently the only way to do that automatically is by copying all of Git's template directory, then hard-coding the desired default branch name into the `.git/HEAD` file, and then configuring `init.templateDir` to point to those copied template files. To make this process much less cumbersome, let's introduce a new option: `--initial-branch=<branch-name>`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-24docs: add missing diamond bracketsLibravatar Johannes Schindelin3-3/+3
There were a couple of instances in our manual pages that had an opening diamond bracket without a corresponding closing one. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-24submodule: fall back to remote's HEAD for missing remote.<name>.branchLibravatar Johannes Schindelin5-12/+31
When `remote.<name>.branch` is not configured, `git submodule update` currently falls back to using the branch name `master`. A much better idea, however, is to use the remote `HEAD`: on all Git servers running reasonably recent Git versions, the symref `HEAD` points to the main branch. Note: t7419 demonstrates that there _might_ be use cases out there that _expect_ `git submodule update --remote` to update submodules to the remote `master` branch even if the remote `HEAD` points to another branch. Arguably, this patch makes the behavior more intuitive, but there is a slight possibility that this might cause regressions in obscure setups. Even so, it should be okay to fix this behavior without anything like a longer transition period: - The `git submodule update --remote` command is not really common. - Current Git's behavior when running this command is outright confusing, unless the remote repository's current branch _is_ `master` (in which case the proposed behavior matches the old behavior). - If a user encounters a regression due to the changed behavior, the fix is actually trivial: setting `submodule.<name>.branch` to `master` will reinstate the old behavior. Helped-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-24send-pack/transport-helper: avoid mentioning a particular branchLibravatar Johannes Schindelin3-2/+8
When trying to push all matching branches, but none match, we offer a message suggesting to push the `master` branch. However, we want to step away from making that branch any more special than any other branch, so let's reword that message to mention no branch in particular. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-23fmt-merge-msg: stop treating `master` speciallyLibravatar Johannes Schindelin29-97/+94
In the context of many projects renaming their primary branch names away from `master`, Git wants to stop treating the `master` branch specially. Let's start with `git fmt-merge-msg`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-08The second batchLibravatar Junio C Hamano1-0/+31
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-08Merge branch 'jt/curl-verbose-on-trace-curl'Libravatar Junio C Hamano8-9/+74
Rewrite support for GIT_CURL_VERBOSE in terms of GIT_TRACE_CURL. Looking good. * jt/curl-verbose-on-trace-curl: http, imap-send: stop using CURLOPT_VERBOSE t5551: test that GIT_TRACE_CURL redacts password
2020-06-08Merge branch 'cc/upload-pack-data'Libravatar Junio C Hamano1-153/+145
Code clean-up. * cc/upload-pack-data: upload-pack: use upload_pack_data fields in receive_needs() upload-pack: pass upload_pack_data to create_pack_file() upload-pack: remove static variable 'stateless_rpc' upload-pack: pass upload_pack_data to check_non_tip() upload-pack: pass upload_pack_data to send_ref() upload-pack: move symref to upload_pack_data upload-pack: use upload_pack_data writer in receive_needs() upload-pack: pass upload_pack_data to receive_needs() upload-pack: pass upload_pack_data to get_common_commits() upload-pack: use 'struct upload_pack_data' in upload_pack() upload-pack: move 'struct upload_pack_data' around upload-pack: move {want,have}_obj to upload_pack_data upload-pack: remove unused 'wants' from upload_pack_data
2020-06-08Merge branch 'cb/bisect-helper-parser-fix'Libravatar Junio C Hamano2-4/+11
The code to parse "git bisect start" command line was lax in validating the arguments. * cb/bisect-helper-parser-fix: bisect--helper: avoid segfault with bad syntax in `start --term-*`
2020-06-08Merge branch 'js/checkout-p-new-file'Libravatar Junio C Hamano3-9/+61
"git checkout -p" did not handle a newly added path at all. * js/checkout-p-new-file: checkout -p: handle new files correctly
2020-06-08Merge branch 'dl/remote-curl-deadlock-fix'Libravatar Junio C Hamano18-30/+211
On-the-wire protocol v2 easily falls into a deadlock between the remote-curl helper and the fetch-pack process when the server side prematurely throws an error and disconnects. The communication has been updated to make it more robust. * dl/remote-curl-deadlock-fix: stateless-connect: send response end packet pkt-line: define PACKET_READ_RESPONSE_END remote-curl: error on incomplete packet pkt-line: extern packet_length() transport: extract common fetch_pack() call remote-curl: remove label indentation remote-curl: fix typo
2020-06-08Merge branch 'bc/filter-process'Libravatar Junio C Hamano2-3/+9
Code simplification and test coverage enhancement. * bc/filter-process: t2060: add a test for switch with --orphan and --discard-changes builtin/checkout: simplify metadata initialization
2020-06-08Merge branch 'vs/complete-stash-show-p-fix'Libravatar Junio C Hamano1-1/+1
The command line completion script (in contrib/) tried to complete "git stash -p" as if it were "git stash push -p", but it was too aggressive and also affected "git stash show -p", which has been corrected. * vs/complete-stash-show-p-fix: completion: don't override given stash subcommand with -p
2020-06-08Merge branch 'rs/fsck-duplicate-names-in-trees'Libravatar Junio C Hamano2-17/+30
The check in "git fsck" to ensure that the tree objects are sorted still had corner cases it missed unsorted entries. * rs/fsck-duplicate-names-in-trees: fsck: detect more in-tree d/f conflicts t1450: demonstrate undetected in-tree d/f conflict t1450: increase test coverage of in-tree d/f detection fsck: fix a typo in a comment
2020-06-08Merge branch 'es/bugreport-shell'Libravatar Junio C Hamano3-0/+8
"git bugreport" learns to report what shell is in use. * es/bugreport-shell: bugreport: include user interactive shell help: add shell-path to --build-options
2020-06-08Merge branch 'tb/commit-graph-no-check-oids'Libravatar Junio C Hamano5-77/+95
Clean-up the commit-graph codepath. * tb/commit-graph-no-check-oids: commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag t5318: reorder test below 'graph_read_expect' commit-graph.c: simplify 'fill_oids_from_commits' builtin/commit-graph.c: dereference tags in builtin builtin/commit-graph.c: extract 'read_one_commit()' commit-graph.c: peel refs in 'add_ref_to_set' commit-graph.c: show progress of finding reachable commits commit-graph.c: extract 'refs_cb_data'
2020-06-08Merge branch 'cb/t4210-illseq-auto-detect'Libravatar Junio C Hamano3-52/+125
As FreeBSD is not the only platform whose regexp library reports a REG_ILLSEQ error when fed invalid UTF-8, add logic to detect that automatically and skip the affected tests. * cb/t4210-illseq-auto-detect: t4210: detect REG_ILLSEQ dynamically and skip affected tests t/helper: teach test-regex to report pattern errors (like REG_ILLSEQ)
2020-06-08Merge branch 'ds/line-log-on-bloom'Libravatar Junio C Hamano6-13/+152
"git log -L..." now takes advantage of the "which paths are touched by this commit?" info stored in the commit-graph system. * ds/line-log-on-bloom: line-log: integrate with changed-path Bloom filters line-log: try to use generation number-based topo-ordering line-log: more responsive, incremental 'git log -L' t4211-line-log: add tests for parent oids line-log: remove unused fields from 'struct line_log_data'
2020-06-02Start the post 2.27 cycleLibravatar Junio C Hamano2-1/+53
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-02Merge branch 'en/fast-import-looser-date'Libravatar Junio C Hamano3-5/+57
Some repositories in the wild have commits that record nonsense committer timezone (e.g. rails.git); "git fast-import" learned an option to pass these nonsense timestamps intact to allow recreating existing repositories as-is. * en/fast-import-looser-date: fast-import: add new --date-format=raw-permissive format
2020-06-02Merge branch 'mt/zsh-completion-optim'Libravatar Junio C Hamano1-1/+1
Command line completion (incontrib/) update. * mt/zsh-completion-optim: completion: use native ZSH array pattern matching
2020-06-02Merge branch 'la/diff-relative-config'Libravatar Junio C Hamano5-7/+108
The commands in the "diff" family learned to honor "diff.relative" configuration variable. * la/diff-relative-config: diff: add config option relative
2020-06-02Merge branch 'rs/checkout-b-track-error'Libravatar Junio C Hamano3-1/+35
The error message from "git checkout -b foo -t bar baz" was confusing. * rs/checkout-b-track-error: checkout: improve error messages for -b with extra argument checkout: add tests for -b and --track
2020-06-02Merge branch 'lo/sparse-universal-zero-init'Libravatar Junio C Hamano1-1/+1
We've adopted a convention that any on-stack structure can be initialized to have zero values in all fields with "= { 0 }", even when the first field happens to be a pointer, but sparse complained that a null pointer should be spelled NULL for a long time. Start using -Wno-universal-initializer option to squelch it. * lo/sparse-universal-zero-init: sparse: allow '{ 0 }' to be used without warnings
2020-06-02Merge branch 'cb/t5608-cleanup'Libravatar Junio C Hamano1-6/+5
Test fixup. * cb/t5608-cleanup: t5608: avoid say() and use "skip_all" instead for consistency
2020-06-02Merge branch 'jx/pkt-line-doc-count-fix'Libravatar Junio C Hamano2-4/+4
Docfix. * jx/pkt-line-doc-count-fix: doc: fix wrong 4-byte length of pkt-line message
2020-06-02Merge branch 'jn/experimental-opts-into-proto-v2'Libravatar Junio C Hamano3-1/+10
"feature.experimental" configuration variable is to let volunteers easily opt into a set of newer features, which use of the v2 transport protocol is now a part of. * jn/experimental-opts-into-proto-v2: config: let feature.experimental imply protocol.version=2
2020-06-02Merge branch 'bk/p4-prepare-p4-only-fix'Libravatar Junio C Hamano1-4/+5
The "--prepare-p4-only" option is supposed to stop after replaying one changeset, but kept going (by mistake?) * bk/p4-prepare-p4-only-fix: git-p4.py: fix --prepare-p4-only error with multiple commits
2020-06-02Merge branch 'an/merge-single-strategy-optim'Libravatar Junio C Hamano1-1/+1
Code optimization for a common case. * an/merge-single-strategy-optim: merge: optimization to skip evaluate_result for single strategy
2020-05-31Git 2.27Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-05-31Merge branch 'cb/test-use-ere-for-alternation'Libravatar Junio C Hamano2-2/+2
Portability fix for tests added recently. * cb/test-use-ere-for-alternation: t: avoid alternation (not POSIX) in grep's BRE
2020-05-31Merge tag 'l10n-2.27.0-rnd2' of git://github.com/git-l10n/git-poLibravatar Junio C Hamano12-43116/+47435
l10n-2.27.0-rnd2 * tag 'l10n-2.27.0-rnd2' of git://github.com/git-l10n/git-po: (23 commits) l10n: zh_TW.po: v2.27.0 round 2 (0 untranslated) l10n: zh_TW.po: v2.27.0 round 1 (0 untranslated) l10n: de.po: Fix typo in the German translation of octopus l10n: de.po: Update German translation for Git 2.27.0 l10n: it.po: update for Git 2.27.0 round #2 l10n: tr: v2.27.0 round 2 l10n: fr.po v2.27.0 rnd 2 l10n: bg.po: Updated Bulgarian translation (4875t) l10n: Update Catalan translation l10n: sv.po: Update Swedish translation (4875t0f0u) l10n: vi(4875t): Updated Vietnamses translation for 2.27.0rd2 l10n: zh_CN: for git v2.27.0 l10n round 1~2 l10n: git.pot: v2.27.0 round 2 (+1) l10n: Update Catalan translation l10n: vi(4874t): Updated Vietnamses translation for 2.27.0 l10n: es: 2.27.0 round 1 l10n: bg.po: Updated Bulgarian translation (4868t) l10n: fr v2.27.0 rnd 1 l10n: sv.po: Update Swedish translation (4839t0f0u) l10n: tr: v2.27.0 round 1 ...
2020-05-31fast-import: add new --date-format=raw-permissive formatLibravatar Elijah Newren3-5/+57
There are multiple repositories in the wild with random, invalid timezones. Most notably is a commit from rails.git with a timezone of "+051800"[1]. A few searches will find other repos with that same invalid timezone as well. Further, Peff reports that GitHub relaxed their fsck checks in August 2011 to accept any timezone value[2], and there have been multiple reports to filter-repo about fast-import crashing while trying to import their existing repositories since they had timezone values such as "-7349423" and "-43455309"[3]. The existing check on timezone values inside fast-import may prove useful for people who are crafting fast-import input by hand or with a new script. For them, the check may help them avoid accidentally recording invalid dates. (Note that this check is rather simplistic and there are still several forms of invalid dates that fast-import does not check for: dates in the future, timezone values with minutes that are not divisible by 15, and timezone values with minutes that are 60 or greater.) While this simple check may have some value for those users, other users or tools will want to import existing repositories as-is. Provide a --date-format=raw-permissive format that will not error out on these otherwise invalid timezones so that such existing repositories can be imported. [1] https://github.com/rails/rails/commit/4cf94979c9f4d6683c9338d694d5eb3106a4e734 [2] https://lore.kernel.org/git/20200521195513.GA1542632@coredump.intra.peff.net/ [3] https://github.com/newren/git-filter-repo/issues/88 Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-05-30Merge branch 'master' of github.com:ruester/git-po-deLibravatar Jiang Xin1-3445/+3685
* 'master' of github.com:ruester/git-po-de: l10n: de.po: Fix typo in the German translation of octopus l10n: de.po: Update German translation for Git 2.27.0
2020-05-30Merge branch of github.com:AlessandroMenti/git-poLibravatar Jiang Xin1-122/+129
* 'update-italian-translation' of github.com:AlessandroMenti/git-po: l10n: it.po: update for Git 2.27.0 round #2
2020-05-29Merge branch 'bc/sha-256-part-1-of-4'Libravatar Junio C Hamano1-1/+1
Docfix. * bc/sha-256-part-1-of-4: Documentation: correct hash environment variable
2020-05-29Merge branch 'ma/rev-list-options-docfix'Libravatar Junio C Hamano1-16/+19
Docfix. * ma/rev-list-options-docfix: rev-list-options.txt: start a list for `show-pulls`
2020-05-29Merge branch 'jk/ci-only-on-selected-branches'Libravatar Junio C Hamano1-2/+3
Dev support. * jk/ci-only-on-selected-branches: ci/config: correct instruction for CI preferences
2020-05-29t: avoid alternation (not POSIX) in grep's BRELibravatar Carlo Marcelo Arenas Belón2-2/+2
f1e3df3169 (t: increase test coverage of signature verification output, 2020-03-04) adds GPG dependent tests to t4202 and t6200 that were found problematic with at least OpenBSD 6.7. Using an escaped '|' for alternations works only in some implementations of grep (e.g. GNU and busybox). It is not part of POSIX[1] and not supported by some BSD, macOS, and possibly other POSIX compatible implementations. Use `grep -E`, and write it using extended regular expression. [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03 Helped-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-05-30l10n: zh_TW.po: v2.27.0 round 2 (0 untranslated)Libravatar Yi-Jyun Pan1-103/+107
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2020-05-30l10n: zh_TW.po: v2.27.0 round 1 (0 untranslated)Libravatar Yi-Jyun Pan1-3587/+4088
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2020-05-29l10n: de.po: Fix typo in the German translation of octopusLibravatar Jan Engelhardt1-1/+1
Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2020-05-29l10n: de.po: Update German translation for Git 2.27.0Libravatar Matthias Rüster1-3444/+3684
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2020-05-28completion: use native ZSH array pattern matchingLibravatar Marco Trevisan (Treviño)1-1/+1
When clearing the builtin operations on re-sourcing in the ZSH case we can use the native ${parameters} associative array keys values to get the currently `__gitcomp_builtin_*` operations using pattern matching instead of using sed. As also stated in commit 94408dc7, introducing this change the usage of sed has some overhead implications, while ZSH can do this check just using its native syntax. Signed-off-by: Marco Trevisan (Treviño) <mail@3v1n0.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-05-28l10n: it.po: update for Git 2.27.0 round #2Libravatar Alessandro Menti1-122/+129
Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
2020-05-28Merge branch 'fr_2.27.0rnd2' of github.com:jnavila/gitLibravatar Jiang Xin1-103/+107
* 'fr_2.27.0rnd2' of github.com:jnavila/git: l10n: fr.po v2.27.0 rnd 2
2020-05-28Merge branch 'master' of github.com:bitigchi/git-poLibravatar Jiang Xin1-114/+116
* 'master' of github.com:bitigchi/git-po: l10n: tr: v2.27.0 round 2