summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Documentation/git-submodule: cleanup "add" sectionks/submodule-add-docKaartic Sivaraam2017-06-221-28/+21
| | | | | | | | | | | | | | | | | | | | | | | The "add" section for 'git-submodule' is redundant in its description and the short synopsis line. Fix it. Remove the redundant mentioning of the 'repository' argument being mandatory. The text is hard to read because of back-references, so remove those. Replace the word "humanish" by "canonical" as that conveys better what we do to guess the path. While at it, quote all occurrences of '.gitmodules' as that is an important file in the submodule context, also link to it on its first mention. Helped-by: Stefan Beller <sbeller@google.com> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Ninth batch for 2.14Junio C Hamano2017-06-191-0/+29
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jk/consistent-h'Junio C Hamano2017-06-1912-13/+72
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git $cmd -h" for builtin commands calls the implementation of the command (i.e. cmd_$cmd() function) without doing any repository set-up, and the commands that expect RUN_SETUP is done by the Git potty needs to be prepared to show the help text without barfing. * jk/consistent-h: t0012: test "-h" with builtins git: add hidden --list-builtins option version: convert to parse-options diff- and log- family: handle "git cmd -h" early submodule--helper: show usage for "-h" remote-{ext,fd}: print usage message on invalid arguments upload-archive: handle "-h" option early credential: handle invalid arguments earlier
| * t0012: test "-h" with builtinsjk/consistent-hJeff King2017-06-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 99caeed05 (Let 'git <command> -h' show usage without a git dir, 2009-11-09), the git wrapper handles "-h" specially, skipping any repository setup but still calling the builtin's cmd_foo() function. This means that every cmd_foo() must be ready to handle this case, but we don't have any systematic tests. This led to "git am -h" being broken for some time without anybody noticing. This patch just tests that "git foo -h" works for every builtin, where we see a 129 exit code (the normal code for our usage() helper), and that the word "usage" appears in the output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git: add hidden --list-builtins optionJeff King2017-06-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | It can be useful in the test suite to be able to iterate over the list of builtins. We could do this with some Makefile magic. But since the authoritative list is in the commands array inside git.c, and since this could also be handy for debugging, let's add a hidden command-line option to dump that list. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * version: convert to parse-optionsJeff King2017-06-051-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The "git version" command didn't traditionally accept any options, and in fact ignores any you give it. When we added simple option parsing for "--build-options" in 6b9c38e14, we didn't improve this; we just loop over the arguments and pick out the one we recognize. Instead, let's move to a real parsing loop, complain about nonsense options, and recognize conventions like "-h". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * diff- and log- family: handle "git cmd -h" earlyJunio C Hamano2017-06-054-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git $builtin -h" bypasses the usual repository setup and calls the cmd_$builtin() function, expecting it to show the help text. Unfortunately the commands in the log- and the diff- family want to call into the revisions machinery, which by definition needs to have a repository already discovered. Strictly speaking, they may not need a repository only for parsing "-h", but it is a good discipline to future-proof codepath to ensure that setup_revisions() is called after we know that a repository is there. Handle the "git $builtin -h" special case very early in these commands to work around potential issues. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * submodule--helper: show usage for "-h"Jeff King2017-05-301-3/+2
| | | | | | | | | | | | | | | | | | Normal users shouldn't ever call submodule--helper, but it doesn't hurt to give them a normal usage message if they try "-h". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-{ext,fd}: print usage message on invalid argumentsJeff King2017-05-302-2/+8
| | | | | | | | | | | | | | | | | | | | We just say "Expected two arguments" when we get a different number of arguments, but we can be slightly friendlier. People shouldn't generally be running remote helpers themselves, but curious users might say "git remote-ext -h". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * upload-archive: handle "-h" option earlyJeff King2017-05-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally upload-archive forks off upload-archive--writer to do the real work, and relays any errors back over the sideband channel. This is a good thing when the command is properly invoked remotely via ssh or git-daemon. But it's confusing to curious users who try "git upload-archive -h". Let's catch this invocation early and give a real usage message, rather than spewing "-h does not appear to be a git repository" amidst packet-lines. The chance of a false positive due to a real client asking for the repo "-h" is quite small. Likewise, we'll catch "-h" in upload-archive--writer. People shouldn't be invoking it manually, but it doesn't hurt to give a sane message if they do. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * credential: handle invalid arguments earlierJeff King2017-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git-credential command only takes one argument: the operation to perform. If we don't have one, we complain immediately. But if we have one that we don't recognize, we don't notice until after we've read the credential from stdin. This is likely to confuse a user invoking "git credential -h", as the program will hang waiting for their input before showing anything. Let's detect this case early. Likewise, we never noticed when there are extra arguments beyond the one we're expecting. Let's catch this with the same conditional. Note that we don't need to handle "--help" similarly, because the git wrapper does this before even calling cmd_credential(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ab/perf-remove-index-lock'Junio C Hamano2017-06-191-1/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an existing repository is used for t/perf testing, we first create bit-for-bit copy of it, which may grab a transient state of the repository and freeze it into the repository used for testing, which then may cause Git operations to fail. Single out "the index being locked" case and forcibly drop the lock from the copy. * ab/perf-remove-index-lock: perf: work around the tested repo having an index.lock
| * | perf: work around the tested repo having an index.lockab/perf-remove-index-lockÆvar Arnfjörð Bjarmason2017-06-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the tested repo has an index.lock file it should be removed. This file may be present if e.g. git-status previously crashed in that repo, and it will make a lot of git commands fail. Let's try harder and remove the lock. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'bw/object-id'Junio C Hamano2017-06-1936-525/+539
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion from uchar[20] to struct object_id continues. * bw/object-id: (33 commits) diff: rename diff_fill_sha1_info to diff_fill_oid_info diffcore-rename: use is_empty_blob_oid tree-diff: convert path_appendnew to object_id tree-diff: convert diff_tree_paths to struct object_id tree-diff: convert try_to_follow_renames to struct object_id builtin/diff-tree: cleanup references to sha1 diff-tree: convert diff_tree_sha1 to struct object_id notes-merge: convert write_note_to_worktree to struct object_id notes-merge: convert verify_notes_filepair to struct object_id notes-merge: convert find_notes_merge_pair_ps to struct object_id notes-merge: convert merge_from_diffs to struct object_id notes-merge: convert notes_merge* to struct object_id tree-diff: convert diff_root_tree_sha1 to struct object_id combine-diff: convert find_paths_* to struct object_id combine-diff: convert diff_tree_combined to struct object_id diff: convert diff_flush_patch_id to struct object_id patch-ids: convert to struct object_id diff: finish conversion for prepare_temp_file to struct object_id diff: convert reuse_worktree_file to struct object_id diff: convert fill_filespec to struct object_id ...
| * | | diff: rename diff_fill_sha1_info to diff_fill_oid_infoBrandon Williams2017-06-051-9/+9
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diffcore-rename: use is_empty_blob_oidBrandon Williams2017-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | tree-diff: convert path_appendnew to object_idBrandon Williams2017-06-051-3/+3
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | tree-diff: convert diff_tree_paths to struct object_idBrandon Williams2017-06-053-38/+39
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | tree-diff: convert try_to_follow_renames to struct object_idBrandon Williams2017-06-051-3/+5
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | builtin/diff-tree: cleanup references to sha1Brandon Williams2017-06-051-5/+3
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff-tree: convert diff_tree_sha1 to struct object_idBrandon Williams2017-06-0516-46/+47
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes-merge: convert write_note_to_worktree to struct object_idBrandon Williams2017-06-051-10/+10
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes-merge: convert verify_notes_filepair to struct object_idBrandon Williams2017-06-051-10/+10
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes-merge: convert find_notes_merge_pair_ps to struct object_idBrandon Williams2017-06-051-12/+12
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes-merge: convert merge_from_diffs to struct object_idBrandon Williams2017-06-051-15/+16
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes-merge: convert notes_merge* to struct object_idBrandon Williams2017-06-053-42/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert notes_merge and notes_merge_commit to use struct object_id. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | tree-diff: convert diff_root_tree_sha1 to struct object_idBrandon Williams2017-06-025-8/+8
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | combine-diff: convert find_paths_* to struct object_idBrandon Williams2017-06-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert find_paths_generic and find_paths_multitree to use struct object_id. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | combine-diff: convert diff_tree_combined to struct object_idBrandon Williams2017-06-023-7/+7
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: convert diff_flush_patch_id to struct object_idBrandon Williams2017-06-023-8/+8
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | patch-ids: convert to struct object_idBrandon Williams2017-06-023-13/+13
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: finish conversion for prepare_temp_file to struct object_idBrandon Williams2017-06-021-2/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: convert reuse_worktree_file to struct object_idBrandon Williams2017-06-021-5/+5
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: convert fill_filespec to struct object_idBrandon Williams2017-06-0210-21/+21
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: convert diff_change to struct object_idBrandon Williams2017-06-025-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert diff_change to take a struct object_id. In addition convert the function pointer type 'change_fn_t' to also take a struct object_id. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: convert run_diff_files to struct object_idBrandon Williams2017-06-021-6/+6
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: convert diff_addremove to struct object_idBrandon Williams2017-06-025-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert diff_addremove to take a struct object_id. In addtion convert the function pointer type 'add_remove_fn_t' to also take a struct object_id. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: convert diff_index_show_file to struct object_idBrandon Williams2017-06-021-5/+5
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diff: convert get_stat_data to struct object_idBrandon Williams2017-06-021-13/+13
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | grep: convert to struct object_idBrandon Williams2017-06-024-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the remaining parts of grep to use struct object_id. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes: convert some accessor functions to struct object_idbrian m. carlson2017-06-027-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert add_note, get_note, and copy_note to take struct object_id. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | builtin/notes: convert to struct object_idbrian m. carlson2017-06-025-60/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert most of the static functions to use struct object_id. In addition, convert copy_notes_for_rewrite and its callers. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes: convert format_display_notes to struct object_idbrian m. carlson2017-06-024-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes: make get_note return pointer to struct object_idbrian m. carlson2017-06-025-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make get_note return a pointer to a const struct object_id. Add a defensive check to ensure we don't accidentally dereference a NULL pointer. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes: convert for_each_note to struct object_idbrian m. carlson2017-06-024-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert for_each_note and each of the callbacks to use struct object_id. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes: convert internal parts to struct object_idbrian m. carlson2017-06-021-31/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert several portions of the internals of the code to struct object_id. Introduce two macros to denote the different constants in the code: KEY_INDEX for the last byte of the object ID, and FANOUT_PATH_SEPARATORS for the number of possible path separators (on Unix, "/"). While these constants are both 19 (one less than the number of bytes in the hash), distinguish them to make the code more understandable, and define them logically based on their intended purpose. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | notes: convert internal structures to struct object_idbrian m. carlson2017-06-021-47/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the internal structures using unsigned char [20] to take struct object_id using the following semantic patch and the standard object_id transforms: @@ struct leaf_node E1; @@ - E1.key_sha1 + E1.key_oid.hash @@ struct leaf_node *E1; @@ - E1->key_sha1 + E1->key_oid.hash @@ struct leaf_node E1; @@ - E1.key_sha1 + E1.key_oid.hash @@ struct leaf_node *E1; @@ - E1->key_sha1 + E1->key_oid.hash @@ struct non_note E1; @@ - E1.sha1 + E1.oid.hash @@ struct non_note *E1; @@ - E1->sha1 + E1->oid.hash Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'sb/submodule-rm-absorb'Junio C Hamano2017-06-191-4/+5
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doc update to a recently graduated topic. * sb/submodule-rm-absorb: Documentation/git-rm: correct submodule description
| * | | | Documentation/git-rm: correct submodule descriptionsb/submodule-rm-absorbStefan Beller2017-06-041-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 3ccd681c2a (Merge branch 'sb/submodule-rm-absorb', 2017-01-18) git-rm tries to absorb any submodules git dir before deleting the submodule. Correct the documentation to say so. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'ab/pcre-v2'Junio C Hamano2017-06-1910-29/+349
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update "perl-compatible regular expression" support to enable JIT and also allow linking with the newer PCRE v2 library. * ab/pcre-v2: grep: add support for PCRE v2 grep: un-break building with PCRE >= 8.32 without --enable-jit grep: un-break building with PCRE < 8.20 grep: un-break building with PCRE < 8.32 grep: add support for the PCRE v1 JIT API log: add -P as a synonym for --perl-regexp grep: skip pthreads overhead when using one thread grep: don't redundantly compile throwaway patterns under threading