summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-11-06apply: return -1 from option callback instead of calling exit(1)Libravatar Jeff King1-1/+1
The option callback for "apply --whitespace" exits with status "1" on error. It makes more sense for it to just return an error to parse-options. That code will exit, too, but it will use status "129" that is customary for option errors. The exit() dates back to aaf6c447aa (builtin/apply: make parse_whitespace_option() return -1 instead of die()ing, 2016-08-08). That commit gives no reason why we'd prefer the current exit status (it looks like it was just bumping the "die" up a level in the callstack, but did not go as far as it could have). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06cat-file: report an error on multiple --batch optionsLibravatar Jeff King1-1/+1
The options callback for --batch and --batch-check detects when the two mutually incompatible options are used. But it simply returns an error code to parse-options, meaning the program will quit without any kind of message to the user. Instead, let's use error() to print something and return -1. Note that this flips the error return from 1 to -1, but negative values are more idiomatic here (and parse-options treats them the same). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06tag: mark "--message" option with NONEGLibravatar Jeff King1-2/+2
We do not allow "--no-message" to work now, as the option callback returns "-1" when it sees a NULL arg. However, that will cause parse-options to exit(129) without printing anything further, leaving the user confused about what happened. Instead, let's explicitly mark it as PARSE_OPT_NONEG, which will give a useful error message (and print the usual -h output). In theory this could be used to override an earlier "-m", but it's not clear how it would interact with other message options (e.g., would it also clear data read for "-F"?). Since it's already disabled and nobody is asking for it, let's punt on that and just improve the error message. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06show-branch: mark --reflog option as NONEGLibravatar Jeff King1-1/+1
Running "git show-branch --no-reflog" will behave as if "--reflog" was given with no options, which makes no sense. In theory this option might be used to cancel an earlier "--reflog" option, but the semantics are not clear. Let's punt on it and just disallow the broken option. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06format-patch: mark "--no-numbered" option with NONEGLibravatar Jeff King1-1/+1
We have separate parse-options entries for "numbered" and "no-numbered", which means that we accept "--no-no-numbered". It does not behave sensibly, though (it ignores the "unset" flag and acts like "--no-numbered"). We could fix that, but obviously this is silly and unintentional. Let's just disallow it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06status: mark --find-renames option with NONEGLibravatar Jeff King1-1/+1
If you run "git status --no-find-renames", it will behave the same as "--find-renames", because we ignore the "unset" parameter (we see a NULL "arg", but since the score argument is optional, we just think that the user did not provide a score). We already have a separate "--no-renames" to disable renames, so there's not much point in supporting "--no-find-renames". Let's just flag it as an error. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06cat-file: mark batch options with NONEGLibravatar Jeff King1-2/+4
Running "cat-file --no-batch" will behave as if "--batch" was given, since the option callback does not handle the "unset" flag (likewise for "--no-batch-check"). In theory this might be used to cancel an earlier --batch, but it's not immediately obvious how that would interact with --batch-check. Let's just disallow the negated form of both options. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06pack-objects: mark index-version option as NONEGLibravatar Jeff King1-1/+1
Running "git pack-objects --no-index-version" will segfault, since the callback is not prepared to handle the "unset" flag. In theory this might be used to counteract an earlier "--index-version", or override a pack.indexversion config setting. But the semantics aren't immediately obvious, and it's unlikely anybody wants this. Let's just disable the broken option for now. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06ls-files: mark exclude options as NONEGLibravatar Jeff King1-3/+4
Running "git ls-files --no-exclude" will currently segfault, as its option callback does not handle the "unset" parameter. In theory this could be used to clear the exclude list, but it is not clear how that would interact with the other exclude options, nor is the current code capable of clearing the list. Let's just disable the broken option. Note that --no-exclude-from will similarly segfault, but --no-exclude-standard will not. It just silently does the wrong thing (pretending as if --exclude-standard was specified). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06am: handle --no-patch-format optionLibravatar Jeff King1-1/+3
Running "git am --no-patch-format" will currently segfault, since it tries to parse a NULL argument. Instead, let's have it cancel any previous --patch-format option. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-06apply: mark include/exclude options as NONEGLibravatar Jeff King1-2/+2
The options callback for "git apply --no-include" is not ready to handle the "unset" parameter, and as a result will segfault when it adds a NULL argument to the include list (likewise for "--no-exclude"). In theory this might be used to clear the list, but since both "--include" and "--exclude" add to the same list, it's not immediately obvious what the semantics should be. Let's punt on that for now and just disallow the broken options. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-03Merge branch 'jc/http-curlver-warnings'Libravatar Junio C Hamano1-4/+2
Warning message fix. * jc/http-curlver-warnings: http: give curl version warnings consistently
2018-11-03Merge branch 'js/mingw-http-ssl'Libravatar Junio C Hamano2-1/+91
On platforms with recent cURL library, http.sslBackend configuration variable can be used to choose a different SSL backend at runtime. The Windows port uses this mechanism to switch between OpenSSL and Secure Channel while talking over the HTTPS protocol. * js/mingw-http-ssl: http: when using Secure Channel, ignore sslCAInfo by default http: add support for disabling SSL revocation checks in cURL http: add support for selecting SSL backends at runtime
2018-11-03Merge branch 'mg/gpg-fingerprint'Libravatar Junio C Hamano5-18/+70
New "--pretty=format:" placeholders %GF and %GP that show the GPG key fingerprints have been invented. * mg/gpg-fingerprint: gpg-interface.c: obtain primary key fingerprint as well gpg-interface.c: support getting key fingerprint via %GF format gpg-interface.c: use flags to determine key/signer info presence
2018-11-03Merge branch 'mg/gpg-parse-tighten'Libravatar Junio C Hamano2-29/+87
Detect and reject a signature block that has more than one GPG signature. * mg/gpg-parse-tighten: gpg-interface.c: detect and reject multiple signatures on commits
2018-11-03Merge branch 'en/merge-cleanup-more'Libravatar Junio C Hamano2-7/+37
Further clean-up of merge-recursive machinery. * en/merge-cleanup-more: merge-recursive: avoid showing conflicts with merge branch before HEAD merge-recursive: improve auto-merging messages with path collisions
2018-11-02Eighth batch for 2.20Libravatar Junio C Hamano1-0/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-02rebase: apply cocci patchLibravatar Junio C Hamano1-1/+1
Favor oideq() over !oidcmp() when checking for equality. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-02Merge branch 'js/rebase-i-shortopt'Libravatar Junio C Hamano3-3/+6
"git rebase -i" learned to take 'b' as the short form of 'break' option in the todo list. * js/rebase-i-shortopt: rebase -i: recognize short commands without arguments
2018-11-02Merge branch 'js/rebase-i-break'Libravatar Junio C Hamano5-3/+40
"git rebase -i" learned a new insn, 'break', that the user can insert in the to-do list. Upon hitting it, the command returns control back to the user. * js/rebase-i-break: rebase -i: introduce the 'break' command rebase -i: clarify what happens on a failed `exec`
2018-11-02Merge branch 'js/rebase-autostash-fix'Libravatar Junio C Hamano2-3/+15
"git rebase" that has recently been rewritten in C had a few issues in its "--autstash" feature, which have been corrected. * js/rebase-autostash-fix: rebase --autostash: fix issue with dirty submodules rebase --autostash: demonstrate a problem with dirty submodules rebase (autostash): use an explicit OID to apply the stash rebase (autostash): store the full OID in <state-dir>/autostash rebase (autostash): avoid duplicate call to state_dir_path()
2018-11-02Merge branch 'cb/printf-empty-format'Libravatar Junio C Hamano1-1/+1
Build fix for a topic in flight. * cb/printf-empty-format: sequencer: cleanup for gcc warning in non developer mode
2018-11-02Merge branch 'jc/rebase-in-c-5-test-typofix'Libravatar Junio C Hamano1-3/+3
Typofix. * jc/rebase-in-c-5-test-typofix: rebase: fix typoes in error messages
2018-11-02Merge branch 'pk/rebase-in-c-6-final'Libravatar Junio C Hamano1-1/+1
The final step of rewriting "rebase -i" in C. * pk/rebase-in-c-6-final: rebase: default to using the builtin rebase
2018-11-02Merge branch 'js/rebase-in-c-5.5-work-with-rebase-i-in-c'Libravatar Junio C Hamano1-4/+83
"rebase" that has been rewritten learns the new calling convention used by "rebase -i" that was rewritten in C, tying the loose end between two GSoC topics that stomped on each other's toes. * js/rebase-in-c-5.5-work-with-rebase-i-in-c: builtin rebase: prepare for builtin rebase -i
2018-11-02Merge branch 'pk/rebase-in-c-5-test'Libravatar Junio C Hamano1-15/+135
Rewrite "git rebase" in C. * pk/rebase-in-c-5-test: builtin rebase: error out on incompatible option/mode combinations builtin rebase: use no-op editor when interactive is "implied" builtin rebase: show progress when connected to a terminal builtin rebase: fast-forward to onto if it is a proper descendant builtin rebase: optionally pass custom reflogs to reset_head() builtin rebase: optionally auto-detect the upstream
2018-11-02Merge branch 'pk/rebase-in-c-4-opts'Libravatar Junio C Hamano4-85/+530
Rewrite "git rebase" in C. * pk/rebase-in-c-4-opts: builtin rebase: support --root builtin rebase: add support for custom merge strategies builtin rebase: support `fork-point` option merge-base --fork-point: extract libified function builtin rebase: support --rebase-merges[=[no-]rebase-cousins] builtin rebase: support `--allow-empty-message` option builtin rebase: support `--exec` builtin rebase: support `--autostash` option builtin rebase: support `-C` and `--whitespace=<type>` builtin rebase: support `--gpg-sign` option builtin rebase: support `--autosquash` builtin rebase: support `keep-empty` option builtin rebase: support `ignore-date` option builtin rebase: support `ignore-whitespace` option builtin rebase: support --committer-date-is-author-date builtin rebase: support --rerere-autoupdate builtin rebase: support --signoff builtin rebase: allow selecting the rebase "backend"
2018-11-02Merge branch 'pk/rebase-in-c-3-acts'Libravatar Junio C Hamano3-4/+201
Rewrite "git rebase" in C. * pk/rebase-in-c-3-acts: builtin rebase: stop if `git am` is in progress builtin rebase: actions require a rebase in progress builtin rebase: support --edit-todo and --show-current-patch builtin rebase: support --quit builtin rebase: support --abort builtin rebase: support --skip builtin rebase: support --continue
2018-11-02Merge branch 'pk/rebase-in-c-2-basic'Libravatar Junio C Hamano1-13/+321
Rewrite "git rebase" in C. * pk/rebase-in-c-2-basic: builtin rebase: support `git rebase <upstream> <switch-to>` builtin rebase: only store fully-qualified refs in `options.head_name` builtin rebase: start a new rebase only if none is in progress builtin rebase: support --force-rebase builtin rebase: try to fast forward when possible builtin rebase: require a clean worktree builtin rebase: support the `verbose` and `diffstat` options builtin rebase: support --quiet builtin rebase: handle the pre-rebase hook and --no-verify builtin rebase: support `git rebase --onto A...B` builtin rebase: support --onto
2018-11-02Merge branch 'ag/rebase-i-in-c'Libravatar Junio C Hamano17-451/+742
Rewrite of the remaining "rebase -i" machinery in C. * ag/rebase-i-in-c: rebase -i: move rebase--helper modes to rebase--interactive rebase -i: remove git-rebase--interactive.sh rebase--interactive2: rewrite the submodes of interactive rebase in C rebase -i: implement the main part of interactive rebase as a builtin rebase -i: rewrite init_basic_state() in C rebase -i: rewrite write_basic_state() in C rebase -i: rewrite the rest of init_revisions_and_shortrevisions() in C rebase -i: implement the logic to initialize $revisions in C rebase -i: remove unused modes and functions rebase -i: rewrite complete_action() in C t3404: todo list with commented-out commands only aborts sequencer: change the way skip_unnecessary_picks() returns its result sequencer: refactor append_todo_help() to write its message to a buffer rebase -i: rewrite checkout_onto() in C rebase -i: rewrite setup_reflog_action() in C sequencer: add a new function to silence a command, except if it fails rebase -i: rewrite the edit-todo functionality in C editor: add a function to launch the sequence editor rebase -i: rewrite append_todo_help() in C sequencer: make three functions and an enum from sequencer.c public
2018-11-02Merge branch 'pk/rebase-in-c'Libravatar Junio C Hamano7-68/+503
Rewrite of the "rebase" machinery in C. * pk/rebase-in-c: builtin/rebase: support running "git rebase <upstream>" rebase: refactor common shell functions into their own file rebase: start implementing it as a builtin
2018-10-30Seventh batch for 2.20Libravatar Junio C Hamano1-0/+63
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-30Merge branch 'jk/uploadpack-packobjectshook-fix'Libravatar Junio C Hamano1-3/+6
Code clean-up that results in a small bugfix. * jk/uploadpack-packobjectshook-fix: upload-pack: fix broken if/else chain in config callback
2018-10-30Merge branch 'uk/merge-subtree-doc-update'Libravatar Junio C Hamano1-1/+1
Belated documentation update to adjust to a new world order that happened a yew years ago. * uk/merge-subtree-doc-update: howto/using-merge-subtree: mention --allow-unrelated-histories
2018-10-30Merge branch 'cb/compat-mmap-is-private-read-only'Libravatar Junio C Hamano1-1/+1
Code tightening. * cb/compat-mmap-is-private-read-only: compat: make sure git_mmap is not expected to write
2018-10-30Merge branch 'dl/mergetool-gui-option'Libravatar Junio C Hamano6-8/+46
"git mergetool" learned to take the "--[no-]gui" option, just like "git difftool" does. * dl/mergetool-gui-option: doc: document diff/merge.guitool config keys completion: support `git mergetool --[no-]gui` mergetool: accept -g/--[no-]gui as arguments
2018-10-30Merge branch 'js/mingw-load-sys-dll'Libravatar Junio C Hamano2-2/+4
The way DLLs are loaded on the Windows port has been improved. * js/mingw-load-sys-dll: mingw: load system libraries the recommended way
2018-10-30Merge branch 'js/mingw-getcwd'Libravatar Junio C Hamano1-2/+48
The way the Windows port figures out the current directory has been improved. * js/mingw-getcwd: mingw: fix getcwd when the parent directory cannot be queried mingw: ensure `getcwd()` reports the correct case
2018-10-30Merge branch 'cb/khash-maybe-unused-function'Libravatar Junio C Hamano3-3/+5
Build fix. * cb/khash-maybe-unused-function: khash: silence -Wunused-function for delta-islands commit-slabs: move MAYBE_UNUSED out
2018-10-30Merge branch 'jc/cocci-preincr'Libravatar Junio C Hamano2-1/+6
Code cleanup. * jc/cocci-preincr: fsck: s/++i > 1/i++/ cocci: simplify "if (++u > 1)" to "if (u++)"
2018-10-30Merge branch 'ss/rename-tests'Libravatar Junio C Hamano7-147/+137
Reorganize some tests and rename them; "ls t/" now gives a better overview of what is tested for these scripts than before. * ss/rename-tests: t7501: rename commit test to comply with naming convention t7500: rename commit tests script to comply with naming convention t7502: rename commit test script to comply with naming convention t7509: cleanup description and filename t2000: rename and combine checkout clash tests
2018-10-30Merge branch 'ah/doc-updates'Libravatar Junio C Hamano12-79/+92
Doc updates. * ah/doc-updates: doc: fix formatting in git-update-ref doc: fix indentation of listing blocks in gitweb.conf.txt doc: fix descripion for 'git tag --format' doc: fix inappropriate monospace formatting doc: fix ASCII art tab spacing doc: clarify boundaries of 'git worktree list --porcelain'
2018-10-30Merge branch 'ds/reachable'Libravatar Junio C Hamano1-2/+2
Trivial bugfix. * ds/reachable: commit-reach: fix cast in compare_commits_by_gen()
2018-10-30Merge branch 'jc/receive-deny-current-branch-fix'Libravatar Junio C Hamano2-4/+16
The receive.denyCurrentBranch=updateInstead codepath kicked in even when the push should have been rejected due to other reasons, such as it does not fast-forward or the update-hook rejects it, which has been corrected. * jc/receive-deny-current-branch-fix: receive: denyCurrentBranch=updateinstead should not blindly update
2018-10-30Merge branch 'ds/ci-commit-graph-and-midx'Libravatar Junio C Hamano1-0/+2
One of our CI tests to run with "unusual/experimental/random" settings now also uses commit-graph and midx. * ds/ci-commit-graph-and-midx: ci: add optional test variables
2018-10-30Merge branch 'jk/unused-function'Libravatar Junio C Hamano1-1/+0
Developer support. * jk/unused-function: config.mak.dev: enable -Wunused-function
2018-10-30Merge branch 'cb/remove-dead-init'Libravatar Junio C Hamano2-2/+2
Code clean-up. * cb/remove-dead-init: multi-pack-index: avoid dead store for struct progress unpack-trees: avoid dead store for struct progress
2018-10-30Merge branch 'js/diff-notice-has-drive-prefix'Libravatar Junio C Hamano2-2/+12
Under certain circumstances, "git diff D:/a/b/c D:/a/b/d" on Windows would strip initial parts from the paths because they were not recognized as absolute, which has been corrected. * js/diff-notice-has-drive-prefix: diff: don't attempt to strip prefix from absolute Windows paths
2018-10-30Merge branch 'ot/ref-filter-plug-leaks'Libravatar Junio C Hamano2-43/+59
Plugging a handful of memory leaks in the ref-filter codepath. * ot/ref-filter-plug-leaks: ref-filter: free item->value and item->value->s ls-remote: release memory instead of UNLEAK ref-filter: free memory from used_atom
2018-10-30Merge branch 'ds/reachable-first-parent-fix'Libravatar Junio C Hamano1-1/+3
Correct performance regression in commit ancestry computation when generation numbers are involved. * ds/reachable-first-parent-fix: commit-reach: fix first-parent heuristic