summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-18Merge branch 'jk/branch-l-0-deprecation'Junio C Hamano
The "-l" option in "git branch -l" is an unfortunate short-hand for "--create-reflog", but many users, both old and new, somehow expect it to be something else, perhaps "--list". This step warns when "-l" is used as a short-hand for "--create-reflog" and warns about the future repurposing of the it when it is used. * jk/branch-l-0-deprecation: branch: deprecate "-l" option t: switch "branch -l" to "branch --create-reflog" t3200: unset core.logallrefupdates when testing reflog creation
2018-07-18Merge branch 'tb/grep-column'Junio C Hamano
"git grep" learned the "--column" option that gives not just the line number but the column number of the hit. * tb/grep-column: contrib/git-jump/git-jump: jump to exact location grep.c: add configuration variables to show matched option builtin/grep.c: add '--column' option to 'git-grep(1)' grep.c: display column number of first match grep.[ch]: extend grep_opt to allow showing matched column grep.c: expose {,inverted} match column in match_line() Documentation/config.txt: camel-case lineNumber for consistency
2018-07-18Merge branch 'vs/typofixes'Junio C Hamano
Doc fix. * vs/typofixes: Documentation: spelling and grammar fixes
2018-07-18Merge branch 'bw/protocol-v2'Junio C Hamano
Doc fix. * bw/protocol-v2: protocol-v2 doc: put HTTP headers after request
2018-07-18Merge branch 'jt/remove-pack-bitmap-global'Junio C Hamano
The effort to move globals to per-repository in-core structure continues. * jt/remove-pack-bitmap-global: pack-bitmap: add free function pack-bitmap: remove bitmap_git global variable
2018-07-18Merge branch 'bw/config-refer-to-gitsubmodules-doc'Junio C Hamano
Docfix. * bw/config-refer-to-gitsubmodules-doc: docs: link to gitsubmodules
2018-07-18Merge branch 'xy/format-patch-prereq-patch-id-fix'Junio C Hamano
Recently added "--base" option to "git format-patch" command did not correctly generate prereq patch ids. * xy/format-patch-prereq-patch-id-fix: format-patch: clear UNINTERESTING flag before prepare_bases
2018-07-18Merge branch 'pw/rebase-i-keep-reword-after-conflict'Junio C Hamano
Bugfix for "rebase -i" corner case regression. * pw/rebase-i-keep-reword-after-conflict: sequencer: do not squash 'reword' commits when we hit conflicts
2018-07-18Merge branch 'ld/p423'Junio C Hamano
Code preparation to make "git p4" closer to be usable with Python 3. * ld/p423: git-p4: python3: fix octal constants git-p4: python3: use print() function git-p4: python3: basestring workaround git-p4: python3: remove backticks git-p4: python3: replace dict.has_key(k) with "k in dict" git-p4: python3: replace <> with !=
2018-07-18Merge branch 'ds/ewah-cleanup'Junio C Hamano
Remove unused function definitions and declarations from ewah bitmap subsystem. * ds/ewah-cleanup: ewah: delete unused 'rlwit_discharge_empty()' ewah: drop ewah_serialize_native function ewah: drop ewah_deserialize function ewah_io: delete unused 'ewah_serialize()' ewah_bitmap: delete unused 'ewah_or()' ewah_bitmap: delete unused 'ewah_not()' ewah_bitmap: delete unused 'ewah_and_not()' ewah_bitmap: delete unused 'ewah_and()' ewah/bitmap.c: delete unused 'bitmap_each_bit()' ewah/bitmap.c: delete unused 'bitmap_clear()'
2018-07-18Merge branch 'sb/submodule-core-worktree'Junio C Hamano
"git submodule" did not correctly adjust core.worktree setting that indicates whether/where a submodule repository has its associated working tree across various state transitions, which has been corrected. * sb/submodule-core-worktree: submodule deinit: unset core.worktree submodule: ensure core.worktree is set after update submodule: unset core.worktree if no working tree is present
2018-07-18Merge branch 'sb/object-store-grafts'Junio C Hamano
The conversion to pass "the_repository" and then "a_repository" throughout the object access API continues. * sb/object-store-grafts: commit: allow lookup_commit_graft to handle arbitrary repositories commit: allow prepare_commit_graft to handle arbitrary repositories shallow: migrate shallow information into the object parser path.c: migrate global git_path_* to take a repository argument cache: convert get_graft_file to handle arbitrary repositories commit: convert read_graft_file to handle arbitrary repositories commit: convert register_commit_graft to handle arbitrary repositories commit: convert commit_graft_pos() to handle arbitrary repositories shallow: add repository argument to is_repository_shallow shallow: add repository argument to check_shallow_file_for_update shallow: add repository argument to register_shallow shallow: add repository argument to set_alternate_shallow_file commit: add repository argument to lookup_commit_graft commit: add repository argument to prepare_commit_graft commit: add repository argument to read_graft_file commit: add repository argument to register_commit_graft commit: add repository argument to commit_graft_pos object: move grafts to object parser object-store: move object access functions to object-store.h
2018-07-18Merge branch 'en/merge-recursive-cleanup'Junio C Hamano
Code cleanup. * en/merge-recursive-cleanup: merge-recursive: add pointer about unduly complex looking code merge-recursive: rename conflict_rename_*() family of functions merge-recursive: clarify the rename_dir/RENAME_DIR meaning merge-recursive: align labels with their respective code blocks merge-recursive: fix numerous argument alignment issues merge-recursive: fix miscellaneous grammar error in comment
2018-07-17diff.c: factor advance_or_nullify out of mark_color_as_movedStefan Beller
This moves the part of code that checks if we're still in a block into its own function. We'll need a different approach on advancing the blocks in a later patch, so having it as a separate function will prove useful. While at it rename the variable `p` to `prev` to indicate that it refers to the previous line. This is as pmb[i] was assigned in the last iteration of the outmost for loop. Further rename `pnext` to `cur` to indicate that this should match up with the current line of the outmost for loop. Also replace the advancement of pmb[i] to reuse `cur` instead of using `p->next` (which is how the name for pnext could be explained. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-17diff.c: decouple white space treatment from move detection algorithmStefan Beller
In the original implementation of the move detection logic the choice for ignoring white space changes is the same for the move detection as it is for the regular diff. Some cases came up where different treatment would have been nice. Allow the user to specify that white space should be ignored differently during detection of moved lines than during generation of added and removed lines. This is done by providing analogs to the --ignore-space-at-eol, -b, and -w options by introducing the option --color-moved-ws=<modes> with the modes named "ignore-space-at-eol", "ignore-space-change" and "ignore-all-space", which is used only during the move detection phase. As we change the default, we'll adjust the tests. For now we do not infer any options to treat white spaces in the move detection from the generic white space options given to diff. This can be tuned later to reasonable default. As we plan on adding more white space related options in a later patch, that interferes with the current white space options, use a flag field and clamp it down to XDF_WHITESPACE_FLAGS, as that (a) allows to easily check at parse time if we give invalid combinations and (b) can reuse parts of this patch. By having the white space treatment in its own option, we'll also make it easier for a later patch to have an config option for spaces in the move detection. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-17diff.c: add a blocks mode for moved code detectionStefan Beller
The new "blocks" mode provides a middle ground between plain and zebra. It is as intuitive (few colors) as plain, but still has the requirement for a minimum of lines/characters to count a block as moved. Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> (https://public-inbox.org/git/87o9j0uljo.fsf@evledraar.gmail.com/) Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-17diff.c: adjust hash function signature to match hashmap expectationStefan Beller
This makes the follow up patch easier. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-17diff.c: do not pass diff options as keydata to hashmapStefan Beller
When we initialize the hashmap, we give it a pointer to the diff_options, which it then passes along to each call of the hashmap_cmp_fn function. There's no need to pass it a second time as the "keydata" parameter, and our comparison functions never look at keydata. This was a mistake left over from an earlier round of 2e2d5ac184 (diff.c: color moved lines differently, 2017-06-30), before hashmap learned to pass the data pointer for us. Explanation-by: Jeff King <peff@peff.net> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-17t4015: avoid git as a pipe inputStefan Beller
In t4015 we have a pattern of git diff [<options, related to color>] | grep -v "index" | test_decode_color >actual && to produce output that we want to test against. This pattern was introduced in 86b452e2769 (diff.c: add dimming to moved line detection, 2017-06-30) as then the focus on getting the colors right. However the pattern used is not best practice as we do care about the exit code of Git. So let's not have Git as the upstream of a pipe. Piping the output of grep to some function is fine as we assume grep to be un-flawed in our test suite. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-17xdiff/xdiffi.c: remove unneeded function declarationsStefan Beller
There is no need to forward-declare these functions, as they are used after their implementation only. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-17xdiff/xdiff.h: remove unused flagsStefan Beller
These flags were there since the beginning (3443546f6e (Use a *real* built-in diff generator, 2006-03-24), but were never used. Remove them. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-17t5608: fix broken &&-chainSZEDER Gábor
This was missed by the previous clean-ups. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t/check-non-portable-shell: detect "FOO=bar shell_func"Eric Sunshine
One-shot environment variable assignments, such as 'FOO' in "FOO=bar cmd", exist only during the invocation of 'cmd'. However, if 'cmd' happens to be a shell function, then 'FOO' is assigned in the executing shell itself, and that assignment remains until the process exits (unless explicitly unset). Since this side-effect of "FOO=bar shell_func" is unlikely to be intentional, detect and report such usage. To distinguish shell functions from other commands, perform a pre-scan of shell scripts named as input, gleaning a list of function names by recognizing lines of the form (loosely matching whitespace): shell_func () { and later report suspect lines of the form (loosely matching quoted values): FOO=bar [BAR=foo ...] shell_func Also take care to stitch together incomplete lines (those ending with "\") since suspect invocations may be split over multiple lines: FOO=bar BAR=foo \ shell_func Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t/check-non-portable-shell: make error messages more compactEric Sunshine
Error messages emitted by this linting script are long and noisy, consisting of several sections: <test-script>:<line#>: error: <explanation>: <failed-shell-text> The line of failed shell text, usually coming from within a test body, is often indented by one or two TABs, with the result that the actual (important) text is separated from <explanation> by a good deal of empty space. This can make for a difficult read, especially on typical 80-column terminals. Make the messages more compact and perhaps a bit easier to digest by folding out the leading whitespace from <failed-shell-text>. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t/check-non-portable-shell: stop being so politeEric Sunshine
Error messages emitted by this linting script are long and noisy, consisting of several sections: <test-script>:<line#>: error: <explanation>: <failed-shell-text> Many problem explanations ask the reader to "please" use a suggested alternative, however, such politeness is unnecessary and just adds to the noise and length of the line, so drop "please" to make the message a bit more concise. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t6046/t9833: fix use of "VAR=VAL cmd" with a shell functionEric Sunshine
Unlike "FOO=bar cmd" one-shot environment variable assignments which exist only for the invocation of 'cmd', those assigned by "FOO=bar shell_func" exist within the running shell and continue to do so until the process exits (or are explicitly unset). It is unlikely that this behavior was intended by the test author. In these particular tests, the "FOO=bar shell_func" invocations are already in subshells, so the assignments don't last too long, don't appear to harm subsequent commands in the same subshells, and don't affect other tests in the same scripts, however, the usage is nevertheless misleading and poor practice, so fix the tests to assign and export the environment variables in the usual fashion. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16Merge branch 'jc/t3404-one-shot-export-fix' into es/test-lint-one-shot-exportJunio C Hamano
* jc/t3404-one-shot-export-fix: t3404: fix use of "VAR=VAL cmd" with a shell function
2018-07-16t9119: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t9000-t9999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t7000-t7999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t6000-t6999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t5000-t5999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t4000-t4999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t3030: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t3000-t3999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t2000-t2999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t1000-t1999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t0000-t0999: fix broken &&-chainsEric Sunshine
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t9814: simplify convoluted check that command correctly errors outEric Sunshine
This test uses a convoluted method to verify that "p4 help" errors out when asked for help about an unknown command. In doing so, it intentionally breaks the &&-chain. Simplify by employing the typical "! command" idiom and a normal &&-chain instead. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t9001: fix broken "invoke hook" testEric Sunshine
This test has been dysfunctional since it was added by 6489660b4b (send-email: support validate hook, 2017-05-12), however, the problem went unnoticed due to a broken &&-chain late in the test. The test wants to verify that a non-zero exit code from the 'sendemail-validate' hook causes git-send-email to abort with a particular error message. A command which is expected to fail should be run with 'test_must_fail', however, the test neglects to do so. Fix this problem, as well as the broken &&-chain behind which the problem hid. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t7810: use test_expect_code() instead of hand-rolled comparisonEric Sunshine
This test manually checks the exit code of git-grep for a particular value. In doing so, it intentionally breaks the &&-chain. Modernize the test by taking advantage of test_expect_code() and a normal &&-chain. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16t7400: fix broken "submodule add/reconfigure --force" testEric Sunshine
This test has been dysfunctional since it was added by 619acfc78c (submodule add: extend force flag to add existing repos, 2016-10-06), however, two problems early in the test went unnoticed due to a broken &&-chain later in the test. First, it tries configuring the submodule with repository "bogus-url", however, "git submodule add" insists that the repository be either an absolute URL or a relative pathname requiring prefix "./" or "../" (this is true even with --force), but "bogus-url" does not meet those criteria, thus the command fails. Second, it then tries configuring a submodule with a path which is .gitignore'd, which is disallowed. This restriction can be overridden with --force, but the test neglects to use that option. Fix both problems, as well as the broken &&-chain behind which they hid. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16vcbuild/README: update to accommodate for missing common-cmds.hJohannes Schindelin
In 60f487ac0ef (Remove common-cmds.h, 2018-05-10), we forgot to adjust this README when removing the common-cmds.h file. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16pretty: switch hard-coded constants to the_hash_algobrian m. carlson
Switch several hard-coded constants into expressions based either on GIT_MAX_HEXSZ or the_hash_algo. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16sha1-file: convert constants to uses of the_hash_algobrian m. carlson
Convert one use of 20 and several uses of GIT_SHA1_HEXSZ into references to the_hash_algo. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16log-tree: switch GIT_SHA1_HEXSZ to the_hash_algo->hexszbrian m. carlson
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16diff: switch GIT_SHA1_HEXSZ to use the_hash_algobrian m. carlson
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16builtin/merge-recursive: make hash independentbrian m. carlson
Use GIT_MAX_HEXSZ instead of GIT_SHA1_HEXSZ for an allocation so that it is sufficiently large. Switch a comparison to use the_hash_algo to determine the length of a hex object ID. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16builtin/merge: switch to use the_hash_algobrian m. carlson
Switch uses of GIT_SHA1_HEXSZ to use the_hash_algo instead. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16builtin/fmt-merge-msg: make hash independentbrian m. carlson
Convert several uses of GIT_SHA1_HEXSZ into references to the_hash_algo. Switch other uses into a use of parse_oid_hex and uses of its computed pointer. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>