summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-06rerere: only return whether a path has conflicts or notThomas Gummerer
We currently return the exact number of conflict hunks a certain path has from the 'handle_paths' function. However all of its callers only care whether there are conflicts or not or if there is an error. Return only that information, and document that only that information is returned. This will simplify the code in the subsequent steps. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-06rerere: fix crash with files rerere can't handleThomas Gummerer
Currently when a user does a conflict resolution and ends it (in any way that calls 'git rerere' again) with a file 'rerere' can't handle, subsequent rerere operations that are interested in that path, such as 'rerere clear' or 'rerere forget <path>' will fail, or even worse in the case of 'rerere clear' segfault. Such states include nested conflicts, or a conflict marker that doesn't have any match. This is because 'git rerere' calculates a conflict file and writes it to the MERGE_RR file. When the user then changes the file in any way rerere can't handle, and then calls 'git rerere' on it again to record the conflict resolution, the handle_file function fails, and removes the 'preimage' file in the rr-cache in the process, while leaving the ID in the MERGE_RR file. Now when 'rerere clear' is run, it reads the ID from the MERGE_RR file, however the 'fit_variant' function for the ID is never called as the 'preimage' file does not exist anymore. This means 'collection->status' in 'has_rerere_resolution' is NULL, and the command will crash. To fix this, remove the rerere ID from the MERGE_RR file in the case when we can't handle it, just after the 'preimage' file was removed and remove the corresponding variant from .git/rr-cache/. Removing it unconditionally is fine here, because if the user would have resolved the conflict and ran rerere, the entry would no longer be in the MERGE_RR file, so we wouldn't have this problem in the first place, while if the conflict was not resolved. Currently there is nothing left in this folder, as the 'preimage' was already deleted by the 'handle_file' function, so 'remove_variant' is a no-op. Still call the function, to make sure we clean everything up, in case we add some other files corresponding to a variant in the future. Note that other variants that have the same conflict ID will not be touched. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-06rerere: add documentation for conflict normalizationThomas Gummerer
Add some documentation for the logic behind the conflict normalization in rerere. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-06rerere: mark strings for translationThomas Gummerer
'git rerere' is considered a porcelain command and as such its output should be translated. Its functionality is also only enabled through a config setting, so scripts really shouldn't rely on the output either way. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16rerere: wrap paths in output in sqThomas Gummerer
It looks like most paths in the output in the git codebase are wrapped in single quotes. Standardize on that in rerere as well. Apart from being more consistent, this also makes some of the strings match strings that are already translated in other parts of the codebase, thus reducing the work for translators, when the strings are marked for translation in a subsequent commit. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16rerere: lowercase error messagesThomas Gummerer
Documentation/CodingGuidelines mentions that error messages should be lowercase. Prior to marking them for translation follow that pattern in rerere as well, so translators won't have to translate messages that don't conform to our guidelines. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16rerere: unify error messages when read_cache failsThomas Gummerer
We have multiple different variants of the error message we show to the user if 'read_cache' fails. The "Could not read index" variant we are using in 'rerere.c' is currently not used anywhere in translated form. As a subsequent commit will mark all output that comes from 'rerere.c' for translation, make the life of the translators a little bit easier by using a string that is used elsewhere, and marked for translation there, and thus most likely already translated. "index file corrupt" seems to be the most common error message we show when 'read_cache' fails, so use that here as well. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-28Second batch for 2.19 cycleJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-28Merge branch 'sb/fix-fetching-moved-submodules'Junio C Hamano
The code to try seeing if a fetch is necessary in a submodule during a fetch with --recurse-submodules got confused when the path to the submodule was changed in the range of commits in the superproject, sometimes showing "(null)". This has been corrected. * sb/fix-fetching-moved-submodules: t5526: test recursive submodules when fetching moved submodules submodule: fix NULL correctness in renamed broken submodules
2018-06-28Merge branch 'tz/cred-netrc-cleanup'Junio C Hamano
Build and test procedure for netrc credential helper (in contrib/) has been updated. * tz/cred-netrc-cleanup: git-credential-netrc: make "all" default target of Makefile git-credential-netrc: fix exit status when tests fail git-credential-netrc: use in-tree Git.pm for tests git-credential-netrc: minor whitespace cleanup in test script
2018-06-28Merge branch 'jc/clean-after-sanity-tests'Junio C Hamano
test cleanup. * jc/clean-after-sanity-tests: tests: clean after SANITY tests
2018-06-28Merge branch 'nd/completion-negation'Junio C Hamano
Continuing with the idea to programmatically enumerate various pieces of data required for command line completion, the codebase has been taught to enumerate options prefixed with "--no-" to negate them. * nd/completion-negation: completion: collapse extra --no-.. options completion: suppress some -no- options parse-options: option to let --git-completion-helper show negative form
2018-06-28Merge branch 'pw/add-p-recount'Junio C Hamano
When user edits the patch in "git add -p" and the user's editor is set to strip trailing whitespaces indiscriminately, an empty line that is unchanged in the patch would become completely empty (instead of a line with a sole SP on it). The code introduced in Git 2.17 timeframe failed to parse such a patch, but now it learned to notice the situation and cope with it. * pw/add-p-recount: add -p: fix counting empty context lines in edited patches
2018-06-28Merge branch 'jk/fetch-all-peeled-fix'Junio C Hamano
"git fetch-pack --all" used to unnecessarily fail upon seeing an annotated tag that points at an object other than a commit. * jk/fetch-all-peeled-fix: fetch-pack: test explicitly that --all can fetch tag references pointing to non-commits fetch-pack: don't try to fetch peel values with --all
2018-06-28Merge branch 'ms/send-pack-honor-config'Junio C Hamano
"git send-pack --signed" (hence "git push --signed" over the http transport) did not read user ident from the config mechanism to determine whom to sign the push certificate as, which has been corrected. * ms/send-pack-honor-config: builtin/send-pack: populate the default configs
2018-06-28Merge branch 'jh/partial-clone'Junio C Hamano
The recent addition of "partial clone" experimental feature kicked in when it shouldn't, namely, when there is no partial-clone filter defined even if extensions.partialclone is set. * jh/partial-clone: list-objects: check if filter is NULL before using
2018-06-28Merge branch 'sg/gpg-tests-fix'Junio C Hamano
Some flaky tests have been fixed. * sg/gpg-tests-fix: tests: make forging GPG signed commits and tags more robust t7510-signed-commit: use 'test_must_fail'
2018-06-28Merge branch 'as/safecrlf-quiet-fix'Junio C Hamano
Fix for 2.17-era regression around `core.safecrlf`. * as/safecrlf-quiet-fix: config.c: fix regression for core.safecrlf false
2018-06-28Merge branch 'ab/refspec-init-fix'Junio C Hamano
Make refspec parsing codepath more robust. * ab/refspec-init-fix: refspec: initalize `refspec_item` in `valid_fetch_refspec()` refspec: add back a refspec_item_init() function refspec: s/refspec_item_init/&_or_die/g
2018-06-25First batch for 2.19 cycleJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-25Merge branch 'sb/plug-misc-leaks'Junio C Hamano
Misc leak plugging. * sb/plug-misc-leaks: sequencer.c: plug mem leak in git_sequencer_config sequencer.c: plug leaks in do_pick_commit submodule--helper: plug mem leak in print_default_remote refs/packed-backend.c: close fd of empty file
2018-06-25Merge branch 'cc/tests-without-assuming-ref-files-backend'Junio C Hamano
Instead of mucking with filesystem directly, use plumbing commands update-ref etc. to manipulate the refs in the tests. * cc/tests-without-assuming-ref-files-backend: t9104: kosherly remove remote refs
2018-06-25Merge branch 'sg/update-ref-stdin-cleanup'Junio C Hamano
Code cleanup. * sg/update-ref-stdin-cleanup: update-ref --stdin: use skip_prefix()
2018-06-25Merge branch 'nd/reject-empty-shallow-request'Junio C Hamano
"git fetch --shallow-since=<cutoff>" that specifies the cut-off point that is newer than the existing history used to end up grabbing the entire history. Such a request now errors out. * nd/reject-empty-shallow-request: upload-pack: reject shallow requests that would return nothing
2018-06-25Merge branch 'ls/complete-remote-update-names'Junio C Hamano
"git remote update" can take both a single remote nickname and a nickname for remote groups, and the completion script (in contrib/) has been taught about it. * ls/complete-remote-update-names: completion: complete remote names too
2018-06-25Merge branch 'ag/rebase-p'Junio C Hamano
Separate "rebase -p" codepath out of "rebase -i" implementation to slim down the latter and make it easier to manage. * ag/rebase-p: rebase: remove -p code from git-rebase--interactive.sh rebase: use the new git-rebase--preserve-merges.sh rebase: strip unused code in git-rebase--preserve-merges.sh rebase: introduce a dedicated backend for --preserve-merges
2018-06-25Merge branch 'nd/complete-config-vars'Junio C Hamano
Continuing with the idea to programatically enumerate various pieces of data required for command line completion, teach the codebase to report the list of configuration variables subcommands care about to help complete them. * nd/complete-config-vars: completion: complete general config vars in two steps log-tree: allow to customize 'grafted' color completion: support case-insensitive config vars completion: keep other config var completion in camelCase completion: drop the hard coded list of config vars am: move advice.amWorkDir parsing back to advice.c advice: keep config name in camelCase in advice_config[] fsck: produce camelCase config key names help: add --config to list all available config fsck: factor out msg_id_info[] lazy initialization code grep: keep all colors in an array Add and use generic name->id mapping code for color slot parsing
2018-06-25Merge branch 'sb/object-store-alloc'Junio C Hamano
The conversion to pass "the_repository" and then "a_repository" throughout the object access API continues. * sb/object-store-alloc: alloc: allow arbitrary repositories for alloc functions object: allow create_object to handle arbitrary repositories object: allow grow_object_hash to handle arbitrary repositories alloc: add repository argument to alloc_commit_index alloc: add repository argument to alloc_report alloc: add repository argument to alloc_object_node alloc: add repository argument to alloc_tag_node alloc: add repository argument to alloc_commit_node alloc: add repository argument to alloc_tree_node alloc: add repository argument to alloc_blob_node object: add repository argument to grow_object_hash object: add repository argument to create_object repository: introduce parsed objects field
2018-06-25Merge branch 'jk/show-index'Junio C Hamano
Modernize a less often used command. * jk/show-index: show-index: update documentation for index v2 make show-index a builtin
2018-06-25Merge branch 'en/merge-recursive-tests'Junio C Hamano
Clean up tests in t6xxx series about 'merge' command. * en/merge-recursive-tests: t6036: prefer test_when_finished to manual cleanup in following test t6036, t6042: prefer test_cmp to sequences of test t6036, t6042: prefer test_path_is_file, test_path_is_missing t6036, t6042: use test_line_count instead of wc -l t6036, t6042: use test_create_repo to keep tests independent
2018-06-25Merge branch 'nd/diff-apply-ita'Junio C Hamano
"git diff" compares the index and the working tree. For paths added with intent-to-add bit, the command shows the full contents of them as added, but the paths themselves were not marked as new files. They are now shown as new by default. "git apply" learned the "--intent-to-add" option so that an otherwise working-tree-only application of a patch will add new paths to the index marked with the "intent-to-add" bit. * nd/diff-apply-ita: apply: add --intent-to-add t2203: add a test about "diff HEAD" case diff: turn --ita-invisible-in-index on by default diff: ignore --ita-[in]visible-in-index when diffing worktree-to-tree
2018-06-25Merge branch 'ds/commit-graph-lockfile-fix'Junio C Hamano
Update to ds/generation-numbers topic. * ds/commit-graph-lockfile-fix: commit-graph: fix UX issue when .lock file exists commit-graph.txt: update design document merge: check config before loading commits commit: use generation number in remove_redundant() commit: add short-circuit to paint_down_to_common() commit: use generation numbers for in_merge_bases() ref-filter: use generation number for --contains commit-graph: always load commit-graph information commit: use generations in paint_down_to_common() commit-graph: compute generation numbers commit: add generation number to struct commit ref-filter: fix outdated comment on in_commit_list
2018-06-25Merge branch 'nd/commit-util-to-slab'Junio C Hamano
The in-core "commit" object had an all-purpose "void *util" field, which was tricky to use especially in library-ish part of the code. All of the existing uses of the field has been migrated to a more dedicated "commit-slab" mechanism and the field is eliminated. * nd/commit-util-to-slab: commit.h: delete 'util' field in struct commit merge: use commit-slab in merge remote desc instead of commit->util log: use commit-slab in prepare_bases() instead of commit->util show-branch: note about its object flags usage show-branch: use commit-slab for commit-name instead of commit->util name-rev: use commit-slab for rev-name instead of commit->util bisect.c: use commit-slab for commit weight instead of commit->util revision.c: use commit-slab for show_source sequencer.c: use commit-slab to associate todo items to commits sequencer.c: use commit-slab to mark seen commits shallow.c: use commit-slab for commit depth instead of commit->util describe: use commit-slab for commit names instead of commit->util blame: use commit-slab for blame suspects instead of commit->util commit-slab: support shared commit-slab commit-slab.h: code split
2018-06-25Merge branch 'pc/submodule-helper-foreach'Junio C Hamano
The bulk of "git submodule foreach" has been rewritten in C. * pc/submodule-helper-foreach: submodule: port submodule subcommand 'foreach' from shell to C submodule foreach: document variable '$displaypath' submodule foreach: document '$sm_path' instead of '$path' submodule foreach: correct '$path' in nested submodules from a subdirectory
2018-06-25Prepare to start 2.19 cycleJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-25sequencer.c: plug mem leak in git_sequencer_configStefan Beller
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-21Git 2.18v2.18.0Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-19Merge branch 'en/rename-directory-detection-reboot'Junio C Hamano
* en/rename-directory-detection-reboot: merge-recursive: use xstrdup() instead of fixed buffer
2018-06-19Merge tag 'l10n-2.18.0-rnd3.1' of git://github.com/git-l10n/git-poJunio C Hamano
Merge Korean translation for l10n of Git 2.18.0 round 3 * tag 'l10n-2.18.0-rnd3.1' of git://github.com/git-l10n/git-po: l10n: ko.po: Update Korean translation
2018-06-19Merge branch 'cf/submodule-progress-dissociate'Junio C Hamano
* cf/submodule-progress-dissociate: t7400: encapsulate setup code in test_expect_success
2018-06-19Merge branch 'js/rebase-i-root-fix'Junio C Hamano
* js/rebase-i-root-fix: t3404: check root commit in 'rebase -i --root reword root commit'
2018-06-19t7400: encapsulate setup code in test_expect_successStefan Beller
When running t7400 in a shell you observe more output than expected: ... ok 8 - setup - hide init subdirectory ok 9 - setup - repository to add submodules to ok 10 - submodule add [master (root-commit) d79ce16] one Author: A U Thor <author@example.com> 1 file changed, 1 insertion(+) create mode 100644 one.t ok 11 - redirected submodule add does not show progress ok 12 - redirected submodule add --progress does show progress ok 13 - submodule add to .gitignored path fails ... Fix the output by encapsulating the setup code in test_expect_success Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-19t3404: check root commit in 'rebase -i --root reword root commit'Todd Zullinger
When testing a reworded root commit, ensure that the squash-onto commit which is created and amended is still the root commit. Suggested-by: Phillip Wood <phillip.wood@talktalk.net> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-19doc: fix typos in documentation and release notesKarthikeyan Singaravelan
Signed-off-by: Karthikeyan Singaravelan <tir.karthi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-18git-credential-netrc: make "all" default target of MakefileTodd Zullinger
Running "make" in contrib/credential/netrc should run the "all" target rather than the "test" target. Add an empty "all::" target like most of our other Makefiles. Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-18Almost 2.18 finalJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-18Merge branch 'es/make-no-iconv'Junio C Hamano
"make NO_ICONV=NoThanks" did not override NEEDS_LIBICONV (i.e. linkage of -lintl, -liconv, etc. that are platform-specific tweaks), which has been corrected. * es/make-no-iconv: Makefile: make NO_ICONV really mean "no iconv"
2018-06-18Merge branch 'sg/t7406-chain-fix'Junio C Hamano
Test fix. * sg/t7406-chain-fix: t7406-submodule-update: fix broken &&-chains
2018-06-18Merge branch 'ks/branch-set-upstream'Junio C Hamano
A test title has been reworded to clarify it. * ks/branch-set-upstream: t3200: clarify description of --set-upstream test
2018-06-18Merge branch 'js/rebase-i-root-fix'Junio C Hamano
A regression to "rebase -i --root" introduced during this cycle has been fixed. * js/rebase-i-root-fix: rebase --root: fix amending root commit messages rebase --root: demonstrate a bug while amending root commit messages