summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-11-21Merge branch 'pd/mergetool-nvimdiff'Libravatar Junio C Hamano2-0/+5
Fix regression introduced when nvimdiff support in mergetool was added. * pd/mergetool-nvimdiff: mergetool: avoid letting `list_tool_variants` break user-defined setups mergetools/bc: add `bc4` to the alias list for Beyond Compare
2020-11-21Merge branch 'ab/config-mak-uname-simplify'Libravatar Junio C Hamano1-8/+0
Build configuration cleanup. * ab/config-mak-uname-simplify: config.mak.uname: remove unused NEEDS_SSL_WITH_CURL flag config.mak.uname: remove unused the NO_R_TO_GCC_LINKER flag
2020-11-21Merge branch 'en/strmap'Libravatar Junio C Hamano27-170/+621
A specialization of hashmap that uses a string as key has been introduced. Hopefully it will see wider use over time. * en/strmap: shortlog: use strset from strmap.h Use new HASHMAP_INIT macro to simplify hashmap initialization strmap: take advantage of FLEXPTR_ALLOC_STR when relevant strmap: enable allocations to come from a mem_pool strmap: add a strset sub-type strmap: split create_entry() out of strmap_put() strmap: add functions facilitating use as a string->int map strmap: enable faster clearing and reusing of strmaps strmap: add more utility functions strmap: new utility functions hashmap: provide deallocation function names hashmap: introduce a new hashmap_partial_clear() hashmap: allow re-use after hashmap_free() hashmap: adjust spacing to fix argument alignment hashmap: add usage documentation explaining hashmap_free[_entries]()
2020-11-21Merge branch 'jk/diff-release-filespec-fix'Libravatar Junio C Hamano2-0/+16
Running "git diff" while allowing external diff in a state with unmerged paths used to segfault, which has been corrected. * jk/diff-release-filespec-fix: t7800: simplify difftool test diff: allow passing NULL to diff_free_filespec_data()
2020-11-21Merge branch 'jk/rev-parse-end-of-options'Libravatar Junio C Hamano4-47/+99
"git rev-parse" learned the "--end-of-options" to help scripts to safely take a parameter that is supposed to be a revision, e.g. "git rev-parse --verify -q --end-of-options $rev". * jk/rev-parse-end-of-options: rev-parse: handle --end-of-options rev-parse: put all options under the "-" check rev-parse: don't accept options after dashdash
2020-11-21Merge branch 'jc/format-patch-name-max'Libravatar Junio C Hamano7-8/+83
The maximum length of output filenames "git format-patch" creates has become configurable (used to be capped at 64). * jc/format-patch-name-max: format-patch: make output filename configurable
2020-11-18Sixth batchLibravatar Junio C Hamano1-0/+35
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-18Merge branch 'jc/blame-ignore-fix'Libravatar Junio C Hamano2-4/+5
"git blame --ignore-revs-file=<file>" learned to ignore a non-existent object name in the input, instead of complaining. * jc/blame-ignore-fix: blame: silently ignore invalid ignore file objects
2020-11-18Merge branch 'jc/sparse-error-for-developer-build'Libravatar Junio C Hamano1-0/+1
"make DEVELOPER=1 sparse" used to run sparse and let it emit warnings; now such warnings will cause an error. * jc/sparse-error-for-developer-build: Makefile: enable -Wsparse-error for DEVELOPER build
2020-11-18Merge branch 'pb/blame-funcname-range-userdiff'Libravatar Junio C Hamano12-72/+79
"git blame -L :funcname -- path" did not work well for a path for which a userdiff driver is defined. * pb/blame-funcname-range-userdiff: blame: simplify 'setup_blame_bloom_data' interface blame: simplify 'setup_scoreboard' interface blame: enable funcname blaming with userdiff driver line-log: mention both modes in 'blame' and 'log' short help doc: add more pointers to gitattributes(5) for userdiff blame-options.txt: also mention 'funcname' in '-L' description doc: line-range: improve formatting doc: log, gitk: move '-L' description to 'line-range-options.txt'
2020-11-18Merge branch 'en/merge-ort-api-null-impl'Libravatar Junio C Hamano13-15/+517
Preparation for a new merge strategy. * en/merge-ort-api-null-impl: merge,rebase,revert: select ort or recursive by config or environment fast-rebase: demonstrate merge-ort's API via new test-tool command merge-ort-wrappers: new convience wrappers to mimic the old merge API merge-ort: barebones API of new merge strategy with empty implementation
2020-11-18Merge branch 'ds/maintenance-part-3'Libravatar Junio C Hamano17-8/+759
Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. * ds/maintenance-part-3: maintenance: add troubleshooting guide to docs maintenance: use 'incremental' strategy by default maintenance: create maintenance.strategy config maintenance: add start/stop subcommands maintenance: add [un]register subcommands for-each-repo: run subcommands on configured repos maintenance: add --schedule option and config maintenance: optionally skip --auto process
2020-11-18Merge branch 'pw/rebase-i-orig-head'Libravatar Junio C Hamano4-22/+31
"git rebase -i" did not store ORIG_HEAD correctly. * pw/rebase-i-orig-head: rebase -i: simplify get_revision_ranges() rebase -i: use struct object_id when writing state rebase -i: use struct object_id rather than looking up commit rebase -i: stop overwriting ORIG_HEAD buffer
2020-11-18Merge branch 'rs/archive-high-compression'Libravatar Junio C Hamano3-16/+14
"git archive" now allows compression level higher than "-9" when generating tar.gz output. * rs/archive-high-compression: archive: support compression levels beyond 9
2020-11-18Merge branch 'dg/bswap-msvc'Libravatar Junio C Hamano1-1/+1
Define ARM64 compiled with MSVC to be little-endian. * dg/bswap-msvc: compat/bswap.h: don't assume MSVC is little-endian compat/bswap.h: simplify MSVC endianness detection
2020-11-18Merge branch 'jk/format-patch-output'Libravatar Junio C Hamano2-15/+55
"git format-patch --output=there" did not work as expected and instead crashed. The option is now supported. * jk/format-patch-output: format-patch: support --output option format-patch: tie file-opening logic to output_directory format-patch: refactor output selection
2020-11-18Merge branch 'jc/line-log-takes-no-pathspec'Libravatar Junio C Hamano2-0/+25
"git log -L<range>:<path>" is documented to take no pathspec, but this was not enforced by the command line option parser, which has been corrected. * jc/line-log-takes-no-pathspec: log: diagnose -L used with pathspec as an error
2020-11-18Merge branch 'rs/empty-reflog-check-fix'Libravatar Junio C Hamano1-14/+13
The code to see if "git stash drop" can safely remove refs/stash has been made more carerful. * rs/empty-reflog-check-fix: stash: simplify reflog emptiness check
2020-11-18Merge branch 'nk/perf-fsmonitor'Libravatar Junio C Hamano1-31/+63
Add t/perf support for fsmonitor. * nk/perf-fsmonitor: t/perf/fsmonitor: add benchmark for dirty status t/perf/fsmonitor: perf comparison of multiple fsmonitor integrations t/perf/fsmonitor: initialize test with git reset t/perf/fsmonitor: factor setup for fsmonitor into function t/perf/fsmonitor: silence initial git commit t/perf/fsmonitor: shorten DESC to basename t/perf/fsmonitor: factor description out for readability t/perf/fsmonitor: improve error message if typoing hook name t/perf/fsmonitor: move watchman setup to one-time-repo-setup t/perf/fsmonitor: separate one time repo initialization
2020-11-18Merge branch 'en/merge-tests'Libravatar Junio C Hamano13-386/+807
Preparation for a new merge strategy. * en/merge-tests: t6423: add more details about direct resolution of directories t6423: note improved ort handling with untracked files t6423, t6436: note improved ort handling with dirty files merge tests: expect slight differences in output for recursive vs. ort t6423: expect improved conflict markers labels in the ort backend t6404, t6423: expect improved rename/delete handling in ort backend t6416: correct expectation for rename/rename(1to2) + directory/file merge tests: expect improved directory/file conflict handling in ort t/: new helper for tests that pass with ort but fail with recursive
2020-11-18Merge branch 'js/default-branch-name-adjust-t5515'Libravatar Junio C Hamano128-305/+308
Prepare a test script to transition of the default branch name to 'main'. * js/default-branch-name-adjust-t5515: t5515: use `main` as the name of the main branch for testing (conclusion) t5515: use `main` as the name of the main branch for testing (part 3) t5515: use `main` as the name of the main branch for testing (part 2) t5515: use `main` as the name of the main branch for testing (part 1)
2020-11-18Merge branch 'dd/upload-pack-stateless-eof'Libravatar Junio C Hamano2-1/+29
"git fetch --depth=<n>" over the stateless RPC / smart HTTP transport handled EOF from the client poorly at the server end. * dd/upload-pack-stateless-eof: upload-pack: allow stateless client EOF just prior to haves
2020-11-11Fifth batchLibravatar Junio C Hamano1-0/+22
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11Merge branch 'jc/sequencer-stopped-sha-simplify'Libravatar Junio C Hamano1-1/+1
Recently the format of an internal state file "rebase -i" uses has been tightened up for consistency, which would hurt those who start "rebase -i" with old git and then continue with new git. Loosen the reader side a bit (which we may want to tighten again in a year or so). * jc/sequencer-stopped-sha-simplify: sequencer: tolerate abbreviated stopped-sha file
2020-11-11Merge branch 'js/test-file-size'Libravatar Junio C Hamano5-42/+24
Test clean-up. * js/test-file-size: tests: consolidate the `file_size` function into `test-lib-functions.sh`
2020-11-11Merge branch 'js/ci-github-set-env'Libravatar Junio C Hamano1-1/+1
CI update. * js/ci-github-set-env: ci: avoid using the deprecated `set-env` construct
2020-11-11Merge branch 'js/p4-default-branch'Libravatar Junio C Hamano1-1/+1
"git p4" now honors init.defaultBranch configuration. * js/p4-default-branch: p4: respect init.defaultBranch
2020-11-11Merge branch 'js/test-whitespace-fixes'Libravatar Junio C Hamano7-112/+113
Test code clean-up. * js/test-whitespace-fixes: t9603: use tabs for indentation t5570: remove trailing padding t5400,t5402: consistently indent with tabs, not with spaces t3427: adjust stale comment t3406: indent with tabs, not spaces t1004: insert missing "branch" in a message
2020-11-11Merge branch 'mc/typofix'Libravatar Junio C Hamano4-4/+4
Docfix. * mc/typofix: doc: fixing two trivial typos in Documentation/
2020-11-11Merge branch 'jc/abbrev-doc'Libravatar Junio C Hamano6-11/+18
The documentation on the "--abbrev=<n>" option did not say the output may be longer than "<n>" hexdigits, which has been clarified. * jc/abbrev-doc: doc: clarify that --abbrev=<n> is about the minimum length
2020-11-11Merge branch 'cw/ci-ghwf-check-ws-errors'Libravatar Junio C Hamano1-2/+4
Dev support update. * cw/ci-ghwf-check-ws-errors: ci: make the whitespace checker more robust
2020-11-11Merge branch 'rs/worktree-list-show-locked'Libravatar Junio C Hamano1-1/+1
Typofix. * rs/worktree-list-show-locked: t2402: fix typo
2020-11-11Merge branch 'rs/pack-write-hashwrite-simplify'Libravatar Junio C Hamano1-3/+1
Code clean-up. * rs/pack-write-hashwrite-simplify: pack-write: use hashwrite_be32() instead of double-buffering array
2020-11-11Merge branch 'sd/prompt-local-variable'Libravatar Junio C Hamano1-0/+1
Code clean-up. * sd/prompt-local-variable: git-prompt.sh: localize `option` in __git_ps1_show_upstream
2020-11-11Merge branch 'rs/clear-commit-marks-in-repo'Libravatar Junio C Hamano5-8/+9
Code clean-up. * rs/clear-commit-marks-in-repo: bisect: clear flags in passed repository object: allow clear_commit_marks_all to handle any repo
2020-11-11Merge branch 'so/format-patch-doc-on-default-diff-format'Libravatar Junio C Hamano1-3/+6
Docfix. * so/format-patch-doc-on-default-diff-format: doc/diff-options: fix out of place mentions of '--patch/-p'
2020-11-11mergetool: avoid letting `list_tool_variants` break user-defined setupsLibravatar Johannes Schindelin1-0/+4
In 83bbf9b92ea8 (mergetool--lib: improve support for vimdiff-style tool variants, 2020-07-29), we introduced a `list_tool_variants` function in the spirit of Postel's Law: be lenient in what you accept as input. In this particular instance, we wanted to allow not only `bc` but also `bc3` as name for the Beyond Compare tool. However, what this patch overlooked is that it is totally allowed for users to override the defaults in `mergetools/`. But now that we strip off trailing digits, the name that the user gave the tool might not actually be in the list produced by `list_tool_variants`. So let's do the same as for the `diff_cmd` and the `merge_cmd`: override it with the trivial version in case a user-defined setup was detected. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11mergetools/bc: add `bc4` to the alias list for Beyond CompareLibravatar Johannes Schindelin1-0/+1
As of 83bbf9b92ea8 (mergetool--lib: improve support for vimdiff-style tool variants, 2020-07-29), we already list `bc` and `bc3` as aliases for that mergetool/difftool. However, the current Beyond Compare version is _4_, therefore the `bc4` alias is missing from that list. Most notably, this is the root cause of the breakage reported in https://github.com/git-for-windows/git/issues/2893 where a well-configured `bc4` difftool stopped working as of v2.29.0: `setup_tool` would notice that after stripping off the trailing digit, it finds a match in `mergetools/` (the `bc` file), source it, and then the alias would not match the list offered by the `list_tool_variants` function, and simply exit without doing anything, but pretending success. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11shortlog: use strset from strmap.hLibravatar Elijah Newren1-57/+4
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11Use new HASHMAP_INIT macro to simplify hashmap initializationLibravatar Elijah Newren6-38/+16
Now that hashamp has lazy initialization and a HASHMAP_INIT macro, hashmaps allocated on the stack can be initialized without a call to hashmap_init() and in some cases makes the code a bit shorter. Convert some callsites over to take advantage of this. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11strmap: take advantage of FLEXPTR_ALLOC_STR when relevantLibravatar Elijah Newren2-16/+20
By default, we do not use a mempool and strdup_strings is true; in this case, we can avoid both an extra allocation and an extra free by just over-allocating for the strmap_entry leaving enough space at the end to copy the key. FLEXPTR_ALLOC_STR exists for exactly this purpose, so make use of it. Also, adjust the case when we are using a memory pool and strdup_strings is true to just do one allocation from the memory pool instead of two so that the strmap_clear() and strmap_remove() code can just avoid freeing the key in all cases. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11strmap: enable allocations to come from a mem_poolLibravatar Elijah Newren2-12/+30
For heavy users of strmaps, allowing the keys and entries to be allocated from a memory pool can provide significant overhead savings. Add an option to strmap_init_with_options() to specify a memory pool. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11config.mak.uname: remove unused NEEDS_SSL_WITH_CURL flagLibravatar Ævar Arnfjörð Bjarmason1-5/+0
The NEEDS_SSL_WITH_CURL flag was still being set in one case, but hasn't existed since 23c4bbe28e6 ("build: link with curl-defined linker flags", 2018-11-03). Remove it, and a comment which referred to it. See 6c109904bc8 ("Port to HP NonStop", 2012-09-19) for the initial addition of the comment. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11config.mak.uname: remove unused the NO_R_TO_GCC_LINKER flagLibravatar Ævar Arnfjörð Bjarmason1-3/+0
The NO_R_TO_GCC_LINKER flag was still being on some platforms. It hasn't been used since my 0f50c8e32c8 ("Makefile: remove the NO_R_TO_GCC_LINKER flag", 2019-05-17). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11compat/bswap.h: don't assume MSVC is little-endianLibravatar Daniel Gurney1-1/+1
In 1af265f0 (compat/bswap.h: simplify MSVC endianness detection, 2020-11-08) we attempted to simplify code by assuming MSVC builds will be for little-endian machines, since only unusably old versions of MSVC supported big-endian MIPS and m68k architectures. However, it's possible that MSVC could be ported to build for a big-endian architecture again, so the simplification wasn't as future-proof as hoped. So let's go back to the old way of detecting MSVC, and then checking architecture from a list of little-endian architecture macros. Note that MSVC does not treat ARM64 as bi-endian, so we can safely treat it as little-endian. Helped-by: brian m. carlson <sandals@crustytoothpaste.net> Helped-by: Jeff King <peff@peff.net> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Daniel Gurney <dgurney99@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11t7800: simplify difftool testLibravatar Jinoh Kang1-19/+9
The new test added by the previous commit can be simplified a lot. Let's do so. Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Jinoh Kang <luke1337@theori.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-10rev-parse: handle --end-of-optionsLibravatar Jeff King4-25/+68
We taught rev-list a new way to separate options from revisions in 19e8789b23 (revision: allow --end-of-options to end option parsing, 2019-08-06), but rev-parse uses its own parser. It should know about --end-of-options not only for consistency, but because it may be presented with similarly ambiguous cases. E.g., if a caller does: git rev-parse "$rev" -- "$path" to parse an untrusted input, then it will get confused if $rev contains an option-like string like "--local-env-vars". Or even "--not-real", which we'd keep as an option to pass along to rev-list. Or even more importantly: git rev-parse --verify "$rev" can be confused by options, even though its purpose is safely parsing untrusted input. On the plus side, it will always fail the --verify part, as it will not have parsed a revision, so the caller will generally "fail closed" rather than continue to use the untrusted string. But it will still trigger whatever option was in "$rev"; this should be mostly harmless, since rev-parse options are all read-only, but I didn't carefully audit all paths. This patch lets callers write: git rev-parse --end-of-options "$rev" -- "$path" and: git rev-parse --verify --end-of-options "$rev" which will both treat "$rev" always as a revision parameter. The latter is a bit clunky. It would be nicer if we had defined "--verify" to require that its next argument be the revision. But we have not historically done so, and: git rev-parse --verify -q "$rev" does currently work. I added a test here to confirm that we didn't break that. A few implementation notes: - We don't document --end-of-options explicitly in commands, but rather in gitcli(7). So I didn't give it its own section in git-rev-parse(1). But I did call it out specifically in the --verify section, and include it in the examples, which should show best practices. - We don't have to re-indent the main option-parsing block, because we can combine our "did we see end of options" check with "does it start with a dash". The exception is the pre-setup options, which need their own block. - We do however have to pull the "--" parsing out of the "does it start with dash" block, because we want to parse it even if we've seen --end-of-options. - We'll leave "--end-of-options" in the output. This is probably not technically necessary, as a careful caller will do: git rev-parse --end-of-options $revs -- $paths and anything in $revs will be resolved to an object id. However, it does help a slightly less careful caller like: git rev-parse --end-of-options $revs_or_paths where a path "--foo" will remain in the output as long as it also exists on disk. In that case, it's helpful to retain --end-of-options to get passed along to rev-list, s it would otherwise see just "--foo". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-10rev-parse: put all options under the "-" checkLibravatar Jeff King1-24/+23
The option-parsing loop of rev-parse checks whether the first character of an arg is "-". If so, then it enters a series of conditionals checking for individual options. But some options are inexplicably outside of that outer conditional. This doesn't produce the wrong behavior; the conditional is actually redundant with the individual option checks, and it's really only its fallback "continue" that we care about. But we should at least be consistent. One obvious alternative is that we could get rid of the conditional entirely. But we'll be using the extra block it provides in the next patch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-10rev-parse: don't accept options after dashdashLibravatar Jeff King2-5/+15
Because of the order in which we check options in rev-parse, there are a few options we accept even after a "--". This is wrong, because the whole point of "--" is to say "everything after here is a path". Let's move the "did we see a dashdash" check (it's called "as_is" in the code) to the top of the parsing loop. Note there is one subtlety here. The options are ordered so that some are checked before we even see if we're in a repository (they continue the loop, and if we get past a certain point, then we do the repository setup). By moving the as_is check higher, it's also in that "before setup" section, even though it might look at the repository via verify_filename(). However, this works out: we'd never set as_is until we parse "--", and we don't parse that until after doing the setup. An alternative here to avoid the subtlety is to put the as_is check at the top of the post-setup options. But then every pre-setup option would have to remember to check "if (!as_is && !strcmp(...))". So while this is a bit magical, it's harder for future code to get wrong. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-10blame: silently ignore invalid ignore file objectsLibravatar René Scharfe2-4/+5
Since 610e2b9240 (blame: validate and peel the object names on the ignore list, 2020-09-24) git blame reports checks if objects specified with --ignore-rev and in files loaded with --ignore-revs-file and config option blame.ignoreRevsFile are actual objects and dies if they aren't. The intent is to report typos to the user. This also breaks the ability to use a single ignore file for multiple repositories. Typos are presumably less likely in files than on the command line, so alerting is less useful here. Restore that feature by skipping non-commits without dying. Reported-by: Jean-Yves Avenard <jyavenard@mozilla.com> Signed-off-by: René Scharfe <l.s.r@web.de> Reviewed-by: Barret Rhoden <brho@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>