summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-21remote-mediawiki tests: use inline PerlIO for readabilityLibravatar Ævar Arnfjörð Bjarmason1-4/+3
Replace the use of the "open" pragma with a three-arg open in the places that actually care about UTF-8, while leaving those that don't (the config parsing). Unlike the previous "encoding" pragma change this isn't needed for compatibility with anything. I just think it's easier to read code that has localized effects than code that changes global settings. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-21remote-mediawiki tests: replace deprecated Perl constructLibravatar Ævar Arnfjörð Bjarmason1-2/+1
The use of the encoding pragma has been a hard error since Perl 5.18 (released in 2013). What this script really wanted to do was to decode @ARGV and write out some files with the UTF-8 PerlIO layer. Let's just do that explicitly instead. This explicitly does not retain the previous UTF-8 semantics of the script. The "encoding" pragma had all sorts of global effects (program text being UTF-8, stdin/stdout etc.). But the only thing that was required was decoding @ARGV and writing out UTF-8 data, which is currently facilitated with the "open" pragma. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-21remote-mediawiki tests: use a more idiomatic dispatch tableLibravatar Ævar Arnfjörð Bjarmason1-7/+7
Change the dispatch table code in test-gitmw.pl to use a hash where subroutine references are the values. This is more obvious than a hash where the values are strings we'll use to go searching around in the symbol table for the function. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-21remote-mediawiki tests: use "$dir/" instead of "$dir."Libravatar Ævar Arnfjörð Bjarmason1-3/+3
Change UI messages to use "$dir/" instead of "$dir.". I think this is less confusing when referring to an absolute directory path. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-21remote-mediawiki tests: change `[]` to `test`Libravatar Ævar Arnfjörð Bjarmason1-6/+11
Convert `[]` to `test` and break if-then into separate lines, both of which bring the style in line with Git's coding guidelines. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-21remote-mediawiki tests: use test_cmp in testsLibravatar Ævar Arnfjörð Bjarmason1-4/+4
Change code that used an ad-hoc "diff -b" invocation to use our test_cmp helper instead. I'm also changing the order of arguments to be the standard "test_cmp <expected> <actual>". Using test_cmp has different semantics since the "-b" option to diff causes it to ignore whitespace, but in these cases the use of "-b" was just meaningless boilerplate. The desired semantics here are to compare "git log" lines with know-good data, so we don't want to ignore whitespace. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-21remote-mediawiki tests: use a 10 character passwordLibravatar Ævar Arnfjörð Bjarmason1-1/+1
In more recent versions of MediaWiki this is a requirement, e.g. the current stable version of 1.32.2. The web installer now refuses our old 9 character password, the command-line one (will be used in a subsequent change) will accept it, but trying to use it in the web UI will emit an error asking the user to reset the password. Let's use a password that'll just work and allow us to log in as the admin user. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-21remote-mediawiki tests: use the login/password variablesLibravatar Ævar Arnfjörð Bjarmason1-2/+2
Change a hardcoded user/password for the corresponding variable defined in contrib/mw-to-git/t/test.config. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-21remote-mediawiki doc: don't hardcode Debian PHP versionsLibravatar Ævar Arnfjörð Bjarmason1-5/+5
Change the hardcoded version 5 PHP versions to the version-agnostic packages. Currently Debian stable's version is 7.3, and there's a php7.3, php7.3-cli etc. package available (but no php5-*). The corresponding version-less package is a dependency package which depends on whatever the current stable version is. By not hardcoding the version these instructions won't be out of date when the next Debian/Ubuntu release happens. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-16remote-mediawiki doc: link to MediaWiki's current versionLibravatar Ævar Arnfjörð Bjarmason1-0/+3
Amend a comment in the test.config file to point to the latest upstream version, which makes it easier for the user to tweak this. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-16remote-mediawiki doc: correct link to GitHub projectLibravatar Ævar Arnfjörð Bjarmason3-3/+3
Change the link to the canonical one, the old link redirects to the new one. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09Fourteenth batchLibravatar Junio C Hamano1-0/+28
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09Merge branch 'os/vcbuild'Libravatar Junio C Hamano4-4/+5
Fix build procedure for MSVC. * os/vcbuild: contrib/buildsystems: fix expat library name for generated vcxproj vcbuild: fix batch file name in README vcbuild: fix library name for expat with make MSVC=1
2020-09-09Merge branch 'jt/interpret-branch-name-fallback'Libravatar Junio C Hamano20-53/+98
"git status" has trouble showing where it came from by interpreting reflog entries that recordcertain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error to allow "status" show its output. * jt/interpret-branch-name-fallback: wt-status: tolerate dangling marks refs: move dwim_ref() to header file sha1-name: replace unsigned int with option struct
2020-09-09Merge branch 'js/ci-squelch-false-failure'Libravatar Junio C Hamano1-3/+2
CI noise reduction. * js/ci-squelch-false-failure: ci: avoid ugly "failure" in the `ci-config` job ci: fix indentation of the `ci-config` job
2020-09-09Merge branch 'pb/imap-send-updates'Libravatar Junio C Hamano1-15/+19
"git imap-send" updates. * pb/imap-send-updates: git-imap-send.txt: add note about localized Gmail folders git-imap-send.txt: do verify SSL certificate for gmail.com git-imap-send.txt: don't duplicate 'Examples' sections
2020-09-09Merge branch 'hv/ref-filter-misc'Libravatar Junio C Hamano5-65/+161
The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * hv/ref-filter-misc: ref-filter: add `sanitize` option for 'subject' atom pretty: refactor `format_sanitized_subject()` ref-filter: add `short` modifier to 'parent' atom ref-filter: add `short` modifier to 'tree' atom ref-filter: rename `objectname` related functions and fields ref-filter: modify error messages in `grab_objectname()` ref-filter: refactor `grab_objectname()` ref-filter: support different email formats
2020-09-09Merge branch 'ss/submodule-summary-in-c-fixes'Libravatar Junio C Hamano2-10/+9
Fixups to a topic in 'next'. * ss/submodule-summary-in-c-fixes: t7421: eliminate 'grep' check in t7421.4 for mingw compatibility submodule: fix style in function definition submodule: eliminate unused parameters from print_submodule_summary()
2020-09-09Merge branch 'so/separate-field-for-m-and-diff-merges'Libravatar Junio C Hamano3-8/+9
Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. * so/separate-field-for-m-and-diff-merges: revision: add separate field for "-m" of "diff-index -m"
2020-09-09Merge branch 'es/worktree-repair'Libravatar Junio C Hamano7-2/+445
"git worktree" gained a "repair" subcommand to help users recover after moving the worktrees or repository manually without telling Git. Also, "git init --separate-git-dir" no longer corrupts administrative data related to linked worktrees. * es/worktree-repair: init: make --separate-git-dir work from within linked worktree init: teach --separate-git-dir to repair linked worktrees worktree: teach "repair" to fix outgoing links to worktrees worktree: teach "repair" to fix worktree back-links to main worktree worktree: add skeleton "repair" command
2020-09-09Merge branch 'jk/worktree-check-clean-leakfix'Libravatar Junio C Hamano1-5/+3
Leakfix. * jk/worktree-check-clean-leakfix: worktree: fix leak in check_clean_worktree()
2020-09-09Merge branch 'tb/repack-clearing-midx'Libravatar Junio C Hamano5-11/+65
When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. * tb/repack-clearing-midx: midx: traverse the local MIDX first builtin/repack.c: invalidate MIDX only when necessary
2020-09-09Merge branch 'ss/submodule-summary-in-c'Libravatar Junio C Hamano7-195/+512
Yet another subcommand of "git submodule" is getting rewritten in C. * ss/submodule-summary-in-c: submodule: port submodule subcommand 'summary' from shell to C t7421: introduce a test script for verifying 'summary' output submodule: rename helper functions to avoid ambiguity submodule: remove extra line feeds between callback struct and macro
2020-09-08contrib/buildsystems: fix expat library name for generated vcxprojLibravatar Orgad Shaneh2-1/+2
expat.lib -> libexpat.lib (libexpatd.lib for debug build). Signed-off-by: Orgad Shaneh <orgads@gmail.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-03Thirteenth batchLibravatar Junio C Hamano1-0/+26
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-03Merge branch 'pb/doc-external-diff-env'Libravatar Junio C Hamano2-3/+5
Doc update. * pb/doc-external-diff-env: git.txt: correct stale 'GIT_EXTERNAL_DIFF' description
2020-09-03Merge branch 'jk/xrealloc-avoid-use-after-free'Libravatar Junio C Hamano1-2/+5
It was possible for xrealloc() to send a non-NULL pointer that has been freed, which has been fixed. * jk/xrealloc-avoid-use-after-free: xrealloc: do not reuse pointer freed by zero-length realloc()
2020-09-03Merge branch 'jc/post-checkout-doc'Libravatar Junio C Hamano1-1/+3
Doc update. * jc/post-checkout-doc: doc: clarify how exit status of post-checkout hook is used
2020-09-03Merge branch 'pb/doc-sequence-editor-configuration'Libravatar Junio C Hamano2-0/+7
Doc update. * pb/doc-sequence-editor-configuration: doc: mention GIT_SEQUENCE_EDITOR and 'sequence.editor' more
2020-09-03Merge branch 'hl/bisect-doc-clarify-bad-good-ordering'Libravatar Junio C Hamano3-3/+3
Doc update. * hl/bisect-doc-clarify-bad-good-ordering: bisect: swap command-line options in documentation
2020-09-03Merge branch 'so/pretty-abbrev-doc'Libravatar Junio C Hamano1-2/+2
Documentation update for "--no-abbrev-commit". * so/pretty-abbrev-doc: pretty-options.txt: fix --no-abbrev-commit description
2020-09-03Merge branch 'mr/diff-hide-stat-wo-textual-change'Libravatar Junio C Hamano2-9/+67
"git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. * mr/diff-hide-stat-wo-textual-change: diff: teach --stat to ignore uninteresting modifications
2020-09-03Merge branch 'jt/lazy-fetch'Libravatar Junio C Hamano25-215/+278
Updates to on-demand fetching code in lazily cloned repositories. * jt/lazy-fetch: fetch: no FETCH_HEAD display if --no-write-fetch-head fetch-pack: remove no_dependents code promisor-remote: lazy-fetch objects in subprocess fetch-pack: do not lazy-fetch during ref iteration fetch: only populate existing_refs if needed fetch: avoid reading submodule config until needed fetch: allow refspecs specified through stdin negotiator/noop: add noop fetch negotiator
2020-09-03Merge branch 'jc/run-command-use-embedded-args'Libravatar Junio C Hamano4-19/+7
Various callers of run_command API has been modernized. * jc/run-command-use-embedded-args: run_command: teach API users to use embedded 'args' more
2020-09-03Merge branch 'jc/undash-in-tree-git-callers'Libravatar Junio C Hamano3-14/+14
A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. * jc/undash-in-tree-git-callers: credential-cache: use child_process.args cvsexportcommit: do not run git programs in dashed form transport-helper: do not run git-remote-ext etc. in dashed form
2020-09-03Merge branch 'jk/slimmed-down'Libravatar Junio C Hamano31-3915/+80
Trim an unused binary and turn a bunch of commands into built-in. * jk/slimmed-down: drop vcs-svn experiment make git-fast-import a builtin make git-bugreport a builtin make credential helpers builtins Makefile: drop builtins from MSVC pdb list
2020-09-03Merge branch 'pw/add-p-allowed-options-fix'Libravatar Junio C Hamano1-25/+42
"git add -p" update. * pw/add-p-allowed-options-fix: add -p: fix checking of user input add -p: use ALLOC_GROW_BY instead of ALLOW_GROW
2020-09-03Merge branch 'jt/fetch-pack-loosen-validation-with-packfile-uri'Libravatar Junio C Hamano5-1/+72
Bugfix for "git fetch" when the packfile URI capability is in use. * jt/fetch-pack-loosen-validation-with-packfile-uri: fetch-pack: make packfile URIs work with transfer.fsckobjects fetch-pack: document only_packfile in get_pack() (various): document from_promisor parameter
2020-09-03Merge branch 'ss/t7401-modernize'Libravatar Junio C Hamano1-73/+76
Test clean-up. * ss/t7401-modernize: t7401: add a NEEDSWORK t7401: change indentation for enhanced readability t7401: change syntax of test_i18ncmp calls for clarity t7401: use 'short' instead of 'verify' and cut in rev-parse calls t7401: modernize style
2020-09-03Merge branch 'pw/rebase-i-more-options'Libravatar Junio C Hamano11-49/+423
"git rebase -i" learns a bit more options. * pw/rebase-i-more-options: t3436: do not run git-merge-recursive in dashed form rebase: add --reset-author-date rebase -i: support --ignore-date rebase -i: support --committer-date-is-author-date am: stop exporting GIT_COMMITTER_DATE rebase -i: add --ignore-whitespace flag
2020-09-03vcbuild: fix batch file name in READMELibravatar Orgad Shaneh1-2/+2
Signed-off-by: Orgad Shaneh <orgads@gmail.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-03vcbuild: fix library name for expat with make MSVC=1Libravatar Orgad Shaneh1-1/+1
Signed-off-by: Orgad Shaneh <orgads@gmail.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-02wt-status: tolerate dangling marksLibravatar Jonathan Tan19-29/+60
When a user checks out the upstream branch of HEAD, the upstream branch not being a local branch, and then runs "git status", like this: git clone $URL client cd client git checkout @{u} git status no status is printed, but instead an error message: fatal: HEAD does not point to a branch (This error message when running "git branch" persists even after checking out other things - it only stops after checking out a branch.) This is because "git status" reads the reflog when determining the "HEAD detached" message, and thus attempts to DWIM "@{u}", but that doesn't work because HEAD no longer points to a branch. Therefore, when calculating the status of a worktree, tolerate dangling marks. This is done by adding an additional parameter to dwim_ref() and repo_dwim_ref(). Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-02refs: move dwim_ref() to header fileLibravatar Jonathan Tan2-6/+7
This makes it clear that dwim_ref() is just repo_dwim_ref() without the first parameter. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-02sha1-name: replace unsigned int with option structLibravatar Jonathan Tan4-21/+34
In preparation for a future patch adding a boolean parameter to repo_interpret_branch_name(), which might be easily confused with an existing unsigned int parameter, refactor repo_interpret_branch_name() to take an option struct instead of the unsigned int parameter. The static function interpret_branch_mark() is also updated to take the option struct in preparation for that future patch, since it will also make use of the to-be-introduced boolean parameter. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-02fetch: no FETCH_HEAD display if --no-write-fetch-headLibravatar Jonathan Tan3-11/+22
887952b8c6 ("fetch: optionally allow disabling FETCH_HEAD update", 2020-08-18) introduced the ability to disable writing to FETCH_HEAD during fetch, but did not suppress the "<source> -> FETCH_HEAD" message when this ability is used. This message is misleading in this case, because FETCH_HEAD is not written. Also, because "fetch" is used to lazy-fetch missing objects in a partial clone, this significantly clutters up the output in that case since the objects to be fetched are potentially numerous. Therefore, suppress this message when --no-write-fetch-head is passed (but not when --dry-run is set). Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-02ci: avoid ugly "failure" in the `ci-config` jobLibravatar Johannes Schindelin1-2/+1
In the common case where users have _not_ pushed a `ci-config` branch to configure which branches should be included in the GitHub workflow runs, there is a big fat ugly annotation about a failure in the run's log: X Check failure on line 1 in .github @github-actions github-actions / ci-config .github#L1 Process completed with exit code 128. The reason is that the `ci-config` job tries to clone that `ci-config` branch, and even if it is configured to continue on error, the annotation is displayed, and it is distracting. Let's just handle this on the shell script level, so that the job's step is not marked as a failure. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-02ci: fix indentation of the `ci-config` jobLibravatar Johannes Schindelin1-2/+2
The section added in e76eec35540f (ci: allow per-branch config for GitHub Actions, 2020-05-07) contains a `&&`-chain that connects several commands. The first command is actually so long that it stretches over multiple lines, and as per usual, the continuation lines are indented one more level than the first. However, the subsequent commands in the `&&`-chain were also indented one more level than the first command, which was almost certainly unintended. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-02xrealloc: do not reuse pointer freed by zero-length realloc()Libravatar Jeff King1-2/+5
This patch fixes a bug where xrealloc(ptr, 0) can double-free and corrupt the heap on some platforms (including at least glibc). The C99 standard says of malloc (section 7.20.3): If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object. So we might get NULL back, or we might get an actual pointer (but we're not allowed to look at its contents). To simplify our code, our xmalloc() handles a NULL return by converting it into a single-byte allocation. That way callers get consistent behavior. This was done way back in 4e7a2eccc2 (?alloc: do not return NULL when asked for zero bytes, 2005-12-29). We also gave xcalloc() and xrealloc() the same treatment. And according to C99, that is fine; the text above is in a paragraph that applies to all three. But what happens to the memory we passed to realloc() in such a case? I.e., if we do: ret = realloc(ptr, 0); and "ptr" is non-NULL, but we get NULL back, is "ptr" still valid? C99 doesn't cover this case specifically, but says (section 7.20.3.4): The realloc function deallocates the old object pointed to by ptr and returns a pointer to a new object that has the size specified by size. So "ptr" is now deallocated, and we must only look at "ret". And since "ret" is NULL, that means we have no allocated object at all. But that's not quite the whole story. It also says: If memory for the new object cannot be allocated, the old object is not deallocated and its value is unchanged. [...] The realloc function returns a pointer to the new object (which may have the same value as a pointer to the old object), or a null pointer if the new object could not be allocated. So if we see a NULL return with a non-zero size, we can expect that the original object _is_ still valid. But with a non-zero size, it's ambiguous. The NULL return might mean a failure (in which case the object is valid), or it might mean that we successfully allocated nothing, and used NULL to represent that. The glibc manpage for realloc() explicitly says: [...]if size is equal to zero, and ptr is not NULL, then the call is equivalent to free(ptr). Likewise, this StackOverflow answer: https://stackoverflow.com/a/2135302 claims that C89 gave similar guidance (but I don't have a copy to verify it). A comment on this answer: https://stackoverflow.com/a/2022410 claims that Microsoft's CRT behaves the same. But our current "retry with 1 byte" code passes the original pointer again. So on glibc, we effectively free() the pointer and then try to realloc() it again, which is undefined behavior. The simplest fix here is to just pass "ret" (which we know to be NULL) to the follow-up realloc(). But that means that a system which _doesn't_ free the original pointer would leak it. It's not clear if any such systems exist, and that interpretation of the standard seems unlikely (I'd expect a system that doesn't deallocate to simply return the original pointer in this case). But it's easy enough to err on the safe side, and just never pass a zero size to realloc() at all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-01git.txt: correct stale 'GIT_EXTERNAL_DIFF' descriptionLibravatar Philippe Blain2-3/+5
In fde97d8ac6 (Update documentation to remove incorrect GIT_DIFF_OPTS example., 2006-11-27), the description of the 'GIT_EXTERNAL_DIFF' variable was moved from 'diff-format.txt' to 'git.txt', and the documentation was updated to remove a 'diff(1)' invocation since Git did not use an external diff program anymore by default. However, the description of 'GIT_EXTERNAL_DIFF' still mentions "instead of the diff invocation described above", which is confusing. Correct that outdated sentence. Also, link to git(1) in 'diff-generate-patch.txt' when GIT_DIFF_OPTS and GIT_EXTERNAL_DIFF are mentioned, so that users can easily know what these variables are about. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>