summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fetch-pack: do not check links for partial fetchjt/transfer-fsck-with-promissorJonathan Tan2018-03-152-2/+22
| | | | | | | | | | When doing a partial clone or fetch with transfer.fsckobjects=1, use the --fsck-objects instead of the --strict flag when invoking index-pack so that links are not checked, only objects. This is because incomplete links are expected when doing a partial clone or fetch. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* index-pack: support checking objects but not linksJonathan Tan2018-03-153-2/+12
| | | | | | | | | | | | | | The index-pack command currently supports the --check-self-contained-and-connected argument, for internal use only, that instructs it to only check for broken links and not broken objects. For partial clones, we need the inverse, so add a --fsck-objects argument that checks for broken objects and not broken links, also for internal use only. This will be used by fetch-pack in a subsequent patch. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'nd/parseopt-completion'Junio C Hamano2018-03-1425-238/+231
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach parse-options API an option to help the completion script, and make use of the mechanism in command line completion. * nd/parseopt-completion: (45 commits) completion: more subcommands in _git_notes() completion: complete --{reuse,reedit}-message= for all notes subcmds completion: simplify _git_notes completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate completion: use __gitcomp_builtin in _git_worktree completion: use __gitcomp_builtin in _git_tag completion: use __gitcomp_builtin in _git_status completion: use __gitcomp_builtin in _git_show_branch completion: use __gitcomp_builtin in _git_rm completion: use __gitcomp_builtin in _git_revert completion: use __gitcomp_builtin in _git_reset completion: use __gitcomp_builtin in _git_replace remote: force completing --mirror= instead of --mirror completion: use __gitcomp_builtin in _git_remote completion: use __gitcomp_builtin in _git_push completion: use __gitcomp_builtin in _git_pull completion: use __gitcomp_builtin in _git_notes completion: use __gitcomp_builtin in _git_name_rev completion: use __gitcomp_builtin in _git_mv completion: use __gitcomp_builtin in _git_merge_base ...
| * completion: more subcommands in _git_notes()Nguyễn Thái Ngọc Duy2018-03-071-2/+2
| | | | | | | | | | | | | | | | | | Two subcommands are added for completion: merge and get-ref. get-ref is more like plumbing. But since it does not share the prefix with any other subcommands, it won't slow anybody down. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: complete --{reuse,reedit}-message= for all notes subcmdsNguyễn Thái Ngọc Duy2018-03-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The new subcommand that takes these options is 'git notes edit'. Just accept the options from subcommands since we handle them the same way in builtin/notes.c anyway. If a user does git prune --reuse-message=... just let the command catches that error when it's executed. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: simplify _git_notesNguyễn Thái Ngọc Duy2018-03-071-11/+3
| | | | | | | | | | | | | | This also adds completion for 'git notes remove' and 'git notes edit'. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdateNguyễn Thái Ngọc Duy2018-03-073-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | There is not a strong reason to hide this option, and git-merge already completes this one. Let's allow to complete this for all commands (and let git-completion.bash do the suppressing if needed). This makes --rerere-autoupdate completable for am, cherry-pick and revert. rebase completion is fixed manually because it's a shell script and does not benefit from --git-completion-helper. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_worktreeNguyễn Thái Ngọc Duy2018-02-092-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | The new completable options for "worktree add" are: --checkout --guess-remote --lock --track Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_tagNguyễn Thái Ngọc Duy2018-02-091-5/+1
| | | | | | | | | | | | | | | | | | | | | | The new completable options are: --color --format= --ignore-case Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_statusNguyễn Thái Ngọc Duy2018-02-091-5/+1
| | | | | | | | | | | | | | The new completable options are --null and --show-stash. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_show_branchNguyễn Thái Ngọc Duy2018-02-091-6/+1
| | | | | | | | | | | | | | No new completable options! Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_rmNguyễn Thái Ngọc Duy2018-02-092-2/+2
| | | | | | | | | | | | | | No new completable options! Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_revertNguyễn Thái Ngọc Duy2018-02-091-5/+5
| | | | | | | | | | | | | | | | | | | | | | The new completable option is --gpg-sign In-progress options like --continue will be part of --git-completion-helper then filtered out by _git_revert() unless the operation is in progress. This helps keep marking of these operations in just one place. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_resetNguyễn Thái Ngọc Duy2018-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | The new completable options are: --intent-to-add --quiet --recurse-submodules Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_replaceNguyễn Thái Ngọc Duy2018-02-092-2/+3
| | | | | | | | | | | | | | The new completable option is --raw. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote: force completing --mirror= instead of --mirrorNguyễn Thái Ngọc Duy2018-02-093-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | "git remote --mirror" is a special case. Technically it is possible to specify --mirror without any argument. But we will get a "dangerous, deprecated!" warning in that case. This new parse-opt flag allows --git-completion-helper to always complete --mirror=, ignoring the dangerous use case. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_remoteNguyễn Thái Ngọc Duy2018-02-091-8/+8
| | | | | | | | | | | | | | No new completable options! Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_pushNguyễn Thái Ngọc Duy2018-02-092-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --atomic --exec= --ipv4 --ipv6 --no-verify --porcelain --progress --push-option --signed Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_pullNguyễn Thái Ngọc Duy2018-02-091-20/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is really nice. Since pull_options[] already declares all passthru options to 'merge' or 'fetch', a single git pull --git-completion-helper would provide all completable options (--no- variants are a separate issue). Dead shell variables can now be deleted. New completable options are: --allow-unrelated-histories --ipv4 --ipv6 --jobs --refmap= --signoff --strategy-option= Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_notesNguyễn Thái Ngọc Duy2018-02-092-8/+10
| | | | | | | | | | | | | | | | | | | | The new completable options are: --allow-empty (notes add and notes append) --for-rewrite= (notes copy) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_name_revNguyễn Thái Ngọc Duy2018-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --always --exclude --name-only --refs --undefined Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_mvNguyễn Thái Ngọc Duy2018-02-092-2/+3
| | | | | | | | | | | | | | The new completable option is --verbose. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_merge_baseNguyễn Thái Ngọc Duy2018-02-091-1/+1
| | | | | | | | | | | | | | The new completion option is --all. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_mergeNguyễn Thái Ngọc Duy2018-02-091-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New completable options are: --allow-unrelated-histories --message= --overwrite-ignore --signoff --strategy-option= --summary --verify The variable $__git_merge_options remains because _git_pull() still needs it. It will soon be gone after _git_pull() is updated. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_ls_remoteNguyễn Thái Ngọc Duy2018-02-092-3/+4
| | | | | | | | | | | | | | The new completable options are --quiet and --upload-pack=. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_ls_filesNguyễn Thái Ngọc Duy2018-02-091-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --debug --empty-directory --eol --recurse-submodules --resolve-undo Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_initNguyễn Thái Ngọc Duy2018-02-091-1/+1
| | | | | | | | | | | | | | The new completable option is --separate-git-dir=. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_helpNguyễn Thái Ngọc Duy2018-02-091-1/+1
| | | | | | | | | | | | | | No new completable options! Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_grepNguyễn Thái Ngọc Duy2018-02-092-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --after-context= --before-context= --color --context --exclude-standard --quiet --recurse-submodules --textconv Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_gcNguyễn Thái Ngọc Duy2018-02-092-3/+6
| | | | | | | | | | | | | | The new completable option is --quiet. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_fsckNguyễn Thái Ngọc Duy2018-02-091-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --connectivity-only --dangling --progress --reflogs Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_fetchNguyễn Thái Ngọc Duy2018-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New completable options: --deepen= --ipv4 --ipv6 --jobs= --multiple --progress --refmap= --shallow-exclude= --shallow-since= --update-head-ok Since _git_pull() needs fetch options too, $__git_fetch_options remains. This variable will soon be gone after _git_pull() is updated. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_difftoolNguyễn Thái Ngọc Duy2018-02-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Since we can't automatically extract diff options for completion yet, difftool will take all options from $__git_diff_common_options. This brings _a lot_ more completable options to difftool. --ignore-submodules is added to $__git_diff_common_options to avoid regression in difftool. But it's a good thing anyway even for other diff commands. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_describeNguyễn Thái Ngọc Duy2018-02-091-5/+1
| | | | | | | | | | | | | | No new completable options! Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_configNguyễn Thái Ngọc Duy2018-02-091-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --blob= --bool --bool-or-int --edit --expiry-date --get-color --get-colorbool --get-urlmatch --includes --int --null --path --show-origin Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_commitNguyễn Thái Ngọc Duy2018-02-091-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new comletable options are: --branch --gpg-sign --long --no-post-rewrite --null --porcelain --status --allow-empty is no longer completable because it's a hidden option since 4741edd549 (Remove deprecated OPTION_BOOLEAN for parsing arguments - 2013-08-03) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_cloneNguyễn Thái Ngọc Duy2018-02-091-20/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --config --dissociate --ipv4 --ipv6 --jobs= --progress --reference-if-able --separate-git-dir= --shallow-exclude --shallow-since= --verbose Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_cleanNguyễn Thái Ngọc Duy2018-02-092-2/+2
| | | | | | | | | | | | | | The new completable options are --exclude and --interactive Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_cherry_pickNguyễn Thái Ngọc Duy2018-02-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --allow-empty --allow-empty-message --ff --gpg-sign --keep-redundant-commits --strategy-option In-progress options like --continue will be part of --git-completion-helper then filtered out by _git_cherry_pick() unless the operation is in progress. This helps keep marking of these operations in just one place. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_checkoutNguyễn Thái Ngọc Duy2018-02-093-12/+13
| | | | | | | | | | | | | | | | | | | | The new completable options are: --ignore-other-worktrees --progress Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_branchNguyễn Thái Ngọc Duy2018-02-092-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --all --create-reflog --format= --ignore-case --quiet Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_applyNguyễn Thái Ngọc Duy2018-02-092-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --3way --allow-overlap --build-fake-ancestor= --directory --exclude --include --index-info is no longer completable but that's because it's renamed to --build-fake-ancestor in 26b2800768 (apply: get rid of --index-info in favor of --build-fake-ancestor - 2007-09-17) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_amNguyễn Thái Ngọc Duy2018-02-093-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are: --directory --exclude --gpg-sign --include --keep-cr --keep-non-patch --message-id --no-keep-cr --patch-format --quiet --reject --resolvemsg= In-progress options like --continue will be part of --git-completion-helper then filtered out by _git_am() unless the operation is in progress. This helps keep marking of these operations in just one place. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: use __gitcomp_builtin in _git_addNguyễn Thái Ngọc Duy2018-02-091-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The new completable options are --all --ignore-missing --ignore-removal --renormalize --verbose Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-completion.bash: introduce __gitcomp_builtinNguyễn Thái Ngọc Duy2018-02-091-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a __gitcomp wrapper that will execute git ... --git-completion-helper to get the list of completable options. The call will be made only once and cached to avoid performance issues, especially on Windows. __gitcomp_builtin() allows callers to change its output a bit by adding some more options, or removing some. - Current --git-completion-helper for example does not output --no-foo form, this has to be added manually by __gitcomp_builtin() callers when necessary - Some options from --git-completion-helper should only be available in certain conditions (e.g. --continue and friends). __gitcomp_builtin() callers can remove them if the conditions are not met. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * parse-options: let OPT__FORCE take optional flags argumentNguyễn Thái Ngọc Duy2018-02-0914-15/+17
| | | | | | | | | | | | | | | | | | | | | | --force option is most likely hidden from command line completion for safety reasons. This is done by adding an extra flag PARSE_OPT_NOCOMPLETE. Update OPT__FORCE() to accept additional flags. Actual flag change comes later depending on individual commands. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * parse-options: add OPT_xxx_F() variantsNguyễn Thái Ngọc Duy2018-02-091-7/+12
| | | | | | | | | | | | | | | | | | These macros allow us to add extra parse-options flag, the main one in my mind is PARSE_OPT_NOCOMPLETE to hide certain options from --git-completion-helper. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * parse-options: support --git-completion-helperNguyễn Thái Ngọc Duy2018-02-092-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option is designed to be used by git-completion.bash. For many simple cases, what we do in there is usually __gitcomp "lots of completion options" which has to be manually updated when a new user-visible option is added. With support from parse-options, we can write __gitcomp "$(git command --git-completion-helper)" and get that list directly from the parser for free. Dangerous/Unpopular options could be hidden with the new "NOCOMPLETE" flag. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'nd/object-allocation-comments'Junio C Hamano2018-03-145-12/+20
|\ \ | | | | | | | | | | | | | | | | | | | | | Code doc update. * nd/object-allocation-comments: object.h: realign object flag allocation comment object.h: update flag allocation comment
| * | object.h: realign object flag allocation commentnd/object-allocation-commentsNguyễn Thái Ngọc Duy2018-03-061-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | Some new path names are too long and eat into the graph part. Move the graph 9 columns to the right to avoid this. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>