summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-01-28parse-options: allow ll_callback with OPTION_CALLBACKNguyễn Thái Ngọc Duy
OPTION_CALLBACK is much simpler/safer to use, but parse_opt_cb does not allow access to parse_opt_ctx_t, which sometimes is useful (e.g. to obtain the prefix). Extending parse_opt_cb to take parse_opt_cb could result in a lot of changes. Instead let's just allow ll_callback to be used with OPTION_CALLBACK. The user will have to be careful, not to change anything in ctx, or return wrong result code. But that's the price for ll_callback. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-28parse-options: avoid magic return codesNguyễn Thái Ngọc Duy
Give names to these magic negative numbers. Make parse_opt_ll_cb return an enum to make clear it can actually control parse_options() with different return values (parse_opt_cb can too, but nobody needs it). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-28parse-options: stop abusing 'callback' for lowlevel callbacksNguyễn Thái Ngọc Duy
Lowlevel callbacks have different function signatures. Add a new field in 'struct option' with the right type for lowlevel callbacks. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-28parse-options: add OPT_BITOP()Nguyễn Thái Ngọc Duy
This is needed for diff_opt_parse() where we do value = (value & ~mask) | some_more; Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-28parse-options: disable option abbreviation with PARSE_OPT_KEEP_UNKNOWNNguyễn Thái Ngọc Duy
parse-options can unambiguously find an abbreviation only if it sees all available options. This is usually the case when you use parse_options(). But there are other callers like blame or shortlog which uses parse_options_start() in combination with a custom option parser, like rev-list. parse-options cannot see all options in this case and will get abbrev detection wrong. Disable it. t7800 needs update because --symlink no longer expands to --symlinks and will be passed down to git-diff, which will not recognize it. I still think this is the correct thing to do. But if --symlink has been actually used in the wild, we would just add an option alias for it. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-28parse-options: add one-shot modeNguyễn Thái Ngọc Duy
This is to help reimplement diff_opt_parse() using parse_options(). The behavior of parse_options() is changed to be the same as the other: - no argv0 in argv[], everything can be processed - argv[] must not be updated, it's the caller's job to do that - return the number of arguments processed - leave all unknown options / non-options alone (this one can already be achieved with PARSE_OPT_KEEP_UNKNOWN and PARSE_OPT_STOP_AT_NON_OPTION) This mode is NOT supposed to stay here for long. It's to help converting diff/rev option parsing. Once that work is over and we can just use parse_options() throughout the code base, this will be deleted. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-18parse-options.h: remove extern on function prototypesNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-18Third batch after 2.20Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-18Merge branch 'js/gc-repack-close-before-remove'Junio C Hamano
"git gc" and "git repack" did not close the open packfiles that they found unneeded before removing them, which didn't work on a platform incapable of removing an open file. This has been corrected. * js/gc-repack-close-before-remove: gc/repack: release packs when needed
2019-01-18Merge branch 'en/show-ref-doc-fix'Junio C Hamano
Doc update. * en/show-ref-doc-fix: git-show-ref.txt: fix order of flags
2019-01-18Merge branch 'ot/ref-filter-object-info'Junio C Hamano
The "--format=<placeholder>" option of for-each-ref, branch and tag learned to show a few more traits of objects that can be learned by the object_info API. * ot/ref-filter-object-info: ref-filter: give uintmax_t to format with %PRIuMAX ref-filter: add docs for new options ref-filter: add tests for deltabase ref-filter: add deltabase option ref-filter: add tests for objectsize:disk ref-filter: add check for negative file size ref-filter: add objectsize:disk option
2019-01-18Merge branch 'sg/stress-test'Junio C Hamano
Flaky tests can now be repeatedly run under load with the "--stress" option. * sg/stress-test: test-lib: add the '--stress' option to run a test repeatedly under load test-lib-functions: introduce the 'test_set_port' helper function test-lib: set $TRASH_DIRECTORY earlier test-lib: consolidate naming of test-results paths test-lib: parse command line options earlier test-lib: parse options in a for loop to keep $@ intact test-lib: extract Bash version check for '-x' tracing test-lib: translate SIGTERM and SIGHUP to an exit
2019-01-18Merge branch 'rs/sha1-file-close-mapped-file-on-error'Junio C Hamano
Code clean-up. * rs/sha1-file-close-mapped-file-on-error: sha1-file: close fd of empty file in map_sha1_file_1()
2019-01-18Merge branch 'rs/loose-object-cache-perffix'Junio C Hamano
The loose object cache used to optimize existence look-up has been updated. * rs/loose-object-cache-perffix: object-store: retire odb_load_loose_cache() object-store: use one oid_array per subdirectory for loose cache object-store: factor out odb_clear_loose_cache() object-store: factor out odb_loose_cache()
2019-01-18Merge branch 'po/git-p4-wo-login'Junio C Hamano
"git p4" update. * po/git-p4-wo-login: git-p4: fix problem when p4 login is not necessary
2019-01-18Merge branch 'mm/multimail-1.5'Junio C Hamano
Update "git multimail" from the upstream. * mm/multimail-1.5: git-multimail: update to release 1.5.0
2019-01-18Merge branch 'tg/t5570-drop-racy-test'Junio C Hamano
An inherently racy test that caused intermittent failures has been removed. * tg/t5570-drop-racy-test: Revert "t/lib-git-daemon: record daemon log" t5570: drop racy test
2019-01-18Merge branch 'jk/dev-build-format-security'Junio C Hamano
Earlier we added "-Wformat-security" to developer builds, assuming that "-Wall" (which includes "-Wformat" which in turn is required to use "-Wformat-security") is always in effect. This is not true when config.mak.autogen is in use, unfortunately. This has been fixed by unconditionally adding "-Wall" to developer builds. * jk/dev-build-format-security: config.mak.dev: add -Wall, primarily for -Wformat, to help autoconf users
2019-01-18Merge branch 'so/cherry-pick-always-allow-m1'Junio C Hamano
"git cherry-pick -m1" was forbidden when picking a non-merge commit, even though there _is_ parent number 1 for such a commit. This was done to avoid mistakes back when "cherry-pick" was about picking a single commit, but is no longer useful with "cherry-pick" that can pick a range of commits. Now the "-m$num" option is allowed when picking any commit, as long as $num names an existing parent of the commit. Technically this is a backward incompatible change; hopefully nobody is relying on the error-checking behaviour. * so/cherry-pick-always-allow-m1: t3506: validate '-m 1 -ff' is now accepted for non-merge commits t3502: validate '-m 1' argument is now accepted for non-merge commits cherry-pick: do not error on non-merge commits when '-m 1' is specified t3510: stop using '-m 1' to force failure mid-sequence of cherry-picks
2019-01-18Merge branch 'nd/worktree-remove-with-uninitialized-submodules'Junio C Hamano
"git worktree remove" and "git worktree move" refused to work when there is a submodule involved. This has been loosened to ignore uninitialized submodules. * nd/worktree-remove-with-uninitialized-submodules: worktree: allow to (re)move worktrees with uninitialized submodules
2019-01-18Merge branch 'sg/test-bash-version-fix'Junio C Hamano
The test suite tried to see if it is run under bash, but the check itself failed under some other implementations of shell (notably under NetBSD). This has been corrected. * sg/test-bash-version-fix: test-lib: check Bash version for '-x' without using shell arrays
2019-01-18Merge branch 'rb/hpe'Junio C Hamano
Portability updates for the HPE NonStop platform. * rb/hpe: compat/regex/regcomp.c: define intptr_t and uintptr_t on NonStop git-compat-util.h: add FLOSS headers for HPE NonStop config.mak.uname: support for modern HPE NonStop config. transport-helper: drop read/write errno checks transport-helper: use xread instead of read
2019-01-18Merge branch 'ed/simplify-setup-git-dir'Junio C Hamano
Code simplification. * ed/simplify-setup-git-dir: Simplify handling of setup_git_directory_gently() failure cases.
2019-01-18Merge branch 'cy/zsh-completion-SP-in-path'Junio C Hamano
With zsh, "git cmd path<TAB>" was completed to "git cmd path name" when the completed path has a special character like SP in it, without any attempt to keep "path name" a single filename. This has been fixed to complete it to "git cmd path\ name" just like Bash completion does. * cy/zsh-completion-SP-in-path: completion: treat results of git ls-tree as file paths zsh: complete unquoted paths with spaces correctly
2019-01-18Merge branch 'cy/completion-typofix'Junio C Hamano
Typofix. * cy/completion-typofix: completion: fix typo in git-completion.bash
2019-01-18Merge branch 'ew/ban-strncat'Junio C Hamano
The "strncat()" function is now among the banned functions. * ew/ban-strncat: banned.h: mark strncat() as banned
2019-01-18Merge branch 'ds/commit-graph-assert-missing-parents'Junio C Hamano
Tightening error checking in commit-graph writer. * ds/commit-graph-assert-missing-parents: commit-graph: writing missing parents is a BUG
2019-01-18Merge branch 'es/doc-worktree-guessremote-config'Junio C Hamano
Doc clarification. * es/doc-worktree-guessremote-config: doc/config: do a better job of introducing 'worktree.guessRemote'
2019-01-18Merge branch 'sb/submodule-unset-core-worktree-when-worktree-is-lost'Junio C Hamano
The core.worktree setting in a submodule repository should not be pointing at a directory when the submodule loses its working tree (e.g. getting deinit'ed), but the code did not properly maintain this invariant. * sb/submodule-unset-core-worktree-when-worktree-is-lost: submodule deinit: unset core.worktree submodule--helper: fix BUG message in ensure_core_worktree submodule: unset core.worktree if no working tree is present submodule update: add regression test with old style setups
2019-01-18Merge branch 'ma/asciidoctor'Junio C Hamano
Some of the documentation pages formatted incorrectly with Asciidoctor, which have been fixed. * ma/asciidoctor: git-status.txt: render tables correctly under Asciidoctor Documentation: do not nest open blocks git-column.txt: fix section header
2019-01-18Merge branch 'jn/stripspace-wo-repository'Junio C Hamano
"git stripspace" should be usable outside a git repository, but under the "-s" or "-c" mode, it didn't. * jn/stripspace-wo-repository: stripspace: allow -s/-c outside git repository
2019-01-18Merge branch 'sb/submodule-fetchjobs-default-to-one'Junio C Hamano
"git submodule update" ought to use a single job unless asked, but by mistake used multiple jobs, which has been fixed. * sb/submodule-fetchjobs-default-to-one: submodule update: run at most one fetch job unless otherwise set
2019-01-18Merge branch 'la/quiltimport-keep-non-patch'Junio C Hamano
"git quiltimport" learned "--keep-non-patch" option. * la/quiltimport-keep-non-patch: git-quiltimport: add --keep-non-patch option
2019-01-18Merge branch 'nd/style-opening-brace'Junio C Hamano
Code clean-up. * nd/style-opening-brace: style: the opening '{' of a function is in a separate line
2019-01-18Merge branch 'ds/gc-doc-typofix'Junio C Hamano
Typofix. * ds/gc-doc-typofix: git-gc.txt: fix typo about gc.writeCommitGraph
2019-01-14Second batch after 2.20Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-14Merge branch 'do/gitweb-strict-export-conf-doc'Junio C Hamano
Doc update. * do/gitweb-strict-export-conf-doc: docs: fix $strict_export text in gitweb.conf.txt
2019-01-14Merge branch 'nd/indentation-fix'Junio C Hamano
Code cleanup. * nd/indentation-fix: Indent code with TABs
2019-01-14Merge branch 'en/directory-renames-nothanks-doc-update'Junio C Hamano
Doc update. * en/directory-renames-nothanks-doc-update: git-rebase.txt: update note about directory rename detection and am
2019-01-14Merge branch 'bw/mailmap'Junio C Hamano
* bw/mailmap: mailmap: update brandon williams's email address
2019-01-14Merge branch 'fd/gitweb-snapshot-conf-doc-fix'Junio C Hamano
Doc update. * fd/gitweb-snapshot-conf-doc-fix: docs/gitweb.conf: config variable typo
2019-01-14Merge branch 'tb/use-common-win32-pathfuncs-on-cygwin'Junio C Hamano
Cygwin update. * tb/use-common-win32-pathfuncs-on-cygwin: git clone <url> C:\cygwin\home\USER\repo' is working (again)
2019-01-14Merge branch 'km/rebase-doc-typofix'Junio C Hamano
Doc update. * km/rebase-doc-typofix: rebase docs: drop stray word in merge command description
2019-01-14Merge branch 'md/exclude-promisor-objects-fix-cleanup'Junio C Hamano
Code clean-up. * md/exclude-promisor-objects-fix-cleanup: revision.c: put promisor option in specialized struct
2019-01-14Merge branch 'tb/log-G-binary'Junio C Hamano
"git log -G<regex>" looked for a hunk in the "git log -p" patch output that contained a string that matches the given pattern. Optimize this code to ignore binary files, which by default will not show any hunk that would match any pattern (unless textconv or the --text option is in effect, that is). * tb/log-G-binary: log -G: ignore binary files
2019-01-14Merge branch 'sb/diff-color-moved-config-option-fixup'Junio C Hamano
Minor inconsistency fix. * sb/diff-color-moved-config-option-fixup: diff: align move detection error handling with other options
2019-01-14Merge branch 'hn/highlight-sideband-keywords'Junio C Hamano
Lines that begin with a certain keyword that come over the wire, as well as lines that consist only of one of these keywords, ought to be painted in color for easier eyeballing, but the latter was broken ever since the feature was introduced in 2.19, which has been corrected. * hn/highlight-sideband-keywords: sideband: color lines with keyword only
2019-01-14Merge branch 'cb/test-lint-cp-a'Junio C Hamano
BSD port update. * cb/test-lint-cp-a: tests: add lint for non portable cp -a
2019-01-14Merge branch 'cb/t5004-empty-tar-archive-fix'Junio C Hamano
BSD port update. * cb/t5004-empty-tar-archive-fix: t5004: avoid using tar for empty packages
2019-01-14Merge branch 'cb/openbsd-allows-reading-directory'Junio C Hamano
BSD port update. * cb/openbsd-allows-reading-directory: config.mak.uname: OpenBSD uses BSD semantics with fread for directories